summaryrefslogtreecommitdiffstats
path: root/src/kile
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-10 03:05:17 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-10 03:05:17 +0000
commit2c945cd914550233ed352ff195afeb4dd793f122 (patch)
tree4796bfab5733942b90b5a66bb05655be5fdcca03 /src/kile
downloadkile-2c945cd914550233ed352ff195afeb4dd793f122.tar.gz
kile-2c945cd914550233ed352ff195afeb4dd793f122.zip
Added abandoned KDE3 version of Kile
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kile@1088055 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kile')
-rw-r--r--src/kile/CMakeLists.txt162
-rw-r--r--src/kile/Makefile.am116
-rw-r--r--src/kile/cleandialog.cpp96
-rw-r--r--src/kile/cleandialog.h46
-rw-r--r--src/kile/codecompletion.cpp1465
-rw-r--r--src/kile/codecompletion.h211
-rw-r--r--src/kile/complete/CMakeLists.txt3
-rw-r--r--src/kile/complete/Makefile.am1
-rw-r--r--src/kile/complete/abbreviation/CMakeLists.txt4
-rw-r--r--src/kile/complete/abbreviation/Makefile.am2
-rw-r--r--src/kile/complete/abbreviation/example.cwl14
-rw-r--r--src/kile/complete/dictionary/CMakeLists.txt4
-rw-r--r--src/kile/complete/dictionary/Makefile.am2
-rw-r--r--src/kile/complete/dictionary/example.cwl12
-rw-r--r--src/kile/complete/dictionary/metapost.cwl307
-rw-r--r--src/kile/complete/tex/CMakeLists.txt100
-rw-r--r--src/kile/complete/tex/Makefile.am95
-rw-r--r--src/kile/complete/tex/acronym.cwl38
-rw-r--r--src/kile/complete/tex/afterpage.cwl3
-rw-r--r--src/kile/complete/tex/amsbsy.cwl4
-rw-r--r--src/kile/complete/tex/amsfonts.cwl33
-rw-r--r--src/kile/complete/tex/amsmath.cwl142
-rw-r--r--src/kile/complete/tex/amsopn.cwl42
-rw-r--r--src/kile/complete/tex/amssymb.cwl207
-rw-r--r--src/kile/complete/tex/amsthm.cwl18
-rw-r--r--src/kile/complete/tex/array.cwl8
-rw-r--r--src/kile/complete/tex/attachfile.cwl12
-rw-r--r--src/kile/complete/tex/beamerfoils.cwl17
-rw-r--r--src/kile/complete/tex/beamerprosper.cwl49
-rw-r--r--src/kile/complete/tex/beamerseminar.cwl14
-rw-r--r--src/kile/complete/tex/beamertexpower.cwl21
-rw-r--r--src/kile/complete/tex/booktabs.cwl15
-rw-r--r--src/kile/complete/tex/braket.cwl8
-rw-r--r--src/kile/complete/tex/calc.cwl21
-rw-r--r--src/kile/complete/tex/class-beamer.cwl446
-rw-r--r--src/kile/complete/tex/class-letter.cwl15
-rw-r--r--src/kile/complete/tex/class-scrartcl,scrreprt,scrbook.cwl124
-rw-r--r--src/kile/complete/tex/class-scrlttr2.cwl91
-rw-r--r--src/kile/complete/tex/color.cwl13
-rw-r--r--src/kile/complete/tex/colortbl.cwl12
-rw-r--r--src/kile/complete/tex/coordsys.cwl25
-rw-r--r--src/kile/complete/tex/currvita.cwl14
-rw-r--r--src/kile/complete/tex/cyrillic.cwl159
-rw-r--r--src/kile/complete/tex/diagxy.cwl43
-rw-r--r--src/kile/complete/tex/doi.cwl7
-rw-r--r--src/kile/complete/tex/enumerate.cwl3
-rw-r--r--src/kile/complete/tex/fancybox.cwl58
-rw-r--r--src/kile/complete/tex/fancyhdr.cwl21
-rw-r--r--src/kile/complete/tex/fancyunits-base.cwl175
-rw-r--r--src/kile/complete/tex/fancyunits-np.cwl60
-rw-r--r--src/kile/complete/tex/fancyunits-per.cwl71
-rw-r--r--src/kile/complete/tex/fancyunits_big-fractions.cwl58
-rw-r--r--src/kile/complete/tex/fancyunits_medium-fractions.cwl58
-rw-r--r--src/kile/complete/tex/fancyunits_small-fractions.cwl58
-rw-r--r--src/kile/complete/tex/fancyvrb.cwl14
-rw-r--r--src/kile/complete/tex/fontspec.cwl49
-rw-r--r--src/kile/complete/tex/graphicx.cwl25
-rw-r--r--src/kile/complete/tex/hyperref.cwl35
-rw-r--r--src/kile/complete/tex/ifthen.cwl18
-rw-r--r--src/kile/complete/tex/import.cwl11
-rw-r--r--src/kile/complete/tex/jurabib.cwl32
-rw-r--r--src/kile/complete/tex/latex-209.cwl5
-rw-r--r--src/kile/complete/tex/latex-dev.cwl177
-rw-r--r--src/kile/complete/tex/latex-document.cwl462
-rw-r--r--src/kile/complete/tex/latex-l2tabu.cwl16
-rw-r--r--src/kile/complete/tex/latex-mathsymbols.cwl269
-rw-r--r--src/kile/complete/tex/layout.cwl3
-rw-r--r--src/kile/complete/tex/listings.cwl20
-rw-r--r--src/kile/complete/tex/logsys.cwl22
-rw-r--r--src/kile/complete/tex/longtable.cwl17
-rw-r--r--src/kile/complete/tex/lscape.cwl2
-rw-r--r--src/kile/complete/tex/manyfoot.cwl16
-rw-r--r--src/kile/complete/tex/mdwlist.cwl17
-rw-r--r--src/kile/complete/tex/multicol.cwl15
-rw-r--r--src/kile/complete/tex/multido.cwl3
-rw-r--r--src/kile/complete/tex/pdfpages.cwl8
-rw-r--r--src/kile/complete/tex/psfrag.cwl8
-rw-r--r--src/kile/complete/tex/pst-3d.cwl12
-rw-r--r--src/kile/complete/tex/pst-blur.cwl4
-rw-r--r--src/kile/complete/tex/pst-char.cwl17
-rw-r--r--src/kile/complete/tex/pst-coil.cwl22
-rw-r--r--src/kile/complete/tex/pst-eps.cwl8
-rw-r--r--src/kile/complete/tex/pst-fill.cwl4
-rw-r--r--src/kile/complete/tex/pst-node.cwl281
-rw-r--r--src/kile/complete/tex/pst-plot.cwl36
-rw-r--r--src/kile/complete/tex/pst-text.cwl4
-rw-r--r--src/kile/complete/tex/pst-tree.cwl66
-rw-r--r--src/kile/complete/tex/pstricks.cwl242
-rw-r--r--src/kile/complete/tex/rotating.cwl8
-rw-r--r--src/kile/complete/tex/scraddr.cwl15
-rw-r--r--src/kile/complete/tex/scrdate.cwl4
-rw-r--r--src/kile/complete/tex/scrlfile.cwl10
-rw-r--r--src/kile/complete/tex/scrpage2.cwl68
-rw-r--r--src/kile/complete/tex/scrtime.cwl7
-rw-r--r--src/kile/complete/tex/setspace.cwl12
-rw-r--r--src/kile/complete/tex/subfig.cwl14
-rw-r--r--src/kile/complete/tex/supertabular.cwl23
-rw-r--r--src/kile/complete/tex/svn-multi.cwl41
-rw-r--r--src/kile/complete/tex/svninfo.cwl19
-rw-r--r--src/kile/complete/tex/tabularx.cwl7
-rw-r--r--src/kile/complete/tex/tex.cwl439
-rw-r--r--src/kile/complete/tex/textcomp.cwl129
-rw-r--r--src/kile/complete/tex/url.cwl19
-rw-r--r--src/kile/complete/tex/varioref.cwl30
-rw-r--r--src/kile/complete/tex/verse.cwl45
-rw-r--r--src/kile/complete/tex/virginialake.cwl171
-rw-r--r--src/kile/complete/tex/xifthen.cwl27
-rw-r--r--src/kile/complete/tex/xltxtra.cwl20
-rw-r--r--src/kile/complete/tex/xtab.cwl24
-rw-r--r--src/kile/complete/tex/yfonts.cwl19
-rw-r--r--src/kile/configcheckerdlg.cpp180
-rw-r--r--src/kile/configcheckerdlg.h75
-rw-r--r--src/kile/configcheckerwidget.ui112
-rw-r--r--src/kile/configcheckerwidget.ui.h27
-rw-r--r--src/kile/configcodecompletion.cpp521
-rw-r--r--src/kile/configcodecompletion.h99
-rw-r--r--src/kile/configstructure.cpp353
-rw-r--r--src/kile/configstructure.h98
-rw-r--r--src/kile/configtester.cpp270
-rw-r--r--src/kile/configtester.h98
-rw-r--r--src/kile/convert.cpp326
-rw-r--r--src/kile/convert.h135
-rw-r--r--src/kile/create_hash_table203
-rw-r--r--src/kile/docpart.cpp124
-rw-r--r--src/kile/docpart.h50
-rw-r--r--src/kile/docpartui.rc14
-rw-r--r--src/kile/editorkeysequencemanager.cpp231
-rw-r--r--src/kile/editorkeysequencemanager.h230
-rw-r--r--src/kile/encodings/CMakeLists.txt4
-rw-r--r--src/kile/encodings/Makefile.am3
-rw-r--r--src/kile/encodings/cp1250.enc119
-rw-r--r--src/kile/encodings/cp1252.enc115
-rw-r--r--src/kile/encodings/latin1.enc96
-rw-r--r--src/kile/encodings/latin2.enc96
-rw-r--r--src/kile/encodings/latin3.enc86
-rw-r--r--src/kile/encodings/latin4.enc92
-rw-r--r--src/kile/encodings/latin5.enc92
-rw-r--r--src/kile/encodings/latin9.enc93
-rw-r--r--src/kile/envconfigwidget.ui172
-rw-r--r--src/kile/floatdialog.cpp194
-rw-r--r--src/kile/floatdialog.h58
-rw-r--r--src/kile/generalconfigwidget.ui251
-rw-r--r--src/kile/graphicsconfigwidget.ui134
-rw-r--r--src/kile/help/CMakeLists.txt4
-rw-r--r--src/kile/help/Makefile.am3
-rw-r--r--src/kile/help/latex-kile.lst236
-rw-r--r--src/kile/help/latex-tetex.lst204
-rw-r--r--src/kile/help/latex-tetex3.lst340
-rw-r--r--src/kile/help/latex-texlive-3.9.lst559
-rw-r--r--src/kile/helpconfigwidget.ui178
-rw-r--r--src/kile/helpconfigwidget.ui.h23
-rw-r--r--src/kile/icons/CMakeLists.txt11
-rw-r--r--src/kile/icons/Makefile.am2
-rw-r--r--src/kile/icons/actions/CMakeLists.txt11
-rw-r--r--src/kile/icons/actions/Makefile.am2
-rw-r--r--src/kile/icons/actions/hi16-action-acute.pngbin0 -> 226 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-bar.pngbin0 -> 210 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-beamerblock.pngbin0 -> 393 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-beamerframe.pngbin0 -> 495 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-binom.pngbin0 -> 276 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-breve.pngbin0 -> 236 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-chapter.pngbin0 -> 532 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-check.pngbin0 -> 477 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-closeallenv.pngbin0 -> 479 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-closeenv.pngbin0 -> 476 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-closegroup.pngbin0 -> 512 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-complete1.pngbin0 -> 761 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-complete2.pngbin0 -> 747 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-complete3.pngbin0 -> 764 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-configure_kile.pngbin0 -> 1002 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-configure_project.pngbin0 -> 889 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-ddot.pngbin0 -> 217 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-delenv_i.pngbin0 -> 673 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-delenv_o.pngbin0 -> 674 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-deleol.pngbin0 -> 661 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-delete.pngbin0 -> 209 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-delgroup_i.pngbin0 -> 684 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-delgroup_o.pngbin0 -> 683 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-delline.pngbin0 -> 657 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-delmath.pngbin0 -> 668 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-delpar.pngbin0 -> 659 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-delword.pngbin0 -> 667 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-description.pngbin0 -> 172 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-dot.pngbin0 -> 212 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-enumerate.pngbin0 -> 178 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-eqnarray.pngbin0 -> 306 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-equation.pngbin0 -> 298 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-file.pngbin0 -> 190 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-gotobeginenv.pngbin0 -> 489 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-gotobegingroup.pngbin0 -> 496 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-gotoendenv.pngbin0 -> 481 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-gotoendgroup.pngbin0 -> 512 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-graphics.pngbin0 -> 314 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-grave.pngbin0 -> 226 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-hat.pngbin0 -> 219 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-include.pngbin0 -> 569 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-item.pngbin0 -> 200 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-itemize.pngbin0 -> 157 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-js.pngbin0 -> 585 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-label.pngbin0 -> 811 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-masteritem.pngbin0 -> 327 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-matchenv.pngbin0 -> 501 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-matchgroup.pngbin0 -> 535 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-math0.pngbin0 -> 258 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-math1.pngbin0 -> 118 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-math10.pngbin0 -> 248 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-math2.pngbin0 -> 164 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-math3.pngbin0 -> 154 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-math4.pngbin0 -> 253 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-math5.pngbin0 -> 261 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-math6.pngbin0 -> 264 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-math7.pngbin0 -> 212 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-math8.pngbin0 -> 263 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-math9.pngbin0 -> 225 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-mathmode.pngbin0 -> 178 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-minipage.pngbin0 -> 235 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-nextbullet.pngbin0 -> 232 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-nextparagraph.pngbin0 -> 749 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-nextsection.pngbin0 -> 662 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-nroot.pngbin0 -> 258 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-part.pngbin0 -> 517 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-prevbullet.pngbin0 -> 227 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-prevparagraph.pngbin0 -> 716 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-prevsection.pngbin0 -> 661 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-projectitem.pngbin0 -> 252 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-refreshstructure.pngbin0 -> 754 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-relation.pngbin0 -> 576 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-scriptnew.pngbin0 -> 763 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-scriptopen.pngbin0 -> 850 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-section.pngbin0 -> 569 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-selenv_i.pngbin0 -> 508 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-selenv_o.pngbin0 -> 508 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-selgroup_i.pngbin0 -> 535 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-selgroup_o.pngbin0 -> 535 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-selline.pngbin0 -> 478 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-selmath.pngbin0 -> 511 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-selpar.pngbin0 -> 482 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-selword.pngbin0 -> 476 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-smallfrac.pngbin0 -> 185 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-structure.pngbin0 -> 168 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-subsection.pngbin0 -> 475 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-subsubsection.pngbin0 -> 498 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-tilde.pngbin0 -> 215 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-vec.pngbin0 -> 182 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-verb.pngbin0 -> 177 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-verbatim.pngbin0 -> 298 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-viewdvi.pngbin0 -> 877 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-viewhtml.pngbin0 -> 846 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-viewpdf.pngbin0 -> 746 bytes
-rw-r--r--src/kile/icons/actions/hi16-action-viewps.pngbin0 -> 572 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-array.pngbin0 -> 222 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-bboxnext.pngbin0 -> 561 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-bboxprev.pngbin0 -> 616 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-binom.pngbin0 -> 675 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-cline.pngbin0 -> 318 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-complete1.pngbin0 -> 985 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-complete2.pngbin0 -> 961 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-complete3.pngbin0 -> 974 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-configure_kile.pngbin0 -> 1329 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-configure_project.pngbin0 -> 1060 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-convert.pngbin0 -> 903 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-description.pngbin0 -> 565 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-dfrac.pngbin0 -> 229 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-displaymathmode.pngbin0 -> 202 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-emph.pngbin0 -> 845 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-enumerate.pngbin0 -> 622 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-eqnarray.pngbin0 -> 714 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-equation.pngbin0 -> 682 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-errornext.pngbin0 -> 596 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-errorprev.pngbin0 -> 548 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-filegrep.pngbin0 -> 1137 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-hline.pngbin0 -> 322 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-item.pngbin0 -> 628 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-itemize.pngbin0 -> 573 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-js.pngbin0 -> 790 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-jspage.pngbin0 -> 741 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-label.pngbin0 -> 1204 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-master.pngbin0 -> 407 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-minipage.pngbin0 -> 557 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-multicolumn.pngbin0 -> 292 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-newline.pngbin0 -> 189 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-nroot.pngbin0 -> 305 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-output_win.pngbin0 -> 974 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-preview_env.pngbin0 -> 1089 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-preview_sel.pngbin0 -> 1054 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-preview_subdoc.pngbin0 -> 1128 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-project_add.pngbin0 -> 638 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-project_remove.pngbin0 -> 626 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-project_show.pngbin0 -> 1000 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-projectgrep.pngbin0 -> 573 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-quick.pngbin0 -> 1033 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-quickwizard.pngbin0 -> 735 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-refreshstructure.pngbin0 -> 956 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-scriptnew.pngbin0 -> 1016 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-scriptopen.pngbin0 -> 1347 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-slanted.pngbin0 -> 966 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-strong.pngbin0 -> 999 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-tabbing.pngbin0 -> 307 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-tabular.pngbin0 -> 227 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-typewriter.pngbin0 -> 908 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-verb.pngbin0 -> 871 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-verbatim.pngbin0 -> 770 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-viewdvi.pngbin0 -> 1448 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-viewhtml.pngbin0 -> 1335 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-viewlog.pngbin0 -> 967 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-viewpdf.pngbin0 -> 1130 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-viewps.pngbin0 -> 867 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-vline.pngbin0 -> 319 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-warnnext.pngbin0 -> 655 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-warnprev.pngbin0 -> 567 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-watchfile.pngbin0 -> 792 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-wizard_array.pngbin0 -> 478 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-wizard_float.pngbin0 -> 359 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-wizard_math.pngbin0 -> 671 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-wizard_pstools.pngbin0 -> 1106 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-wizard_tabbing.pngbin0 -> 336 bytes
-rw-r--r--src/kile/icons/actions/hi22-action-wizard_tabular.pngbin0 -> 485 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-bibtex.pngbin0 -> 2540 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-dblatex.pngbin0 -> 1150 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-dvipdf.pngbin0 -> 1311 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-dvipng.pngbin0 -> 1531 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-dvips.pngbin0 -> 1286 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-dvisearch.pngbin0 -> 1471 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-environment.pngbin0 -> 1868 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-js.pngbin0 -> 1323 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-l2h.pngbin0 -> 1288 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-latex.pngbin0 -> 2347 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-lilypond.pngbin0 -> 2185 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-makeidx.pngbin0 -> 2055 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-mpost.pngbin0 -> 2326 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-pdflatex.pngbin0 -> 2225 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-pdftex.pngbin0 -> 2271 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-ps2pdf.pngbin0 -> 1112 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-scriptnew.pngbin0 -> 1708 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-scriptopen.pngbin0 -> 2231 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-texcompiler.pngbin0 -> 2412 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-viewbib.pngbin0 -> 504 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-viewdvi.pngbin0 -> 2860 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-viewhtml.pngbin0 -> 2443 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-viewpdf.pngbin0 -> 1942 bytes
-rw-r--r--src/kile/icons/actions/hi32-action-viewps.pngbin0 -> 1702 bytes
-rw-r--r--src/kile/icons/actions/hi48-action-graphicspage.pngbin0 -> 2781 bytes
-rw-r--r--src/kile/icons/actions/hi64-action-preview.pngbin0 -> 4265 bytes
-rw-r--r--src/kile/icons/hi128-app-kile.pngbin0 -> 10731 bytes
-rw-r--r--src/kile/icons/hi16-app-kile.pngbin0 -> 826 bytes
-rw-r--r--src/kile/icons/hi22-app-kile.pngbin0 -> 1165 bytes
-rw-r--r--src/kile/icons/hi32-app-kile.pngbin0 -> 1959 bytes
-rw-r--r--src/kile/icons/hi48-app-kile.pngbin0 -> 3210 bytes
-rw-r--r--src/kile/icons/hi64-app-kile.pngbin0 -> 4397 bytes
-rw-r--r--src/kile/icons/hisc-app-kile.svgzbin0 -> 2329 bytes
-rw-r--r--src/kile/includegraphicsdialog.cpp531
-rw-r--r--src/kile/includegraphicsdialog.h93
-rw-r--r--src/kile/internal-testing/env-grabbing-testing.tex60
-rw-r--r--src/kile/internal-testing/find-verbatim.tex51
-rw-r--r--src/kile/internal-testing/hello.tex18
-rw-r--r--src/kile/internal-testing/helloo.tex18
-rw-r--r--src/kile/internal-testing/internaltesting.kilepr112
-rw-r--r--src/kile/internal-testing/preview.tex52
-rw-r--r--src/kile/internal-testing/syntax-cite.tex48
-rw-r--r--src/kile/internal-testing/syntax-cmds.tex32
-rw-r--r--src/kile/internal-testing/syntax-comment-updateStruct.tex345
-rw-r--r--src/kile/internal-testing/syntax-generic.tex238
-rw-r--r--src/kile/internal-testing/syntax-math1.tex82
-rw-r--r--src/kile/internal-testing/syntax-math2.tex53
-rw-r--r--src/kile/internal-testing/syntax-noweb.tex67
-rw-r--r--src/kile/internal-testing/syntax-tabular.tex30
-rw-r--r--src/kile/internal-testing/teppich.eps281
-rw-r--r--src/kile/kile.cpp2337
-rw-r--r--src/kile/kile.desktop82
-rw-r--r--src/kile/kile.h337
-rw-r--r--src/kile/kile.kcfg515
-rw-r--r--src/kile/kileabbrevview.cpp319
-rw-r--r--src/kile/kileabbrevview.h95
-rw-r--r--src/kile/kileactions.cpp394
-rw-r--r--src/kile/kileactions.h197
-rw-r--r--src/kile/kileappIface.h36
-rw-r--r--src/kile/kileapplication.cpp54
-rw-r--r--src/kile/kileapplication.h33
-rw-r--r--src/kile/kileconfig.kcfgc4
-rw-r--r--src/kile/kileconfigdialog.cpp357
-rw-r--r--src/kile/kileconfigdialog.h124
-rw-r--r--src/kile/kileconstants.h23
-rw-r--r--src/kile/kiledebug.h21
-rw-r--r--src/kile/kiledocmanager.cpp2040
-rw-r--r--src/kile/kiledocmanager.h245
-rw-r--r--src/kile/kiledocumentinfo.cpp1325
-rw-r--r--src/kile/kiledocumentinfo.h389
-rw-r--r--src/kile/kileedit.cpp2728
-rw-r--r--src/kile/kileedit.h260
-rw-r--r--src/kile/kileerrorhandler.cpp213
-rw-r--r--src/kile/kileerrorhandler.h60
-rw-r--r--src/kile/kileeventfilter.cpp71
-rw-r--r--src/kile/kileeventfilter.h46
-rw-r--r--src/kile/kileextensions.cpp167
-rw-r--r--src/kile/kileextensions.h92
-rw-r--r--src/kile/kilefileselect.cpp169
-rw-r--r--src/kile/kilefileselect.h77
-rw-r--r--src/kile/kilegrepdialog.cpp886
-rw-r--r--src/kile/kilegrepdialog.h136
-rw-r--r--src/kile/kilehelp.cpp362
-rw-r--r--src/kile/kilehelp.h109
-rw-r--r--src/kile/kileinfo.cpp468
-rw-r--r--src/kile/kileinfo.h180
-rw-r--r--src/kile/kilejscript.cpp795
-rw-r--r--src/kile/kilejscript.h284
-rw-r--r--src/kile/kilekonsolewidget.cpp124
-rw-r--r--src/kile/kilekonsolewidget.h59
-rw-r--r--src/kile/kilelauncher.cpp369
-rw-r--r--src/kile/kilelauncher.h154
-rw-r--r--src/kile/kilelistselector.cpp114
-rw-r--r--src/kile/kilelistselector.h59
-rw-r--r--src/kile/kilelogwidget.cpp200
-rw-r--r--src/kile/kilelogwidget.h66
-rw-r--r--src/kile/kilelyxserver.cpp234
-rw-r--r--src/kile/kilelyxserver.h77
-rw-r--r--src/kile/kilemultitabbar.cpp1019
-rw-r--r--src/kile/kilemultitabbar.h316
-rw-r--r--src/kile/kilemultitabbar_p.h69
-rw-r--r--src/kile/kileoutputwidget.cpp50
-rw-r--r--src/kile/kileoutputwidget.h37
-rw-r--r--src/kile/kileproject.cpp813
-rw-r--r--src/kile/kileproject.h235
-rw-r--r--src/kile/kileprojectdlgs.cpp609
-rw-r--r--src/kile/kileprojectdlgs.h138
-rw-r--r--src/kile/kileprojectview.cpp691
-rw-r--r--src/kile/kileprojectview.h163
-rw-r--r--src/kile/kilesidebar.cpp272
-rw-r--r--src/kile/kilesidebar.h99
-rw-r--r--src/kile/kilestatsdlg.cpp207
-rw-r--r--src/kile/kilestatsdlg.h52
-rw-r--r--src/kile/kilestatswidget.cpp133
-rw-r--r--src/kile/kilestatswidget.h66
-rw-r--r--src/kile/kilestdactions.cpp374
-rw-r--r--src/kile/kilestdactions.h31
-rw-r--r--src/kile/kilestdtools.cpp414
-rw-r--r--src/kile/kilestdtools.h129
-rw-r--r--src/kile/kilestdtools.rc686
-rw-r--r--src/kile/kilestructurewidget.cpp1014
-rw-r--r--src/kile/kilestructurewidget.h244
-rw-r--r--src/kile/kiletool.cpp677
-rw-r--r--src/kile/kiletool.h323
-rw-r--r--src/kile/kiletool_enums.h36
-rw-r--r--src/kile/kiletoolconfigwidget.cpp536
-rw-r--r--src/kile/kiletoolconfigwidget.h112
-rw-r--r--src/kile/kiletoolmanager.cpp511
-rw-r--r--src/kile/kiletoolmanager.h159
-rw-r--r--src/kile/kileui.rc854
-rw-r--r--src/kile/kileuntitled.cpp37
-rw-r--r--src/kile/kileuntitled.h31
-rw-r--r--src/kile/kileversion.cpp43
-rw-r--r--src/kile/kileversion.h33
-rw-r--r--src/kile/kileviewmanager.cpp584
-rw-r--r--src/kile/kileviewmanager.h149
-rw-r--r--src/kile/kilewizard.cpp29
-rw-r--r--src/kile/kilewizard.h42
-rw-r--r--src/kile/latexcmd.cpp442
-rw-r--r--src/kile/latexcmd.h119
-rw-r--r--src/kile/latexcmddialog.cpp911
-rw-r--r--src/kile/latexcmddialog.h126
-rw-r--r--src/kile/latexconfigwidget.ui258
-rw-r--r--src/kile/latexconfigwidget.ui.h46
-rw-r--r--src/kile/latexoutputfilter.cpp659
-rw-r--r--src/kile/latexoutputfilter.h139
-rw-r--r--src/kile/latexoutputinfo.cpp43
-rw-r--r--src/kile/latexoutputinfo.h52
-rw-r--r--src/kile/latextoolconfigwidget.ui57
-rw-r--r--src/kile/librarytoolconfigwidget.ui104
-rw-r--r--src/kile/main.cpp157
-rw-r--r--src/kile/managetemplatesdialog.cpp283
-rw-r--r--src/kile/managetemplatesdialog.h77
-rw-r--r--src/kile/mathenvdialog.cpp373
-rw-r--r--src/kile/mathenvdialog.h82
-rw-r--r--src/kile/newdocumentwidget.ui126
-rw-r--r--src/kile/newfilewizard.cpp169
-rw-r--r--src/kile/newfilewizard.h62
-rw-r--r--src/kile/newtoolwizard.ui189
-rw-r--r--src/kile/newtoolwizard.ui.h74
-rw-r--r--src/kile/outputfilter.cpp94
-rw-r--r--src/kile/outputfilter.h72
-rw-r--r--src/kile/outputinfo.cpp42
-rw-r--r--src/kile/outputinfo.h78
-rw-r--r--src/kile/pics/CMakeLists.txt4
-rw-r--r--src/kile/pics/Makefile.am2
-rw-r--r--src/kile/pics/kile_splash.pngbin0 -> 9811 bytes
-rw-r--r--src/kile/pics/type_Article.tex.kileiconbin0 -> 1326 bytes
-rw-r--r--src/kile/pics/type_Beamer.tex.kileiconbin0 -> 1803 bytes
-rw-r--r--src/kile/pics/type_Book.tex.kileiconbin0 -> 2654 bytes
-rw-r--r--src/kile/pics/type_Default.pngbin0 -> 1326 bytes
-rw-r--r--src/kile/pics/type_Empty.pngbin0 -> 1109 bytes
-rw-r--r--src/kile/pics/type_HA-prosper.tex.kileiconbin0 -> 2059 bytes
-rw-r--r--src/kile/pics/type_Letter.tex.kileiconbin0 -> 1101 bytes
-rw-r--r--src/kile/pics/type_Project.pngbin0 -> 1700 bytes
-rw-r--r--src/kile/pics/type_Prosper.tex.kileiconbin0 -> 2181 bytes
-rw-r--r--src/kile/pics/type_Report.tex.kileiconbin0 -> 1622 bytes
-rw-r--r--src/kile/pics/type_Scrartcl.tex.kileiconbin0 -> 1723 bytes
-rw-r--r--src/kile/pics/type_Scrbook.tex.kileiconbin0 -> 2881 bytes
-rw-r--r--src/kile/pics/type_Scrlttr2.tex.kileiconbin0 -> 1564 bytes
-rw-r--r--src/kile/pics/type_Scrreprt.tex.kileiconbin0 -> 1969 bytes
-rw-r--r--src/kile/plaintolatexconverter.cpp65
-rw-r--r--src/kile/plaintolatexconverter.h41
-rw-r--r--src/kile/postscriptdialog.cpp562
-rw-r--r--src/kile/postscriptdialog.h105
-rw-r--r--src/kile/previewconfigwidget.cpp326
-rw-r--r--src/kile/previewconfigwidget.h67
-rw-r--r--src/kile/previewwidget.cpp179
-rw-r--r--src/kile/previewwidget.h102
-rw-r--r--src/kile/processtoolconfigwidget.ui98
-rw-r--r--src/kile/quickdocumentdialog.cpp2330
-rw-r--r--src/kile/quickdocumentdialog.h224
-rw-r--r--src/kile/quickpreview.cpp426
-rw-r--r--src/kile/quickpreview.h98
-rw-r--r--src/kile/quicktoolconfigwidget.ui218
-rw-r--r--src/kile/quicktoolconfigwidget.ui.h98
-rw-r--r--src/kile/scriptingconfigwidget.ui219
-rw-r--r--src/kile/scriptsmanagementwidget.cpp171
-rw-r--r--src/kile/scriptsmanagementwidget.h101
-rw-r--r--src/kile/structureconfigwidget.ui345
-rw-r--r--src/kile/symbols/CMakeLists.txt48
-rw-r--r--src/kile/symbols/Makefile.am7
-rw-r--r--src/kile/symbols/arrows.tex129
-rw-r--r--src/kile/symbols/arrows/CMakeLists.txt77
-rw-r--r--src/kile/symbols/arrows/Makefile.am71
-rw-r--r--src/kile/symbols/arrows/img001arrows.pngbin0 -> 228 bytes
-rw-r--r--src/kile/symbols/arrows/img002arrows.pngbin0 -> 261 bytes
-rw-r--r--src/kile/symbols/arrows/img003arrows.pngbin0 -> 222 bytes
-rw-r--r--src/kile/symbols/arrows/img004arrows.pngbin0 -> 252 bytes
-rw-r--r--src/kile/symbols/arrows/img005arrows.pngbin0 -> 243 bytes
-rw-r--r--src/kile/symbols/arrows/img006arrows.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/arrows/img007arrows.pngbin0 -> 237 bytes
-rw-r--r--src/kile/symbols/arrows/img008arrows.pngbin0 -> 267 bytes
-rw-r--r--src/kile/symbols/arrows/img009arrows.pngbin0 -> 219 bytes
-rw-r--r--src/kile/symbols/arrows/img010arrows.pngbin0 -> 259 bytes
-rw-r--r--src/kile/symbols/arrows/img011arrows.pngbin0 -> 222 bytes
-rw-r--r--src/kile/symbols/arrows/img012arrows.pngbin0 -> 236 bytes
-rw-r--r--src/kile/symbols/arrows/img013arrows.pngbin0 -> 245 bytes
-rw-r--r--src/kile/symbols/arrows/img014arrows.pngbin0 -> 234 bytes
-rw-r--r--src/kile/symbols/arrows/img015arrows.pngbin0 -> 254 bytes
-rw-r--r--src/kile/symbols/arrows/img016arrows.pngbin0 -> 269 bytes
-rw-r--r--src/kile/symbols/arrows/img017arrows.pngbin0 -> 249 bytes
-rw-r--r--src/kile/symbols/arrows/img018arrows.pngbin0 -> 237 bytes
-rw-r--r--src/kile/symbols/arrows/img019arrows.pngbin0 -> 233 bytes
-rw-r--r--src/kile/symbols/arrows/img020arrows.pngbin0 -> 267 bytes
-rw-r--r--src/kile/symbols/arrows/img021arrows.pngbin0 -> 290 bytes
-rw-r--r--src/kile/symbols/arrows/img022arrows.pngbin0 -> 271 bytes
-rw-r--r--src/kile/symbols/arrows/img023arrows.pngbin0 -> 257 bytes
-rw-r--r--src/kile/symbols/arrows/img024arrows.pngbin0 -> 251 bytes
-rw-r--r--src/kile/symbols/arrows/img025arrows.pngbin0 -> 248 bytes
-rw-r--r--src/kile/symbols/arrows/img026arrows.pngbin0 -> 259 bytes
-rw-r--r--src/kile/symbols/arrows/img027arrows.pngbin0 -> 244 bytes
-rw-r--r--src/kile/symbols/arrows/img028arrows.pngbin0 -> 256 bytes
-rw-r--r--src/kile/symbols/arrows/img029arrows.pngbin0 -> 245 bytes
-rw-r--r--src/kile/symbols/arrows/img030arrows.pngbin0 -> 296 bytes
-rw-r--r--src/kile/symbols/arrows/img031arrows.pngbin0 -> 259 bytes
-rw-r--r--src/kile/symbols/arrows/img032arrows.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/arrows/img033arrows.pngbin0 -> 323 bytes
-rw-r--r--src/kile/symbols/arrows/img034arrows.pngbin0 -> 280 bytes
-rw-r--r--src/kile/symbols/arrows/img035arrows.pngbin0 -> 288 bytes
-rw-r--r--src/kile/symbols/arrows/img036arrows.pngbin0 -> 254 bytes
-rw-r--r--src/kile/symbols/arrows/img037arrows.pngbin0 -> 265 bytes
-rw-r--r--src/kile/symbols/arrows/img038arrows.pngbin0 -> 302 bytes
-rw-r--r--src/kile/symbols/arrows/img039arrows.pngbin0 -> 327 bytes
-rw-r--r--src/kile/symbols/arrows/img040arrows.pngbin0 -> 301 bytes
-rw-r--r--src/kile/symbols/arrows/img041arrows.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/arrows/img042arrows.pngbin0 -> 262 bytes
-rw-r--r--src/kile/symbols/arrows/img043arrows.pngbin0 -> 262 bytes
-rw-r--r--src/kile/symbols/arrows/img044arrows.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/arrows/img045arrows.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/arrows/img046arrows.pngbin0 -> 260 bytes
-rw-r--r--src/kile/symbols/arrows/img047arrows.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/arrows/img048arrows.pngbin0 -> 295 bytes
-rw-r--r--src/kile/symbols/arrows/img049arrows.pngbin0 -> 292 bytes
-rw-r--r--src/kile/symbols/arrows/img050arrows.pngbin0 -> 287 bytes
-rw-r--r--src/kile/symbols/arrows/img051arrows.pngbin0 -> 224 bytes
-rw-r--r--src/kile/symbols/arrows/img052arrows.pngbin0 -> 225 bytes
-rw-r--r--src/kile/symbols/arrows/img053arrows.pngbin0 -> 298 bytes
-rw-r--r--src/kile/symbols/arrows/img054arrows.pngbin0 -> 282 bytes
-rw-r--r--src/kile/symbols/arrows/img055arrows.pngbin0 -> 269 bytes
-rw-r--r--src/kile/symbols/arrows/img056arrows.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/arrows/img057arrows.pngbin0 -> 310 bytes
-rw-r--r--src/kile/symbols/arrows/img058arrows.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/arrows/img059arrows.pngbin0 -> 241 bytes
-rw-r--r--src/kile/symbols/arrows/img060arrows.pngbin0 -> 224 bytes
-rw-r--r--src/kile/symbols/arrows/img061arrows.pngbin0 -> 207 bytes
-rw-r--r--src/kile/symbols/arrows/img062arrows.pngbin0 -> 217 bytes
-rw-r--r--src/kile/symbols/arrows/img063arrows.pngbin0 -> 216 bytes
-rw-r--r--src/kile/symbols/arrows/img064arrows.pngbin0 -> 250 bytes
-rw-r--r--src/kile/symbols/arrows/img065arrows.pngbin0 -> 254 bytes
-rw-r--r--src/kile/symbols/arrows/img066arrows.pngbin0 -> 221 bytes
-rw-r--r--src/kile/symbols/arrows/img067arrows.pngbin0 -> 220 bytes
-rw-r--r--src/kile/symbols/arrows/img068arrows.pngbin0 -> 218 bytes
-rw-r--r--src/kile/symbols/arrows/img069arrows.pngbin0 -> 223 bytes
-rwxr-xr-xsrc/kile/symbols/compile-all.sh12
-rw-r--r--src/kile/symbols/cyrillic.tex320
-rw-r--r--src/kile/symbols/cyrillic/CMakeLists.txt164
-rw-r--r--src/kile/symbols/cyrillic/Makefile.am159
-rw-r--r--src/kile/symbols/cyrillic/img001cyrillic.pngbin0 -> 366 bytes
-rw-r--r--src/kile/symbols/cyrillic/img002cyrillic.pngbin0 -> 343 bytes
-rw-r--r--src/kile/symbols/cyrillic/img003cyrillic.pngbin0 -> 349 bytes
-rw-r--r--src/kile/symbols/cyrillic/img004cyrillic.pngbin0 -> 307 bytes
-rw-r--r--src/kile/symbols/cyrillic/img005cyrillic.pngbin0 -> 353 bytes
-rw-r--r--src/kile/symbols/cyrillic/img006cyrillic.pngbin0 -> 350 bytes
-rw-r--r--src/kile/symbols/cyrillic/img007cyrillic.pngbin0 -> 367 bytes
-rw-r--r--src/kile/symbols/cyrillic/img008cyrillic.pngbin0 -> 398 bytes
-rw-r--r--src/kile/symbols/cyrillic/img009cyrillic.pngbin0 -> 369 bytes
-rw-r--r--src/kile/symbols/cyrillic/img010cyrillic.pngbin0 -> 341 bytes
-rw-r--r--src/kile/symbols/cyrillic/img011cyrillic.pngbin0 -> 377 bytes
-rw-r--r--src/kile/symbols/cyrillic/img012cyrillic.pngbin0 -> 346 bytes
-rw-r--r--src/kile/symbols/cyrillic/img013cyrillic.pngbin0 -> 331 bytes
-rw-r--r--src/kile/symbols/cyrillic/img014cyrillic.pngbin0 -> 384 bytes
-rw-r--r--src/kile/symbols/cyrillic/img015cyrillic.pngbin0 -> 302 bytes
-rw-r--r--src/kile/symbols/cyrillic/img016cyrillic.pngbin0 -> 385 bytes
-rw-r--r--src/kile/symbols/cyrillic/img017cyrillic.pngbin0 -> 279 bytes
-rw-r--r--src/kile/symbols/cyrillic/img018cyrillic.pngbin0 -> 310 bytes
-rw-r--r--src/kile/symbols/cyrillic/img019cyrillic.pngbin0 -> 379 bytes
-rw-r--r--src/kile/symbols/cyrillic/img020cyrillic.pngbin0 -> 297 bytes
-rw-r--r--src/kile/symbols/cyrillic/img021cyrillic.pngbin0 -> 381 bytes
-rw-r--r--src/kile/symbols/cyrillic/img022cyrillic.pngbin0 -> 382 bytes
-rw-r--r--src/kile/symbols/cyrillic/img023cyrillic.pngbin0 -> 372 bytes
-rw-r--r--src/kile/symbols/cyrillic/img024cyrillic.pngbin0 -> 316 bytes
-rw-r--r--src/kile/symbols/cyrillic/img025cyrillic.pngbin0 -> 315 bytes
-rw-r--r--src/kile/symbols/cyrillic/img026cyrillic.pngbin0 -> 290 bytes
-rw-r--r--src/kile/symbols/cyrillic/img027cyrillic.pngbin0 -> 323 bytes
-rw-r--r--src/kile/symbols/cyrillic/img028cyrillic.pngbin0 -> 349 bytes
-rw-r--r--src/kile/symbols/cyrillic/img029cyrillic.pngbin0 -> 346 bytes
-rw-r--r--src/kile/symbols/cyrillic/img030cyrillic.pngbin0 -> 335 bytes
-rw-r--r--src/kile/symbols/cyrillic/img031cyrillic.pngbin0 -> 388 bytes
-rw-r--r--src/kile/symbols/cyrillic/img032cyrillic.pngbin0 -> 411 bytes
-rw-r--r--src/kile/symbols/cyrillic/img033cyrillic.pngbin0 -> 367 bytes
-rw-r--r--src/kile/symbols/cyrillic/img034cyrillic.pngbin0 -> 343 bytes
-rw-r--r--src/kile/symbols/cyrillic/img035cyrillic.pngbin0 -> 364 bytes
-rw-r--r--src/kile/symbols/cyrillic/img036cyrillic.pngbin0 -> 318 bytes
-rw-r--r--src/kile/symbols/cyrillic/img037cyrillic.pngbin0 -> 265 bytes
-rw-r--r--src/kile/symbols/cyrillic/img038cyrillic.pngbin0 -> 315 bytes
-rw-r--r--src/kile/symbols/cyrillic/img039cyrillic.pngbin0 -> 338 bytes
-rw-r--r--src/kile/symbols/cyrillic/img040cyrillic.pngbin0 -> 355 bytes
-rw-r--r--src/kile/symbols/cyrillic/img041cyrillic.pngbin0 -> 360 bytes
-rw-r--r--src/kile/symbols/cyrillic/img042cyrillic.pngbin0 -> 332 bytes
-rw-r--r--src/kile/symbols/cyrillic/img043cyrillic.pngbin0 -> 304 bytes
-rw-r--r--src/kile/symbols/cyrillic/img044cyrillic.pngbin0 -> 340 bytes
-rw-r--r--src/kile/symbols/cyrillic/img045cyrillic.pngbin0 -> 325 bytes
-rw-r--r--src/kile/symbols/cyrillic/img046cyrillic.pngbin0 -> 309 bytes
-rw-r--r--src/kile/symbols/cyrillic/img047cyrillic.pngbin0 -> 339 bytes
-rw-r--r--src/kile/symbols/cyrillic/img048cyrillic.pngbin0 -> 261 bytes
-rw-r--r--src/kile/symbols/cyrillic/img049cyrillic.pngbin0 -> 340 bytes
-rw-r--r--src/kile/symbols/cyrillic/img050cyrillic.pngbin0 -> 254 bytes
-rw-r--r--src/kile/symbols/cyrillic/img051cyrillic.pngbin0 -> 339 bytes
-rw-r--r--src/kile/symbols/cyrillic/img052cyrillic.pngbin0 -> 331 bytes
-rw-r--r--src/kile/symbols/cyrillic/img053cyrillic.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/cyrillic/img054cyrillic.pngbin0 -> 350 bytes
-rw-r--r--src/kile/symbols/cyrillic/img055cyrillic.pngbin0 -> 348 bytes
-rw-r--r--src/kile/symbols/cyrillic/img056cyrillic.pngbin0 -> 335 bytes
-rw-r--r--src/kile/symbols/cyrillic/img057cyrillic.pngbin0 -> 278 bytes
-rw-r--r--src/kile/symbols/cyrillic/img058cyrillic.pngbin0 -> 282 bytes
-rw-r--r--src/kile/symbols/cyrillic/img059cyrillic.pngbin0 -> 284 bytes
-rw-r--r--src/kile/symbols/cyrillic/img060cyrillic.pngbin0 -> 313 bytes
-rw-r--r--src/kile/symbols/cyrillic/img061cyrillic.pngbin0 -> 320 bytes
-rw-r--r--src/kile/symbols/cyrillic/img062cyrillic.pngbin0 -> 328 bytes
-rw-r--r--src/kile/symbols/cyrillic/img063cyrillic.pngbin0 -> 317 bytes
-rw-r--r--src/kile/symbols/cyrillic/img064cyrillic.pngbin0 -> 336 bytes
-rw-r--r--src/kile/symbols/cyrillic/img065cyrillic.pngbin0 -> 346 bytes
-rw-r--r--src/kile/symbols/cyrillic/img066cyrillic.pngbin0 -> 331 bytes
-rw-r--r--src/kile/symbols/cyrillic/img067cyrillic.pngbin0 -> 393 bytes
-rw-r--r--src/kile/symbols/cyrillic/img068cyrillic.pngbin0 -> 412 bytes
-rw-r--r--src/kile/symbols/cyrillic/img069cyrillic.pngbin0 -> 428 bytes
-rw-r--r--src/kile/symbols/cyrillic/img070cyrillic.pngbin0 -> 361 bytes
-rw-r--r--src/kile/symbols/cyrillic/img071cyrillic.pngbin0 -> 390 bytes
-rw-r--r--src/kile/symbols/cyrillic/img072cyrillic.pngbin0 -> 373 bytes
-rw-r--r--src/kile/symbols/cyrillic/img073cyrillic.pngbin0 -> 356 bytes
-rw-r--r--src/kile/symbols/cyrillic/img074cyrillic.pngbin0 -> 370 bytes
-rw-r--r--src/kile/symbols/cyrillic/img075cyrillic.pngbin0 -> 377 bytes
-rw-r--r--src/kile/symbols/cyrillic/img076cyrillic.pngbin0 -> 383 bytes
-rw-r--r--src/kile/symbols/cyrillic/img077cyrillic.pngbin0 -> 338 bytes
-rw-r--r--src/kile/symbols/cyrillic/img078cyrillic.pngbin0 -> 404 bytes
-rw-r--r--src/kile/symbols/cyrillic/img079cyrillic.pngbin0 -> 330 bytes
-rw-r--r--src/kile/symbols/cyrillic/img080cyrillic.pngbin0 -> 344 bytes
-rw-r--r--src/kile/symbols/cyrillic/img081cyrillic.pngbin0 -> 364 bytes
-rw-r--r--src/kile/symbols/cyrillic/img082cyrillic.pngbin0 -> 321 bytes
-rw-r--r--src/kile/symbols/cyrillic/img083cyrillic.pngbin0 -> 404 bytes
-rw-r--r--src/kile/symbols/cyrillic/img084cyrillic.pngbin0 -> 379 bytes
-rw-r--r--src/kile/symbols/cyrillic/img085cyrillic.pngbin0 -> 334 bytes
-rw-r--r--src/kile/symbols/cyrillic/img086cyrillic.pngbin0 -> 402 bytes
-rw-r--r--src/kile/symbols/cyrillic/img087cyrillic.pngbin0 -> 329 bytes
-rw-r--r--src/kile/symbols/cyrillic/img088cyrillic.pngbin0 -> 355 bytes
-rw-r--r--src/kile/symbols/cyrillic/img089cyrillic.pngbin0 -> 375 bytes
-rw-r--r--src/kile/symbols/cyrillic/img090cyrillic.pngbin0 -> 408 bytes
-rw-r--r--src/kile/symbols/cyrillic/img091cyrillic.pngbin0 -> 332 bytes
-rw-r--r--src/kile/symbols/cyrillic/img092cyrillic.pngbin0 -> 378 bytes
-rw-r--r--src/kile/symbols/cyrillic/img093cyrillic.pngbin0 -> 290 bytes
-rw-r--r--src/kile/symbols/cyrillic/img094cyrillic.pngbin0 -> 338 bytes
-rw-r--r--src/kile/symbols/cyrillic/img095cyrillic.pngbin0 -> 387 bytes
-rw-r--r--src/kile/symbols/cyrillic/img096cyrillic.pngbin0 -> 320 bytes
-rw-r--r--src/kile/symbols/cyrillic/img097cyrillic.pngbin0 -> 373 bytes
-rw-r--r--src/kile/symbols/cyrillic/img098cyrillic.pngbin0 -> 347 bytes
-rw-r--r--src/kile/symbols/cyrillic/img099cyrillic.pngbin0 -> 325 bytes
-rw-r--r--src/kile/symbols/cyrillic/img100cyrillic.pngbin0 -> 336 bytes
-rw-r--r--src/kile/symbols/cyrillic/img101cyrillic.pngbin0 -> 335 bytes
-rw-r--r--src/kile/symbols/cyrillic/img102cyrillic.pngbin0 -> 346 bytes
-rw-r--r--src/kile/symbols/cyrillic/img103cyrillic.pngbin0 -> 389 bytes
-rw-r--r--src/kile/symbols/cyrillic/img104cyrillic.pngbin0 -> 385 bytes
-rw-r--r--src/kile/symbols/cyrillic/img105cyrillic.pngbin0 -> 245 bytes
-rw-r--r--src/kile/symbols/cyrillic/img106cyrillic.pngbin0 -> 304 bytes
-rw-r--r--src/kile/symbols/cyrillic/img107cyrillic.pngbin0 -> 289 bytes
-rw-r--r--src/kile/symbols/cyrillic/img108cyrillic.pngbin0 -> 357 bytes
-rw-r--r--src/kile/symbols/cyrillic/img109cyrillic.pngbin0 -> 370 bytes
-rw-r--r--src/kile/symbols/cyrillic/img110cyrillic.pngbin0 -> 385 bytes
-rw-r--r--src/kile/symbols/cyrillic/img111cyrillic.pngbin0 -> 406 bytes
-rw-r--r--src/kile/symbols/cyrillic/img112cyrillic.pngbin0 -> 251 bytes
-rw-r--r--src/kile/symbols/cyrillic/img113cyrillic.pngbin0 -> 342 bytes
-rw-r--r--src/kile/symbols/cyrillic/img114cyrillic.pngbin0 -> 359 bytes
-rw-r--r--src/kile/symbols/cyrillic/img115cyrillic.pngbin0 -> 382 bytes
-rw-r--r--src/kile/symbols/cyrillic/img116cyrillic.pngbin0 -> 326 bytes
-rw-r--r--src/kile/symbols/cyrillic/img117cyrillic.pngbin0 -> 355 bytes
-rw-r--r--src/kile/symbols/cyrillic/img118cyrillic.pngbin0 -> 342 bytes
-rw-r--r--src/kile/symbols/cyrillic/img119cyrillic.pngbin0 -> 344 bytes
-rw-r--r--src/kile/symbols/cyrillic/img120cyrillic.pngbin0 -> 336 bytes
-rw-r--r--src/kile/symbols/cyrillic/img121cyrillic.pngbin0 -> 335 bytes
-rw-r--r--src/kile/symbols/cyrillic/img122cyrillic.pngbin0 -> 347 bytes
-rw-r--r--src/kile/symbols/cyrillic/img123cyrillic.pngbin0 -> 312 bytes
-rw-r--r--src/kile/symbols/cyrillic/img124cyrillic.pngbin0 -> 357 bytes
-rw-r--r--src/kile/symbols/cyrillic/img125cyrillic.pngbin0 -> 289 bytes
-rw-r--r--src/kile/symbols/cyrillic/img126cyrillic.pngbin0 -> 299 bytes
-rw-r--r--src/kile/symbols/cyrillic/img127cyrillic.pngbin0 -> 312 bytes
-rw-r--r--src/kile/symbols/cyrillic/img128cyrillic.pngbin0 -> 308 bytes
-rw-r--r--src/kile/symbols/cyrillic/img129cyrillic.pngbin0 -> 348 bytes
-rw-r--r--src/kile/symbols/cyrillic/img130cyrillic.pngbin0 -> 353 bytes
-rw-r--r--src/kile/symbols/cyrillic/img131cyrillic.pngbin0 -> 348 bytes
-rw-r--r--src/kile/symbols/cyrillic/img132cyrillic.pngbin0 -> 358 bytes
-rw-r--r--src/kile/symbols/cyrillic/img133cyrillic.pngbin0 -> 312 bytes
-rw-r--r--src/kile/symbols/cyrillic/img134cyrillic.pngbin0 -> 319 bytes
-rw-r--r--src/kile/symbols/cyrillic/img135cyrillic.pngbin0 -> 354 bytes
-rw-r--r--src/kile/symbols/cyrillic/img136cyrillic.pngbin0 -> 382 bytes
-rw-r--r--src/kile/symbols/cyrillic/img137cyrillic.pngbin0 -> 307 bytes
-rw-r--r--src/kile/symbols/cyrillic/img138cyrillic.pngbin0 -> 349 bytes
-rw-r--r--src/kile/symbols/cyrillic/img139cyrillic.pngbin0 -> 274 bytes
-rw-r--r--src/kile/symbols/cyrillic/img140cyrillic.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/cyrillic/img141cyrillic.pngbin0 -> 352 bytes
-rw-r--r--src/kile/symbols/cyrillic/img142cyrillic.pngbin0 -> 287 bytes
-rw-r--r--src/kile/symbols/cyrillic/img143cyrillic.pngbin0 -> 337 bytes
-rw-r--r--src/kile/symbols/cyrillic/img144cyrillic.pngbin0 -> 319 bytes
-rw-r--r--src/kile/symbols/cyrillic/img145cyrillic.pngbin0 -> 297 bytes
-rw-r--r--src/kile/symbols/cyrillic/img146cyrillic.pngbin0 -> 302 bytes
-rw-r--r--src/kile/symbols/cyrillic/img147cyrillic.pngbin0 -> 306 bytes
-rw-r--r--src/kile/symbols/cyrillic/img148cyrillic.pngbin0 -> 334 bytes
-rw-r--r--src/kile/symbols/cyrillic/img149cyrillic.pngbin0 -> 342 bytes
-rw-r--r--src/kile/symbols/cyrillic/img150cyrillic.pngbin0 -> 329 bytes
-rw-r--r--src/kile/symbols/cyrillic/img151cyrillic.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/cyrillic/img152cyrillic.pngbin0 -> 317 bytes
-rw-r--r--src/kile/symbols/cyrillic/img153cyrillic.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/cyrillic/img154cyrillic.pngbin0 -> 346 bytes
-rw-r--r--src/kile/symbols/cyrillic/img155cyrillic.pngbin0 -> 358 bytes
-rw-r--r--src/kile/symbols/cyrillic/img156cyrillic.pngbin0 -> 374 bytes
-rw-r--r--src/kile/symbols/cyrillic/img157cyrillic.pngbin0 -> 355 bytes
-rw-r--r--src/kile/symbols/definitions.tex24
-rw-r--r--src/kile/symbols/delimiters.tex60
-rw-r--r--src/kile/symbols/delimiters/CMakeLists.txt44
-rw-r--r--src/kile/symbols/delimiters/Makefile.am39
-rw-r--r--src/kile/symbols/delimiters/img001delimiters.pngbin0 -> 219 bytes
-rw-r--r--src/kile/symbols/delimiters/img002delimiters.pngbin0 -> 265 bytes
-rw-r--r--src/kile/symbols/delimiters/img003delimiters.pngbin0 -> 165 bytes
-rw-r--r--src/kile/symbols/delimiters/img004delimiters.pngbin0 -> 162 bytes
-rw-r--r--src/kile/symbols/delimiters/img005delimiters.pngbin0 -> 261 bytes
-rw-r--r--src/kile/symbols/delimiters/img006delimiters.pngbin0 -> 255 bytes
-rw-r--r--src/kile/symbols/delimiters/img007delimiters.pngbin0 -> 165 bytes
-rw-r--r--src/kile/symbols/delimiters/img008delimiters.pngbin0 -> 185 bytes
-rw-r--r--src/kile/symbols/delimiters/img009delimiters.pngbin0 -> 191 bytes
-rw-r--r--src/kile/symbols/delimiters/img010delimiters.pngbin0 -> 182 bytes
-rw-r--r--src/kile/symbols/delimiters/img011delimiters.pngbin0 -> 222 bytes
-rw-r--r--src/kile/symbols/delimiters/img012delimiters.pngbin0 -> 254 bytes
-rw-r--r--src/kile/symbols/delimiters/img013delimiters.pngbin0 -> 189 bytes
-rw-r--r--src/kile/symbols/delimiters/img014delimiters.pngbin0 -> 182 bytes
-rw-r--r--src/kile/symbols/delimiters/img015delimiters.pngbin0 -> 259 bytes
-rw-r--r--src/kile/symbols/delimiters/img016delimiters.pngbin0 -> 288 bytes
-rw-r--r--src/kile/symbols/delimiters/img017delimiters.pngbin0 -> 257 bytes
-rw-r--r--src/kile/symbols/delimiters/img018delimiters.pngbin0 -> 261 bytes
-rw-r--r--src/kile/symbols/delimiters/img019delimiters.pngbin0 -> 251 bytes
-rw-r--r--src/kile/symbols/delimiters/img020delimiters.pngbin0 -> 245 bytes
-rw-r--r--src/kile/symbols/delimiters/img021delimiters.pngbin0 -> 247 bytes
-rw-r--r--src/kile/symbols/delimiters/img022delimiters.pngbin0 -> 260 bytes
-rw-r--r--src/kile/symbols/delimiters/img023delimiters.pngbin0 -> 302 bytes
-rw-r--r--src/kile/symbols/delimiters/img024delimiters.pngbin0 -> 300 bytes
-rw-r--r--src/kile/symbols/delimiters/img025delimiters.pngbin0 -> 300 bytes
-rw-r--r--src/kile/symbols/delimiters/img026delimiters.pngbin0 -> 295 bytes
-rw-r--r--src/kile/symbols/delimiters/img027delimiters.pngbin0 -> 174 bytes
-rw-r--r--src/kile/symbols/delimiters/img028delimiters.pngbin0 -> 193 bytes
-rw-r--r--src/kile/symbols/delimiters/img029delimiters.pngbin0 -> 200 bytes
-rw-r--r--src/kile/symbols/delimiters/img030delimiters.pngbin0 -> 179 bytes
-rw-r--r--src/kile/symbols/delimiters/img031delimiters.pngbin0 -> 179 bytes
-rw-r--r--src/kile/symbols/delimiters/img032delimiters.pngbin0 -> 198 bytes
-rw-r--r--src/kile/symbols/delimiters/img033delimiters.pngbin0 -> 198 bytes
-rw-r--r--src/kile/symbols/delimiters/img034delimiters.pngbin0 -> 198 bytes
-rw-r--r--src/kile/symbols/delimiters/img035delimiters.pngbin0 -> 198 bytes
-rw-r--r--src/kile/symbols/delimiters/img036delimiters.pngbin0 -> 193 bytes
-rw-r--r--src/kile/symbols/delimiters/img037delimiters.pngbin0 -> 203 bytes
-rw-r--r--src/kile/symbols/gesymb.cpp175
-rw-r--r--src/kile/symbols/gesymb.h27
-rw-r--r--src/kile/symbols/greek.tex85
-rw-r--r--src/kile/symbols/greek/CMakeLists.txt72
-rw-r--r--src/kile/symbols/greek/Makefile.am67
-rw-r--r--src/kile/symbols/greek/img001greek.pngbin0 -> 274 bytes
-rw-r--r--src/kile/symbols/greek/img002greek.pngbin0 -> 302 bytes
-rw-r--r--src/kile/symbols/greek/img003greek.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/greek/img004greek.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/greek/img005greek.pngbin0 -> 241 bytes
-rw-r--r--src/kile/symbols/greek/img006greek.pngbin0 -> 259 bytes
-rw-r--r--src/kile/symbols/greek/img007greek.pngbin0 -> 270 bytes
-rw-r--r--src/kile/symbols/greek/img008greek.pngbin0 -> 282 bytes
-rw-r--r--src/kile/symbols/greek/img009greek.pngbin0 -> 287 bytes
-rw-r--r--src/kile/symbols/greek/img010greek.pngbin0 -> 299 bytes
-rw-r--r--src/kile/symbols/greek/img011greek.pngbin0 -> 238 bytes
-rw-r--r--src/kile/symbols/greek/img012greek.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/greek/img013greek.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/greek/img014greek.pngbin0 -> 278 bytes
-rw-r--r--src/kile/symbols/greek/img015greek.pngbin0 -> 265 bytes
-rw-r--r--src/kile/symbols/greek/img016greek.pngbin0 -> 279 bytes
-rw-r--r--src/kile/symbols/greek/img017greek.pngbin0 -> 245 bytes
-rw-r--r--src/kile/symbols/greek/img018greek.pngbin0 -> 257 bytes
-rw-r--r--src/kile/symbols/greek/img019greek.pngbin0 -> 277 bytes
-rw-r--r--src/kile/symbols/greek/img020greek.pngbin0 -> 270 bytes
-rw-r--r--src/kile/symbols/greek/img021greek.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/greek/img022greek.pngbin0 -> 264 bytes
-rw-r--r--src/kile/symbols/greek/img023greek.pngbin0 -> 256 bytes
-rw-r--r--src/kile/symbols/greek/img024greek.pngbin0 -> 242 bytes
-rw-r--r--src/kile/symbols/greek/img025greek.pngbin0 -> 270 bytes
-rw-r--r--src/kile/symbols/greek/img026greek.pngbin0 -> 290 bytes
-rw-r--r--src/kile/symbols/greek/img027greek.pngbin0 -> 284 bytes
-rw-r--r--src/kile/symbols/greek/img028greek.pngbin0 -> 278 bytes
-rw-r--r--src/kile/symbols/greek/img029greek.pngbin0 -> 300 bytes
-rw-r--r--src/kile/symbols/greek/img030greek.pngbin0 -> 271 bytes
-rw-r--r--src/kile/symbols/greek/img031greek.pngbin0 -> 280 bytes
-rw-r--r--src/kile/symbols/greek/img032greek.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/greek/img033greek.pngbin0 -> 236 bytes
-rw-r--r--src/kile/symbols/greek/img034greek.pngbin0 -> 285 bytes
-rw-r--r--src/kile/symbols/greek/img035greek.pngbin0 -> 256 bytes
-rw-r--r--src/kile/symbols/greek/img036greek.pngbin0 -> 285 bytes
-rw-r--r--src/kile/symbols/greek/img037greek.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/greek/img038greek.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/greek/img039greek.pngbin0 -> 288 bytes
-rw-r--r--src/kile/symbols/greek/img040greek.pngbin0 -> 308 bytes
-rw-r--r--src/kile/symbols/greek/img041greek.pngbin0 -> 320 bytes
-rw-r--r--src/kile/symbols/greek/img042greek.pngbin0 -> 244 bytes
-rw-r--r--src/kile/symbols/greek/img043greek.pngbin0 -> 299 bytes
-rw-r--r--src/kile/symbols/greek/img044greek.pngbin0 -> 280 bytes
-rw-r--r--src/kile/symbols/greek/img045greek.pngbin0 -> 300 bytes
-rw-r--r--src/kile/symbols/greek/img046greek.pngbin0 -> 317 bytes
-rw-r--r--src/kile/symbols/greek/img047greek.pngbin0 -> 298 bytes
-rw-r--r--src/kile/symbols/greek/img048greek.pngbin0 -> 254 bytes
-rw-r--r--src/kile/symbols/greek/img049greek.pngbin0 -> 270 bytes
-rw-r--r--src/kile/symbols/greek/img050greek.pngbin0 -> 287 bytes
-rw-r--r--src/kile/symbols/greek/img051greek.pngbin0 -> 230 bytes
-rw-r--r--src/kile/symbols/greek/img052greek.pngbin0 -> 285 bytes
-rw-r--r--src/kile/symbols/greek/img053greek.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/greek/img054greek.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/greek/img055greek.pngbin0 -> 300 bytes
-rw-r--r--src/kile/symbols/greek/img056greek.pngbin0 -> 271 bytes
-rw-r--r--src/kile/symbols/greek/img057greek.pngbin0 -> 267 bytes
-rw-r--r--src/kile/symbols/greek/img058greek.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/greek/img059greek.pngbin0 -> 292 bytes
-rw-r--r--src/kile/symbols/greek/img060greek.pngbin0 -> 312 bytes
-rw-r--r--src/kile/symbols/greek/img061greek.pngbin0 -> 288 bytes
-rw-r--r--src/kile/symbols/greek/img062greek.pngbin0 -> 288 bytes
-rw-r--r--src/kile/symbols/greek/img063greek.pngbin0 -> 305 bytes
-rw-r--r--src/kile/symbols/greek/img064greek.pngbin0 -> 308 bytes
-rw-r--r--src/kile/symbols/greek/img065greek.pngbin0 -> 316 bytes
-rw-r--r--src/kile/symbols/misc-math.tex158
-rw-r--r--src/kile/symbols/misc-math/CMakeLists.txt105
-rw-r--r--src/kile/symbols/misc-math/Makefile.am99
-rw-r--r--src/kile/symbols/misc-math/img001misc-math.pngbin0 -> 173 bytes
-rw-r--r--src/kile/symbols/misc-math/img002misc-math.pngbin0 -> 180 bytes
-rw-r--r--src/kile/symbols/misc-math/img003misc-math.pngbin0 -> 171 bytes
-rw-r--r--src/kile/symbols/misc-math/img004misc-math.pngbin0 -> 177 bytes
-rw-r--r--src/kile/symbols/misc-math/img005misc-math.pngbin0 -> 185 bytes
-rw-r--r--src/kile/symbols/misc-math/img006misc-math.pngbin0 -> 184 bytes
-rw-r--r--src/kile/symbols/misc-math/img007misc-math.pngbin0 -> 185 bytes
-rw-r--r--src/kile/symbols/misc-math/img008misc-math.pngbin0 -> 177 bytes
-rw-r--r--src/kile/symbols/misc-math/img009misc-math.pngbin0 -> 302 bytes
-rw-r--r--src/kile/symbols/misc-math/img010misc-math.pngbin0 -> 228 bytes
-rw-r--r--src/kile/symbols/misc-math/img011misc-math.pngbin0 -> 254 bytes
-rw-r--r--src/kile/symbols/misc-math/img012misc-math.pngbin0 -> 260 bytes
-rw-r--r--src/kile/symbols/misc-math/img013misc-math.pngbin0 -> 254 bytes
-rw-r--r--src/kile/symbols/misc-math/img014misc-math.pngbin0 -> 251 bytes
-rw-r--r--src/kile/symbols/misc-math/img015misc-math.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/misc-math/img016misc-math.pngbin0 -> 302 bytes
-rw-r--r--src/kile/symbols/misc-math/img017misc-math.pngbin0 -> 312 bytes
-rw-r--r--src/kile/symbols/misc-math/img018misc-math.pngbin0 -> 217 bytes
-rw-r--r--src/kile/symbols/misc-math/img019misc-math.pngbin0 -> 229 bytes
-rw-r--r--src/kile/symbols/misc-math/img020misc-math.pngbin0 -> 235 bytes
-rw-r--r--src/kile/symbols/misc-math/img021misc-math.pngbin0 -> 252 bytes
-rw-r--r--src/kile/symbols/misc-math/img022misc-math.pngbin0 -> 287 bytes
-rw-r--r--src/kile/symbols/misc-math/img023misc-math.pngbin0 -> 288 bytes
-rw-r--r--src/kile/symbols/misc-math/img024misc-math.pngbin0 -> 207 bytes
-rw-r--r--src/kile/symbols/misc-math/img025misc-math.pngbin0 -> 210 bytes
-rw-r--r--src/kile/symbols/misc-math/img026misc-math.pngbin0 -> 288 bytes
-rw-r--r--src/kile/symbols/misc-math/img027misc-math.pngbin0 -> 285 bytes
-rw-r--r--src/kile/symbols/misc-math/img028misc-math.pngbin0 -> 289 bytes
-rw-r--r--src/kile/symbols/misc-math/img029misc-math.pngbin0 -> 305 bytes
-rw-r--r--src/kile/symbols/misc-math/img030misc-math.pngbin0 -> 311 bytes
-rw-r--r--src/kile/symbols/misc-math/img031misc-math.pngbin0 -> 305 bytes
-rw-r--r--src/kile/symbols/misc-math/img032misc-math.pngbin0 -> 307 bytes
-rw-r--r--src/kile/symbols/misc-math/img033misc-math.pngbin0 -> 201 bytes
-rw-r--r--src/kile/symbols/misc-math/img034misc-math.pngbin0 -> 277 bytes
-rw-r--r--src/kile/symbols/misc-math/img035misc-math.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/misc-math/img036misc-math.pngbin0 -> 303 bytes
-rw-r--r--src/kile/symbols/misc-math/img037misc-math.pngbin0 -> 296 bytes
-rw-r--r--src/kile/symbols/misc-math/img038misc-math.pngbin0 -> 296 bytes
-rw-r--r--src/kile/symbols/misc-math/img039misc-math.pngbin0 -> 305 bytes
-rw-r--r--src/kile/symbols/misc-math/img040misc-math.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/misc-math/img041misc-math.pngbin0 -> 183 bytes
-rw-r--r--src/kile/symbols/misc-math/img042misc-math.pngbin0 -> 287 bytes
-rw-r--r--src/kile/symbols/misc-math/img043misc-math.pngbin0 -> 202 bytes
-rw-r--r--src/kile/symbols/misc-math/img044misc-math.pngbin0 -> 264 bytes
-rw-r--r--src/kile/symbols/misc-math/img045misc-math.pngbin0 -> 240 bytes
-rw-r--r--src/kile/symbols/misc-math/img046misc-math.pngbin0 -> 255 bytes
-rw-r--r--src/kile/symbols/misc-math/img047misc-math.pngbin0 -> 324 bytes
-rw-r--r--src/kile/symbols/misc-math/img048misc-math.pngbin0 -> 280 bytes
-rw-r--r--src/kile/symbols/misc-math/img049misc-math.pngbin0 -> 297 bytes
-rw-r--r--src/kile/symbols/misc-math/img050misc-math.pngbin0 -> 316 bytes
-rw-r--r--src/kile/symbols/misc-math/img051misc-math.pngbin0 -> 292 bytes
-rw-r--r--src/kile/symbols/misc-math/img052misc-math.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/misc-math/img053misc-math.pngbin0 -> 298 bytes
-rw-r--r--src/kile/symbols/misc-math/img054misc-math.pngbin0 -> 282 bytes
-rw-r--r--src/kile/symbols/misc-math/img055misc-math.pngbin0 -> 252 bytes
-rw-r--r--src/kile/symbols/misc-math/img056misc-math.pngbin0 -> 257 bytes
-rw-r--r--src/kile/symbols/misc-math/img057misc-math.pngbin0 -> 280 bytes
-rw-r--r--src/kile/symbols/misc-math/img058misc-math.pngbin0 -> 259 bytes
-rw-r--r--src/kile/symbols/misc-math/img059misc-math.pngbin0 -> 362 bytes
-rw-r--r--src/kile/symbols/misc-math/img060misc-math.pngbin0 -> 360 bytes
-rw-r--r--src/kile/symbols/misc-math/img061misc-math.pngbin0 -> 188 bytes
-rw-r--r--src/kile/symbols/misc-math/img062misc-math.pngbin0 -> 192 bytes
-rw-r--r--src/kile/symbols/misc-math/img063misc-math.pngbin0 -> 306 bytes
-rw-r--r--src/kile/symbols/misc-math/img064misc-math.pngbin0 -> 248 bytes
-rw-r--r--src/kile/symbols/misc-math/img065misc-math.pngbin0 -> 305 bytes
-rw-r--r--src/kile/symbols/misc-math/img066misc-math.pngbin0 -> 312 bytes
-rw-r--r--src/kile/symbols/misc-math/img067misc-math.pngbin0 -> 279 bytes
-rw-r--r--src/kile/symbols/misc-math/img068misc-math.pngbin0 -> 280 bytes
-rw-r--r--src/kile/symbols/misc-math/img069misc-math.pngbin0 -> 278 bytes
-rw-r--r--src/kile/symbols/misc-math/img070misc-math.pngbin0 -> 277 bytes
-rw-r--r--src/kile/symbols/misc-math/img071misc-math.pngbin0 -> 280 bytes
-rw-r--r--src/kile/symbols/misc-math/img072misc-math.pngbin0 -> 267 bytes
-rw-r--r--src/kile/symbols/misc-math/img073misc-math.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/misc-math/img074misc-math.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/misc-math/img075misc-math.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/misc-math/img076misc-math.pngbin0 -> 280 bytes
-rw-r--r--src/kile/symbols/misc-math/img077misc-math.pngbin0 -> 291 bytes
-rw-r--r--src/kile/symbols/misc-math/img078misc-math.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/misc-math/img079misc-math.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/misc-math/img080misc-math.pngbin0 -> 390 bytes
-rw-r--r--src/kile/symbols/misc-math/img081misc-math.pngbin0 -> 396 bytes
-rw-r--r--src/kile/symbols/misc-math/img082misc-math.pngbin0 -> 408 bytes
-rw-r--r--src/kile/symbols/misc-math/img083misc-math.pngbin0 -> 414 bytes
-rw-r--r--src/kile/symbols/misc-math/img084misc-math.pngbin0 -> 363 bytes
-rw-r--r--src/kile/symbols/misc-math/img085misc-math.pngbin0 -> 363 bytes
-rw-r--r--src/kile/symbols/misc-math/img086misc-math.pngbin0 -> 500 bytes
-rw-r--r--src/kile/symbols/misc-math/img087misc-math.pngbin0 -> 490 bytes
-rw-r--r--src/kile/symbols/misc-math/img088misc-math.pngbin0 -> 451 bytes
-rw-r--r--src/kile/symbols/misc-math/img089misc-math.pngbin0 -> 448 bytes
-rw-r--r--src/kile/symbols/misc-math/img090misc-math.pngbin0 -> 416 bytes
-rw-r--r--src/kile/symbols/misc-math/img091misc-math.pngbin0 -> 421 bytes
-rw-r--r--src/kile/symbols/misc-math/img092misc-math.pngbin0 -> 393 bytes
-rw-r--r--src/kile/symbols/misc-math/img093misc-math.pngbin0 -> 399 bytes
-rw-r--r--src/kile/symbols/misc-math/img094misc-math.pngbin0 -> 330 bytes
-rw-r--r--src/kile/symbols/misc-math/img095misc-math.pngbin0 -> 348 bytes
-rw-r--r--src/kile/symbols/misc-math/img096misc-math.pngbin0 -> 298 bytes
-rw-r--r--src/kile/symbols/misc-math/img097misc-math.pngbin0 -> 312 bytes
-rw-r--r--src/kile/symbols/misc-text.tex204
-rw-r--r--src/kile/symbols/misc-text/CMakeLists.txt142
-rw-r--r--src/kile/symbols/misc-text/Makefile.am137
-rw-r--r--src/kile/symbols/misc-text/img001misc-text.pngbin0 -> 178 bytes
-rw-r--r--src/kile/symbols/misc-text/img002misc-text.pngbin0 -> 224 bytes
-rw-r--r--src/kile/symbols/misc-text/img003misc-text.pngbin0 -> 208 bytes
-rw-r--r--src/kile/symbols/misc-text/img004misc-text.pngbin0 -> 179 bytes
-rw-r--r--src/kile/symbols/misc-text/img005misc-text.pngbin0 -> 218 bytes
-rw-r--r--src/kile/symbols/misc-text/img006misc-text.pngbin0 -> 217 bytes
-rw-r--r--src/kile/symbols/misc-text/img007misc-text.pngbin0 -> 218 bytes
-rw-r--r--src/kile/symbols/misc-text/img008misc-text.pngbin0 -> 210 bytes
-rw-r--r--src/kile/symbols/misc-text/img009misc-text.pngbin0 -> 224 bytes
-rw-r--r--src/kile/symbols/misc-text/img010misc-text.pngbin0 -> 230 bytes
-rw-r--r--src/kile/symbols/misc-text/img011misc-text.pngbin0 -> 234 bytes
-rw-r--r--src/kile/symbols/misc-text/img012misc-text.pngbin0 -> 226 bytes
-rw-r--r--src/kile/symbols/misc-text/img013misc-text.pngbin0 -> 230 bytes
-rw-r--r--src/kile/symbols/misc-text/img014misc-text.pngbin0 -> 245 bytes
-rw-r--r--src/kile/symbols/misc-text/img015misc-text.pngbin0 -> 209 bytes
-rw-r--r--src/kile/symbols/misc-text/img016misc-text.pngbin0 -> 215 bytes
-rw-r--r--src/kile/symbols/misc-text/img017misc-text.pngbin0 -> 236 bytes
-rw-r--r--src/kile/symbols/misc-text/img018misc-text.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/misc-text/img019misc-text.pngbin0 -> 229 bytes
-rw-r--r--src/kile/symbols/misc-text/img020misc-text.pngbin0 -> 196 bytes
-rw-r--r--src/kile/symbols/misc-text/img021misc-text.pngbin0 -> 200 bytes
-rw-r--r--src/kile/symbols/misc-text/img022misc-text.pngbin0 -> 267 bytes
-rw-r--r--src/kile/symbols/misc-text/img023misc-text.pngbin0 -> 186 bytes
-rw-r--r--src/kile/symbols/misc-text/img024misc-text.pngbin0 -> 260 bytes
-rw-r--r--src/kile/symbols/misc-text/img025misc-text.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/misc-text/img026misc-text.pngbin0 -> 291 bytes
-rw-r--r--src/kile/symbols/misc-text/img027misc-text.pngbin0 -> 252 bytes
-rw-r--r--src/kile/symbols/misc-text/img028misc-text.pngbin0 -> 174 bytes
-rw-r--r--src/kile/symbols/misc-text/img029misc-text.pngbin0 -> 159 bytes
-rw-r--r--src/kile/symbols/misc-text/img030misc-text.pngbin0 -> 159 bytes
-rw-r--r--src/kile/symbols/misc-text/img031misc-text.pngbin0 -> 178 bytes
-rw-r--r--src/kile/symbols/misc-text/img032misc-text.pngbin0 -> 159 bytes
-rw-r--r--src/kile/symbols/misc-text/img033misc-text.pngbin0 -> 140 bytes
-rw-r--r--src/kile/symbols/misc-text/img034misc-text.pngbin0 -> 315 bytes
-rw-r--r--src/kile/symbols/misc-text/img035misc-text.pngbin0 -> 298 bytes
-rw-r--r--src/kile/symbols/misc-text/img036misc-text.pngbin0 -> 323 bytes
-rw-r--r--src/kile/symbols/misc-text/img037misc-text.pngbin0 -> 345 bytes
-rw-r--r--src/kile/symbols/misc-text/img038misc-text.pngbin0 -> 262 bytes
-rw-r--r--src/kile/symbols/misc-text/img039misc-text.pngbin0 -> 291 bytes
-rw-r--r--src/kile/symbols/misc-text/img040misc-text.pngbin0 -> 290 bytes
-rw-r--r--src/kile/symbols/misc-text/img041misc-text.pngbin0 -> 316 bytes
-rw-r--r--src/kile/symbols/misc-text/img042misc-text.pngbin0 -> 291 bytes
-rw-r--r--src/kile/symbols/misc-text/img043misc-text.pngbin0 -> 297 bytes
-rw-r--r--src/kile/symbols/misc-text/img044misc-text.pngbin0 -> 294 bytes
-rw-r--r--src/kile/symbols/misc-text/img045misc-text.pngbin0 -> 309 bytes
-rw-r--r--src/kile/symbols/misc-text/img046misc-text.pngbin0 -> 326 bytes
-rw-r--r--src/kile/symbols/misc-text/img047misc-text.pngbin0 -> 278 bytes
-rw-r--r--src/kile/symbols/misc-text/img048misc-text.pngbin0 -> 273 bytes
-rw-r--r--src/kile/symbols/misc-text/img049misc-text.pngbin0 -> 256 bytes
-rw-r--r--src/kile/symbols/misc-text/img050misc-text.pngbin0 -> 319 bytes
-rw-r--r--src/kile/symbols/misc-text/img051misc-text.pngbin0 -> 319 bytes
-rw-r--r--src/kile/symbols/misc-text/img052misc-text.pngbin0 -> 325 bytes
-rw-r--r--src/kile/symbols/misc-text/img053misc-text.pngbin0 -> 324 bytes
-rw-r--r--src/kile/symbols/misc-text/img054misc-text.pngbin0 -> 308 bytes
-rw-r--r--src/kile/symbols/misc-text/img055misc-text.pngbin0 -> 383 bytes
-rw-r--r--src/kile/symbols/misc-text/img056misc-text.pngbin0 -> 397 bytes
-rw-r--r--src/kile/symbols/misc-text/img057misc-text.pngbin0 -> 405 bytes
-rw-r--r--src/kile/symbols/misc-text/img058misc-text.pngbin0 -> 395 bytes
-rw-r--r--src/kile/symbols/misc-text/img059misc-text.pngbin0 -> 241 bytes
-rw-r--r--src/kile/symbols/misc-text/img060misc-text.pngbin0 -> 265 bytes
-rw-r--r--src/kile/symbols/misc-text/img061misc-text.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/misc-text/img062misc-text.pngbin0 -> 219 bytes
-rw-r--r--src/kile/symbols/misc-text/img063misc-text.pngbin0 -> 268 bytes
-rw-r--r--src/kile/symbols/misc-text/img064misc-text.pngbin0 -> 290 bytes
-rw-r--r--src/kile/symbols/misc-text/img065misc-text.pngbin0 -> 262 bytes
-rw-r--r--src/kile/symbols/misc-text/img066misc-text.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/misc-text/img067misc-text.pngbin0 -> 295 bytes
-rw-r--r--src/kile/symbols/misc-text/img068misc-text.pngbin0 -> 268 bytes
-rw-r--r--src/kile/symbols/misc-text/img069misc-text.pngbin0 -> 298 bytes
-rw-r--r--src/kile/symbols/misc-text/img070misc-text.pngbin0 -> 291 bytes
-rw-r--r--src/kile/symbols/misc-text/img071misc-text.pngbin0 -> 303 bytes
-rw-r--r--src/kile/symbols/misc-text/img072misc-text.pngbin0 -> 290 bytes
-rw-r--r--src/kile/symbols/misc-text/img073misc-text.pngbin0 -> 322 bytes
-rw-r--r--src/kile/symbols/misc-text/img074misc-text.pngbin0 -> 231 bytes
-rw-r--r--src/kile/symbols/misc-text/img075misc-text.pngbin0 -> 273 bytes
-rw-r--r--src/kile/symbols/misc-text/img076misc-text.pngbin0 -> 282 bytes
-rw-r--r--src/kile/symbols/misc-text/img077misc-text.pngbin0 -> 328 bytes
-rw-r--r--src/kile/symbols/misc-text/img078misc-text.pngbin0 -> 405 bytes
-rw-r--r--src/kile/symbols/misc-text/img079misc-text.pngbin0 -> 375 bytes
-rw-r--r--src/kile/symbols/misc-text/img080misc-text.pngbin0 -> 287 bytes
-rw-r--r--src/kile/symbols/misc-text/img081misc-text.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/misc-text/img082misc-text.pngbin0 -> 308 bytes
-rw-r--r--src/kile/symbols/misc-text/img083misc-text.pngbin0 -> 309 bytes
-rw-r--r--src/kile/symbols/misc-text/img084misc-text.pngbin0 -> 303 bytes
-rw-r--r--src/kile/symbols/misc-text/img085misc-text.pngbin0 -> 278 bytes
-rw-r--r--src/kile/symbols/misc-text/img086misc-text.pngbin0 -> 262 bytes
-rw-r--r--src/kile/symbols/misc-text/img087misc-text.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/misc-text/img088misc-text.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/misc-text/img089misc-text.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/misc-text/img090misc-text.pngbin0 -> 256 bytes
-rw-r--r--src/kile/symbols/misc-text/img091misc-text.pngbin0 -> 291 bytes
-rw-r--r--src/kile/symbols/misc-text/img092misc-text.pngbin0 -> 291 bytes
-rw-r--r--src/kile/symbols/misc-text/img093misc-text.pngbin0 -> 295 bytes
-rw-r--r--src/kile/symbols/misc-text/img094misc-text.pngbin0 -> 194 bytes
-rw-r--r--src/kile/symbols/misc-text/img095misc-text.pngbin0 -> 194 bytes
-rw-r--r--src/kile/symbols/misc-text/img096misc-text.pngbin0 -> 297 bytes
-rw-r--r--src/kile/symbols/misc-text/img097misc-text.pngbin0 -> 304 bytes
-rw-r--r--src/kile/symbols/misc-text/img098misc-text.pngbin0 -> 181 bytes
-rw-r--r--src/kile/symbols/misc-text/img099misc-text.pngbin0 -> 236 bytes
-rw-r--r--src/kile/symbols/misc-text/img100misc-text.pngbin0 -> 338 bytes
-rw-r--r--src/kile/symbols/misc-text/img101misc-text.pngbin0 -> 263 bytes
-rw-r--r--src/kile/symbols/misc-text/img102misc-text.pngbin0 -> 237 bytes
-rw-r--r--src/kile/symbols/misc-text/img103misc-text.pngbin0 -> 278 bytes
-rw-r--r--src/kile/symbols/misc-text/img104misc-text.pngbin0 -> 315 bytes
-rw-r--r--src/kile/symbols/misc-text/img105misc-text.pngbin0 -> 279 bytes
-rw-r--r--src/kile/symbols/misc-text/img106misc-text.pngbin0 -> 275 bytes
-rw-r--r--src/kile/symbols/misc-text/img107misc-text.pngbin0 -> 269 bytes
-rw-r--r--src/kile/symbols/misc-text/img108misc-text.pngbin0 -> 342 bytes
-rw-r--r--src/kile/symbols/misc-text/img109misc-text.pngbin0 -> 245 bytes
-rw-r--r--src/kile/symbols/misc-text/img110misc-text.pngbin0 -> 296 bytes
-rw-r--r--src/kile/symbols/misc-text/img111misc-text.pngbin0 -> 354 bytes
-rw-r--r--src/kile/symbols/misc-text/img112misc-text.pngbin0 -> 331 bytes
-rw-r--r--src/kile/symbols/misc-text/img113misc-text.pngbin0 -> 229 bytes
-rw-r--r--src/kile/symbols/misc-text/img114misc-text.pngbin0 -> 324 bytes
-rw-r--r--src/kile/symbols/misc-text/img115misc-text.pngbin0 -> 316 bytes
-rw-r--r--src/kile/symbols/misc-text/img116misc-text.pngbin0 -> 262 bytes
-rw-r--r--src/kile/symbols/misc-text/img117misc-text.pngbin0 -> 170 bytes
-rw-r--r--src/kile/symbols/misc-text/img118misc-text.pngbin0 -> 190 bytes
-rw-r--r--src/kile/symbols/misc-text/img119misc-text.pngbin0 -> 184 bytes
-rw-r--r--src/kile/symbols/misc-text/img120misc-text.pngbin0 -> 273 bytes
-rw-r--r--src/kile/symbols/misc-text/img121misc-text.pngbin0 -> 276 bytes
-rw-r--r--src/kile/symbols/misc-text/img122misc-text.pngbin0 -> 188 bytes
-rw-r--r--src/kile/symbols/misc-text/img123misc-text.pngbin0 -> 173 bytes
-rw-r--r--src/kile/symbols/misc-text/img124misc-text.pngbin0 -> 269 bytes
-rw-r--r--src/kile/symbols/misc-text/img125misc-text.pngbin0 -> 212 bytes
-rw-r--r--src/kile/symbols/misc-text/img126misc-text.pngbin0 -> 224 bytes
-rw-r--r--src/kile/symbols/misc-text/img127misc-text.pngbin0 -> 262 bytes
-rw-r--r--src/kile/symbols/misc-text/img128misc-text.pngbin0 -> 199 bytes
-rw-r--r--src/kile/symbols/misc-text/img129misc-text.pngbin0 -> 265 bytes
-rw-r--r--src/kile/symbols/misc-text/img130misc-text.pngbin0 -> 258 bytes
-rw-r--r--src/kile/symbols/misc-text/img131misc-text.pngbin0 -> 257 bytes
-rw-r--r--src/kile/symbols/misc-text/img132misc-text.pngbin0 -> 256 bytes
-rw-r--r--src/kile/symbols/misc-text/img133misc-text.pngbin0 -> 282 bytes
-rw-r--r--src/kile/symbols/misc-text/img134misc-text.pngbin0 -> 265 bytes
-rw-r--r--src/kile/symbols/misc-text/img135misc-text.pngbin0 -> 206 bytes
-rw-r--r--src/kile/symbols/operators.tex154
-rw-r--r--src/kile/symbols/operators/CMakeLists.txt120
-rw-r--r--src/kile/symbols/operators/Makefile.am115
-rw-r--r--src/kile/symbols/operators/img001operators.pngbin0 -> 191 bytes
-rw-r--r--src/kile/symbols/operators/img002operators.pngbin0 -> 185 bytes
-rw-r--r--src/kile/symbols/operators/img003operators.pngbin0 -> 237 bytes
-rw-r--r--src/kile/symbols/operators/img004operators.pngbin0 -> 206 bytes
-rw-r--r--src/kile/symbols/operators/img005operators.pngbin0 -> 251 bytes
-rw-r--r--src/kile/symbols/operators/img006operators.pngbin0 -> 249 bytes
-rw-r--r--src/kile/symbols/operators/img007operators.pngbin0 -> 250 bytes
-rw-r--r--src/kile/symbols/operators/img008operators.pngbin0 -> 241 bytes
-rw-r--r--src/kile/symbols/operators/img009operators.pngbin0 -> 299 bytes
-rw-r--r--src/kile/symbols/operators/img010operators.pngbin0 -> 251 bytes
-rw-r--r--src/kile/symbols/operators/img011operators.pngbin0 -> 254 bytes
-rw-r--r--src/kile/symbols/operators/img012operators.pngbin0 -> 172 bytes
-rw-r--r--src/kile/symbols/operators/img013operators.pngbin0 -> 226 bytes
-rw-r--r--src/kile/symbols/operators/img014operators.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/operators/img015operators.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/operators/img016operators.pngbin0 -> 216 bytes
-rw-r--r--src/kile/symbols/operators/img017operators.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/operators/img018operators.pngbin0 -> 276 bytes
-rw-r--r--src/kile/symbols/operators/img019operators.pngbin0 -> 252 bytes
-rw-r--r--src/kile/symbols/operators/img020operators.pngbin0 -> 271 bytes
-rw-r--r--src/kile/symbols/operators/img021operators.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/operators/img022operators.pngbin0 -> 297 bytes
-rw-r--r--src/kile/symbols/operators/img023operators.pngbin0 -> 262 bytes
-rw-r--r--src/kile/symbols/operators/img024operators.pngbin0 -> 321 bytes
-rw-r--r--src/kile/symbols/operators/img025operators.pngbin0 -> 314 bytes
-rw-r--r--src/kile/symbols/operators/img026operators.pngbin0 -> 224 bytes
-rw-r--r--src/kile/symbols/operators/img027operators.pngbin0 -> 210 bytes
-rw-r--r--src/kile/symbols/operators/img028operators.pngbin0 -> 217 bytes
-rw-r--r--src/kile/symbols/operators/img029operators.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/operators/img030operators.pngbin0 -> 237 bytes
-rw-r--r--src/kile/symbols/operators/img031operators.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/operators/img032operators.pngbin0 -> 302 bytes
-rw-r--r--src/kile/symbols/operators/img033operators.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/operators/img034operators.pngbin0 -> 267 bytes
-rw-r--r--src/kile/symbols/operators/img035operators.pngbin0 -> 269 bytes
-rw-r--r--src/kile/symbols/operators/img036operators.pngbin0 -> 275 bytes
-rw-r--r--src/kile/symbols/operators/img037operators.pngbin0 -> 277 bytes
-rw-r--r--src/kile/symbols/operators/img038operators.pngbin0 -> 282 bytes
-rw-r--r--src/kile/symbols/operators/img039operators.pngbin0 -> 243 bytes
-rw-r--r--src/kile/symbols/operators/img040operators.pngbin0 -> 248 bytes
-rw-r--r--src/kile/symbols/operators/img041operators.pngbin0 -> 267 bytes
-rw-r--r--src/kile/symbols/operators/img042operators.pngbin0 -> 263 bytes
-rw-r--r--src/kile/symbols/operators/img043operators.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/operators/img044operators.pngbin0 -> 237 bytes
-rw-r--r--src/kile/symbols/operators/img045operators.pngbin0 -> 259 bytes
-rw-r--r--src/kile/symbols/operators/img046operators.pngbin0 -> 257 bytes
-rw-r--r--src/kile/symbols/operators/img047operators.pngbin0 -> 189 bytes
-rw-r--r--src/kile/symbols/operators/img048operators.pngbin0 -> 196 bytes
-rw-r--r--src/kile/symbols/operators/img049operators.pngbin0 -> 265 bytes
-rw-r--r--src/kile/symbols/operators/img050operators.pngbin0 -> 264 bytes
-rw-r--r--src/kile/symbols/operators/img051operators.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/operators/img052operators.pngbin0 -> 280 bytes
-rw-r--r--src/kile/symbols/operators/img053operators.pngbin0 -> 289 bytes
-rw-r--r--src/kile/symbols/operators/img054operators.pngbin0 -> 280 bytes
-rw-r--r--src/kile/symbols/operators/img055operators.pngbin0 -> 282 bytes
-rw-r--r--src/kile/symbols/operators/img056operators.pngbin0 -> 270 bytes
-rw-r--r--src/kile/symbols/operators/img057operators.pngbin0 -> 285 bytes
-rw-r--r--src/kile/symbols/operators/img058operators.pngbin0 -> 212 bytes
-rw-r--r--src/kile/symbols/operators/img059operators.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/operators/img060operators.pngbin0 -> 271 bytes
-rw-r--r--src/kile/symbols/operators/img061operators.pngbin0 -> 310 bytes
-rw-r--r--src/kile/symbols/operators/img062operators.pngbin0 -> 221 bytes
-rw-r--r--src/kile/symbols/operators/img063operators.pngbin0 -> 243 bytes
-rw-r--r--src/kile/symbols/operators/img064operators.pngbin0 -> 246 bytes
-rw-r--r--src/kile/symbols/operators/img065operators.pngbin0 -> 316 bytes
-rw-r--r--src/kile/symbols/operators/img066operators.pngbin0 -> 316 bytes
-rw-r--r--src/kile/symbols/operators/img067operators.pngbin0 -> 362 bytes
-rw-r--r--src/kile/symbols/operators/img068operators.pngbin0 -> 364 bytes
-rw-r--r--src/kile/symbols/operators/img069operators.pngbin0 -> 391 bytes
-rw-r--r--src/kile/symbols/operators/img070operators.pngbin0 -> 319 bytes
-rw-r--r--src/kile/symbols/operators/img071operators.pngbin0 -> 289 bytes
-rw-r--r--src/kile/symbols/operators/img072operators.pngbin0 -> 309 bytes
-rw-r--r--src/kile/symbols/operators/img073operators.pngbin0 -> 325 bytes
-rw-r--r--src/kile/symbols/operators/img074operators.pngbin0 -> 359 bytes
-rw-r--r--src/kile/symbols/operators/img075operators.pngbin0 -> 358 bytes
-rw-r--r--src/kile/symbols/operators/img076operators.pngbin0 -> 371 bytes
-rw-r--r--src/kile/symbols/operators/img077operators.pngbin0 -> 432 bytes
-rw-r--r--src/kile/symbols/operators/img078operators.pngbin0 -> 436 bytes
-rw-r--r--src/kile/symbols/operators/img079operators.pngbin0 -> 417 bytes
-rw-r--r--src/kile/symbols/operators/img080operators.pngbin0 -> 364 bytes
-rw-r--r--src/kile/symbols/operators/img081operators.pngbin0 -> 341 bytes
-rw-r--r--src/kile/symbols/operators/img082operators.pngbin0 -> 382 bytes
-rw-r--r--src/kile/symbols/operators/img083operators.pngbin0 -> 331 bytes
-rw-r--r--src/kile/symbols/operators/img084operators.pngbin0 -> 369 bytes
-rw-r--r--src/kile/symbols/operators/img085operators.pngbin0 -> 310 bytes
-rw-r--r--src/kile/symbols/operators/img086operators.pngbin0 -> 386 bytes
-rw-r--r--src/kile/symbols/operators/img087operators.pngbin0 -> 336 bytes
-rw-r--r--src/kile/symbols/operators/img088operators.pngbin0 -> 343 bytes
-rw-r--r--src/kile/symbols/operators/img089operators.pngbin0 -> 362 bytes
-rw-r--r--src/kile/symbols/operators/img090operators.pngbin0 -> 372 bytes
-rw-r--r--src/kile/symbols/operators/img091operators.pngbin0 -> 339 bytes
-rw-r--r--src/kile/symbols/operators/img092operators.pngbin0 -> 295 bytes
-rw-r--r--src/kile/symbols/operators/img093operators.pngbin0 -> 335 bytes
-rw-r--r--src/kile/symbols/operators/img094operators.pngbin0 -> 306 bytes
-rw-r--r--src/kile/symbols/operators/img095operators.pngbin0 -> 288 bytes
-rw-r--r--src/kile/symbols/operators/img096operators.pngbin0 -> 363 bytes
-rw-r--r--src/kile/symbols/operators/img097operators.pngbin0 -> 434 bytes
-rw-r--r--src/kile/symbols/operators/img098operators.pngbin0 -> 249 bytes
-rw-r--r--src/kile/symbols/operators/img099operators.pngbin0 -> 355 bytes
-rw-r--r--src/kile/symbols/operators/img100operators.pngbin0 -> 364 bytes
-rw-r--r--src/kile/symbols/operators/img101operators.pngbin0 -> 296 bytes
-rw-r--r--src/kile/symbols/operators/img102operators.pngbin0 -> 300 bytes
-rw-r--r--src/kile/symbols/operators/img103operators.pngbin0 -> 482 bytes
-rw-r--r--src/kile/symbols/operators/img104operators.pngbin0 -> 335 bytes
-rw-r--r--src/kile/symbols/operators/img105operators.pngbin0 -> 317 bytes
-rw-r--r--src/kile/symbols/operators/img106operators.pngbin0 -> 340 bytes
-rw-r--r--src/kile/symbols/operators/img107operators.pngbin0 -> 344 bytes
-rw-r--r--src/kile/symbols/operators/img108operators.pngbin0 -> 328 bytes
-rw-r--r--src/kile/symbols/operators/img109operators.pngbin0 -> 356 bytes
-rw-r--r--src/kile/symbols/operators/img110operators.pngbin0 -> 299 bytes
-rw-r--r--src/kile/symbols/operators/img111operators.pngbin0 -> 300 bytes
-rw-r--r--src/kile/symbols/operators/img112operators.pngbin0 -> 348 bytes
-rw-r--r--src/kile/symbols/operators/img113operators.pngbin0 -> 350 bytes
-rw-r--r--src/kile/symbols/relation.tex197
-rw-r--r--src/kile/symbols/relation/CMakeLists.txt159
-rw-r--r--src/kile/symbols/relation/Makefile.am141
-rw-r--r--src/kile/symbols/relation/img001relation.pngbin0 -> 306 bytes
-rw-r--r--src/kile/symbols/relation/img002relation.pngbin0 -> 315 bytes
-rw-r--r--src/kile/symbols/relation/img003relation.pngbin0 -> 280 bytes
-rw-r--r--src/kile/symbols/relation/img004relation.pngbin0 -> 273 bytes
-rw-r--r--src/kile/symbols/relation/img005relation.pngbin0 -> 232 bytes
-rw-r--r--src/kile/symbols/relation/img006relation.pngbin0 -> 252 bytes
-rw-r--r--src/kile/symbols/relation/img007relation.pngbin0 -> 230 bytes
-rw-r--r--src/kile/symbols/relation/img008relation.pngbin0 -> 223 bytes
-rw-r--r--src/kile/symbols/relation/img009relation.pngbin0 -> 157 bytes
-rw-r--r--src/kile/symbols/relation/img010relation.pngbin0 -> 246 bytes
-rw-r--r--src/kile/symbols/relation/img011relation.pngbin0 -> 191 bytes
-rw-r--r--src/kile/symbols/relation/img012relation.pngbin0 -> 251 bytes
-rw-r--r--src/kile/symbols/relation/img013relation.pngbin0 -> 240 bytes
-rw-r--r--src/kile/symbols/relation/img014relation.pngbin0 -> 257 bytes
-rw-r--r--src/kile/symbols/relation/img015relation.pngbin0 -> 260 bytes
-rw-r--r--src/kile/symbols/relation/img016relation.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/relation/img017relation.pngbin0 -> 254 bytes
-rw-r--r--src/kile/symbols/relation/img018relation.pngbin0 -> 309 bytes
-rw-r--r--src/kile/symbols/relation/img019relation.pngbin0 -> 238 bytes
-rw-r--r--src/kile/symbols/relation/img020relation.pngbin0 -> 244 bytes
-rw-r--r--src/kile/symbols/relation/img021relation.pngbin0 -> 248 bytes
-rw-r--r--src/kile/symbols/relation/img022relation.pngbin0 -> 239 bytes
-rw-r--r--src/kile/symbols/relation/img023relation.pngbin0 -> 242 bytes
-rw-r--r--src/kile/symbols/relation/img024relation.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/relation/img025relation.pngbin0 -> 252 bytes
-rw-r--r--src/kile/symbols/relation/img026relation.pngbin0 -> 252 bytes
-rw-r--r--src/kile/symbols/relation/img027relation.pngbin0 -> 289 bytes
-rw-r--r--src/kile/symbols/relation/img028relation.pngbin0 -> 289 bytes
-rw-r--r--src/kile/symbols/relation/img029relation.pngbin0 -> 257 bytes
-rw-r--r--src/kile/symbols/relation/img030relation.pngbin0 -> 258 bytes
-rw-r--r--src/kile/symbols/relation/img031relation.pngbin0 -> 312 bytes
-rw-r--r--src/kile/symbols/relation/img032relation.pngbin0 -> 324 bytes
-rw-r--r--src/kile/symbols/relation/img033relation.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/relation/img034relation.pngbin0 -> 288 bytes
-rw-r--r--src/kile/symbols/relation/img035relation.pngbin0 -> 291 bytes
-rw-r--r--src/kile/symbols/relation/img036relation.pngbin0 -> 287 bytes
-rw-r--r--src/kile/symbols/relation/img037relation.pngbin0 -> 308 bytes
-rw-r--r--src/kile/symbols/relation/img038relation.pngbin0 -> 304 bytes
-rw-r--r--src/kile/symbols/relation/img039relation.pngbin0 -> 325 bytes
-rw-r--r--src/kile/symbols/relation/img040relation.pngbin0 -> 324 bytes
-rw-r--r--src/kile/symbols/relation/img041relation.pngbin0 -> 311 bytes
-rw-r--r--src/kile/symbols/relation/img042relation.pngbin0 -> 308 bytes
-rw-r--r--src/kile/symbols/relation/img043relation.pngbin0 -> 336 bytes
-rw-r--r--src/kile/symbols/relation/img044relation.pngbin0 -> 339 bytes
-rw-r--r--src/kile/symbols/relation/img045relation.pngbin0 -> 173 bytes
-rw-r--r--src/kile/symbols/relation/img046relation.pngbin0 -> 165 bytes
-rw-r--r--src/kile/symbols/relation/img047relation.pngbin0 -> 173 bytes
-rw-r--r--src/kile/symbols/relation/img048relation.pngbin0 -> 264 bytes
-rw-r--r--src/kile/symbols/relation/img049relation.pngbin0 -> 193 bytes
-rw-r--r--src/kile/symbols/relation/img050relation.pngbin0 -> 183 bytes
-rw-r--r--src/kile/symbols/relation/img051relation.pngbin0 -> 193 bytes
-rw-r--r--src/kile/symbols/relation/img052relation.pngbin0 -> 178 bytes
-rw-r--r--src/kile/symbols/relation/img053relation.pngbin0 -> 273 bytes
-rw-r--r--src/kile/symbols/relation/img054relation.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/relation/img055relation.pngbin0 -> 167 bytes
-rw-r--r--src/kile/symbols/relation/img056relation.pngbin0 -> 230 bytes
-rw-r--r--src/kile/symbols/relation/img057relation.pngbin0 -> 169 bytes
-rw-r--r--src/kile/symbols/relation/img058relation.pngbin0 -> 249 bytes
-rw-r--r--src/kile/symbols/relation/img059relation.pngbin0 -> 172 bytes
-rw-r--r--src/kile/symbols/relation/img060relation.pngbin0 -> 214 bytes
-rw-r--r--src/kile/symbols/relation/img061relation.pngbin0 -> 184 bytes
-rw-r--r--src/kile/symbols/relation/img062relation.pngbin0 -> 241 bytes
-rw-r--r--src/kile/symbols/relation/img063relation.pngbin0 -> 247 bytes
-rw-r--r--src/kile/symbols/relation/img064relation.pngbin0 -> 224 bytes
-rw-r--r--src/kile/symbols/relation/img065relation.pngbin0 -> 292 bytes
-rw-r--r--src/kile/symbols/relation/img066relation.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/relation/img067relation.pngbin0 -> 260 bytes
-rw-r--r--src/kile/symbols/relation/img068relation.pngbin0 -> 258 bytes
-rw-r--r--src/kile/symbols/relation/img069relation.pngbin0 -> 295 bytes
-rw-r--r--src/kile/symbols/relation/img070relation.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/relation/img071relation.pngbin0 -> 325 bytes
-rw-r--r--src/kile/symbols/relation/img072relation.pngbin0 -> 338 bytes
-rw-r--r--src/kile/symbols/relation/img073relation.pngbin0 -> 253 bytes
-rw-r--r--src/kile/symbols/relation/img074relation.pngbin0 -> 240 bytes
-rw-r--r--src/kile/symbols/relation/img075relation.pngbin0 -> 278 bytes
-rw-r--r--src/kile/symbols/relation/img076relation.pngbin0 -> 269 bytes
-rw-r--r--src/kile/symbols/relation/img077relation.pngbin0 -> 314 bytes
-rw-r--r--src/kile/symbols/relation/img078relation.pngbin0 -> 316 bytes
-rw-r--r--src/kile/symbols/relation/img079relation.pngbin0 -> 270 bytes
-rw-r--r--src/kile/symbols/relation/img080relation.pngbin0 -> 257 bytes
-rw-r--r--src/kile/symbols/relation/img081relation.pngbin0 -> 295 bytes
-rw-r--r--src/kile/symbols/relation/img082relation.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/relation/img083relation.pngbin0 -> 279 bytes
-rw-r--r--src/kile/symbols/relation/img084relation.pngbin0 -> 284 bytes
-rw-r--r--src/kile/symbols/relation/img085relation.pngbin0 -> 316 bytes
-rw-r--r--src/kile/symbols/relation/img086relation.pngbin0 -> 322 bytes
-rw-r--r--src/kile/symbols/relation/img087relation.pngbin0 -> 273 bytes
-rw-r--r--src/kile/symbols/relation/img088relation.pngbin0 -> 268 bytes
-rw-r--r--src/kile/symbols/relation/img089relation.pngbin0 -> 330 bytes
-rw-r--r--src/kile/symbols/relation/img090relation.pngbin0 -> 330 bytes
-rw-r--r--src/kile/symbols/relation/img091relation.pngbin0 -> 275 bytes
-rw-r--r--src/kile/symbols/relation/img092relation.pngbin0 -> 269 bytes
-rw-r--r--src/kile/symbols/relation/img093relation.pngbin0 -> 301 bytes
-rw-r--r--src/kile/symbols/relation/img094relation.pngbin0 -> 292 bytes
-rw-r--r--src/kile/symbols/relation/img095relation.pngbin0 -> 302 bytes
-rw-r--r--src/kile/symbols/relation/img096relation.pngbin0 -> 306 bytes
-rw-r--r--src/kile/symbols/relation/img097relation.pngbin0 -> 306 bytes
-rw-r--r--src/kile/symbols/relation/img098relation.pngbin0 -> 310 bytes
-rw-r--r--src/kile/symbols/relation/img099relation.pngbin0 -> 297 bytes
-rw-r--r--src/kile/symbols/relation/img100relation.pngbin0 -> 299 bytes
-rw-r--r--src/kile/symbols/relation/img101relation.pngbin0 -> 315 bytes
-rw-r--r--src/kile/symbols/relation/img102relation.pngbin0 -> 319 bytes
-rw-r--r--src/kile/symbols/relation/img103relation.pngbin0 -> 316 bytes
-rw-r--r--src/kile/symbols/relation/img104relation.pngbin0 -> 312 bytes
-rw-r--r--src/kile/symbols/relation/img105relation.pngbin0 -> 340 bytes
-rw-r--r--src/kile/symbols/relation/img106relation.pngbin0 -> 339 bytes
-rw-r--r--src/kile/symbols/relation/img107relation.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/relation/img108relation.pngbin0 -> 270 bytes
-rw-r--r--src/kile/symbols/relation/img109relation.pngbin0 -> 309 bytes
-rw-r--r--src/kile/symbols/relation/img110relation.pngbin0 -> 308 bytes
-rw-r--r--src/kile/symbols/relation/img111relation.pngbin0 -> 274 bytes
-rw-r--r--src/kile/symbols/relation/img112relation.pngbin0 -> 279 bytes
-rw-r--r--src/kile/symbols/relation/img113relation.pngbin0 -> 330 bytes
-rw-r--r--src/kile/symbols/relation/img114relation.pngbin0 -> 326 bytes
-rw-r--r--src/kile/symbols/relation/img115relation.pngbin0 -> 262 bytes
-rw-r--r--src/kile/symbols/relation/img116relation.pngbin0 -> 270 bytes
-rw-r--r--src/kile/symbols/relation/img117relation.pngbin0 -> 242 bytes
-rw-r--r--src/kile/symbols/relation/img118relation.pngbin0 -> 236 bytes
-rw-r--r--src/kile/symbols/relation/img119relation.pngbin0 -> 238 bytes
-rw-r--r--src/kile/symbols/relation/img120relation.pngbin0 -> 226 bytes
-rw-r--r--src/kile/symbols/relation/img121relation.pngbin0 -> 278 bytes
-rw-r--r--src/kile/symbols/relation/img122relation.pngbin0 -> 268 bytes
-rw-r--r--src/kile/symbols/relation/img123relation.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/relation/img124relation.pngbin0 -> 277 bytes
-rw-r--r--src/kile/symbols/relation/img125relation.pngbin0 -> 313 bytes
-rw-r--r--src/kile/symbols/relation/img126relation.pngbin0 -> 314 bytes
-rw-r--r--src/kile/symbols/relation/img127relation.pngbin0 -> 263 bytes
-rw-r--r--src/kile/symbols/relation/img128relation.pngbin0 -> 251 bytes
-rw-r--r--src/kile/symbols/relation/img129relation.pngbin0 -> 307 bytes
-rw-r--r--src/kile/symbols/relation/img130relation.pngbin0 -> 299 bytes
-rw-r--r--src/kile/symbols/relation/img131relation.pngbin0 -> 334 bytes
-rw-r--r--src/kile/symbols/relation/img132relation.pngbin0 -> 324 bytes
-rw-r--r--src/kile/symbols/relation/img133relation.pngbin0 -> 260 bytes
-rw-r--r--src/kile/symbols/relation/img134relation.pngbin0 -> 273 bytes
-rw-r--r--src/kile/symbols/relation/img135relation.pngbin0 -> 263 bytes
-rw-r--r--src/kile/symbols/relation/img136relation.pngbin0 -> 187 bytes
-rw-r--r--src/kile/symbols/relation/img137relation.pngbin0 -> 186 bytes
-rw-r--r--src/kile/symbols/relation/img138relation.pngbin0 -> 182 bytes
-rw-r--r--src/kile/symbols/relation/img139relation.pngbin0 -> 180 bytes
-rw-r--r--src/kile/symbols/special.tex196
-rw-r--r--src/kile/symbols/special/CMakeLists.txt184
-rw-r--r--src/kile/symbols/special/Makefile.am179
-rw-r--r--src/kile/symbols/special/img001special.pngbin0 -> 311 bytes
-rw-r--r--src/kile/symbols/special/img002special.pngbin0 -> 315 bytes
-rw-r--r--src/kile/symbols/special/img003special.pngbin0 -> 305 bytes
-rw-r--r--src/kile/symbols/special/img004special.pngbin0 -> 306 bytes
-rw-r--r--src/kile/symbols/special/img005special.pngbin0 -> 312 bytes
-rw-r--r--src/kile/symbols/special/img006special.pngbin0 -> 307 bytes
-rw-r--r--src/kile/symbols/special/img007special.pngbin0 -> 309 bytes
-rw-r--r--src/kile/symbols/special/img008special.pngbin0 -> 313 bytes
-rw-r--r--src/kile/symbols/special/img009special.pngbin0 -> 304 bytes
-rw-r--r--src/kile/symbols/special/img010special.pngbin0 -> 306 bytes
-rw-r--r--src/kile/symbols/special/img011special.pngbin0 -> 329 bytes
-rw-r--r--src/kile/symbols/special/img012special.pngbin0 -> 313 bytes
-rw-r--r--src/kile/symbols/special/img013special.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/special/img014special.pngbin0 -> 288 bytes
-rw-r--r--src/kile/symbols/special/img015special.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/special/img016special.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/special/img017special.pngbin0 -> 287 bytes
-rw-r--r--src/kile/symbols/special/img018special.pngbin0 -> 285 bytes
-rw-r--r--src/kile/symbols/special/img019special.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/special/img020special.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/special/img021special.pngbin0 -> 277 bytes
-rw-r--r--src/kile/symbols/special/img022special.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/special/img023special.pngbin0 -> 298 bytes
-rw-r--r--src/kile/symbols/special/img024special.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/special/img025special.pngbin0 -> 305 bytes
-rw-r--r--src/kile/symbols/special/img026special.pngbin0 -> 310 bytes
-rw-r--r--src/kile/symbols/special/img027special.pngbin0 -> 309 bytes
-rw-r--r--src/kile/symbols/special/img028special.pngbin0 -> 277 bytes
-rw-r--r--src/kile/symbols/special/img029special.pngbin0 -> 278 bytes
-rw-r--r--src/kile/symbols/special/img030special.pngbin0 -> 277 bytes
-rw-r--r--src/kile/symbols/special/img031special.pngbin0 -> 295 bytes
-rw-r--r--src/kile/symbols/special/img032special.pngbin0 -> 302 bytes
-rw-r--r--src/kile/symbols/special/img033special.pngbin0 -> 302 bytes
-rw-r--r--src/kile/symbols/special/img034special.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/special/img035special.pngbin0 -> 288 bytes
-rw-r--r--src/kile/symbols/special/img036special.pngbin0 -> 304 bytes
-rw-r--r--src/kile/symbols/special/img037special.pngbin0 -> 298 bytes
-rw-r--r--src/kile/symbols/special/img038special.pngbin0 -> 304 bytes
-rw-r--r--src/kile/symbols/special/img039special.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/special/img040special.pngbin0 -> 292 bytes
-rw-r--r--src/kile/symbols/special/img041special.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/special/img042special.pngbin0 -> 294 bytes
-rw-r--r--src/kile/symbols/special/img043special.pngbin0 -> 299 bytes
-rw-r--r--src/kile/symbols/special/img044special.pngbin0 -> 299 bytes
-rw-r--r--src/kile/symbols/special/img045special.pngbin0 -> 290 bytes
-rw-r--r--src/kile/symbols/special/img046special.pngbin0 -> 316 bytes
-rw-r--r--src/kile/symbols/special/img047special.pngbin0 -> 275 bytes
-rw-r--r--src/kile/symbols/special/img048special.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/special/img049special.pngbin0 -> 273 bytes
-rw-r--r--src/kile/symbols/special/img050special.pngbin0 -> 276 bytes
-rw-r--r--src/kile/symbols/special/img051special.pngbin0 -> 275 bytes
-rw-r--r--src/kile/symbols/special/img052special.pngbin0 -> 280 bytes
-rw-r--r--src/kile/symbols/special/img053special.pngbin0 -> 276 bytes
-rw-r--r--src/kile/symbols/special/img054special.pngbin0 -> 274 bytes
-rw-r--r--src/kile/symbols/special/img055special.pngbin0 -> 275 bytes
-rw-r--r--src/kile/symbols/special/img056special.pngbin0 -> 293 bytes
-rw-r--r--src/kile/symbols/special/img057special.pngbin0 -> 318 bytes
-rw-r--r--src/kile/symbols/special/img058special.pngbin0 -> 314 bytes
-rw-r--r--src/kile/symbols/special/img059special.pngbin0 -> 312 bytes
-rw-r--r--src/kile/symbols/special/img060special.pngbin0 -> 306 bytes
-rw-r--r--src/kile/symbols/special/img061special.pngbin0 -> 227 bytes
-rw-r--r--src/kile/symbols/special/img062special.pngbin0 -> 253 bytes
-rw-r--r--src/kile/symbols/special/img063special.pngbin0 -> 225 bytes
-rw-r--r--src/kile/symbols/special/img064special.pngbin0 -> 227 bytes
-rw-r--r--src/kile/symbols/special/img065special.pngbin0 -> 229 bytes
-rw-r--r--src/kile/symbols/special/img066special.pngbin0 -> 229 bytes
-rw-r--r--src/kile/symbols/special/img067special.pngbin0 -> 207 bytes
-rw-r--r--src/kile/symbols/special/img068special.pngbin0 -> 261 bytes
-rw-r--r--src/kile/symbols/special/img069special.pngbin0 -> 222 bytes
-rw-r--r--src/kile/symbols/special/img070special.pngbin0 -> 246 bytes
-rw-r--r--src/kile/symbols/special/img071special.pngbin0 -> 220 bytes
-rw-r--r--src/kile/symbols/special/img072special.pngbin0 -> 229 bytes
-rw-r--r--src/kile/symbols/special/img073special.pngbin0 -> 246 bytes
-rw-r--r--src/kile/symbols/special/img074special.pngbin0 -> 238 bytes
-rw-r--r--src/kile/symbols/special/img075special.pngbin0 -> 208 bytes
-rw-r--r--src/kile/symbols/special/img076special.pngbin0 -> 251 bytes
-rw-r--r--src/kile/symbols/special/img077special.pngbin0 -> 306 bytes
-rw-r--r--src/kile/symbols/special/img078special.pngbin0 -> 284 bytes
-rw-r--r--src/kile/symbols/special/img079special.pngbin0 -> 256 bytes
-rw-r--r--src/kile/symbols/special/img080special.pngbin0 -> 255 bytes
-rw-r--r--src/kile/symbols/special/img081special.pngbin0 -> 264 bytes
-rw-r--r--src/kile/symbols/special/img082special.pngbin0 -> 259 bytes
-rw-r--r--src/kile/symbols/special/img083special.pngbin0 -> 257 bytes
-rw-r--r--src/kile/symbols/special/img084special.pngbin0 -> 232 bytes
-rw-r--r--src/kile/symbols/special/img085special.pngbin0 -> 216 bytes
-rw-r--r--src/kile/symbols/special/img086special.pngbin0 -> 233 bytes
-rw-r--r--src/kile/symbols/special/img087special.pngbin0 -> 232 bytes
-rw-r--r--src/kile/symbols/special/img088special.pngbin0 -> 207 bytes
-rw-r--r--src/kile/symbols/special/img089special.pngbin0 -> 311 bytes
-rw-r--r--src/kile/symbols/special/img090special.pngbin0 -> 302 bytes
-rw-r--r--src/kile/symbols/special/img091special.pngbin0 -> 310 bytes
-rw-r--r--src/kile/symbols/special/img092special.pngbin0 -> 306 bytes
-rw-r--r--src/kile/symbols/special/img093special.pngbin0 -> 311 bytes
-rw-r--r--src/kile/symbols/special/img094special.pngbin0 -> 295 bytes
-rw-r--r--src/kile/symbols/special/img095special.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/special/img096special.pngbin0 -> 258 bytes
-rw-r--r--src/kile/symbols/special/img097special.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/special/img098special.pngbin0 -> 257 bytes
-rw-r--r--src/kile/symbols/special/img099special.pngbin0 -> 256 bytes
-rw-r--r--src/kile/symbols/special/img100special.pngbin0 -> 264 bytes
-rw-r--r--src/kile/symbols/special/img101special.pngbin0 -> 318 bytes
-rw-r--r--src/kile/symbols/special/img102special.pngbin0 -> 322 bytes
-rw-r--r--src/kile/symbols/special/img103special.pngbin0 -> 314 bytes
-rw-r--r--src/kile/symbols/special/img104special.pngbin0 -> 317 bytes
-rw-r--r--src/kile/symbols/special/img105special.pngbin0 -> 322 bytes
-rw-r--r--src/kile/symbols/special/img106special.pngbin0 -> 318 bytes
-rw-r--r--src/kile/symbols/special/img107special.pngbin0 -> 320 bytes
-rw-r--r--src/kile/symbols/special/img108special.pngbin0 -> 322 bytes
-rw-r--r--src/kile/symbols/special/img109special.pngbin0 -> 313 bytes
-rw-r--r--src/kile/symbols/special/img110special.pngbin0 -> 318 bytes
-rw-r--r--src/kile/symbols/special/img111special.pngbin0 -> 329 bytes
-rw-r--r--src/kile/symbols/special/img112special.pngbin0 -> 345 bytes
-rw-r--r--src/kile/symbols/special/img113special.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/special/img114special.pngbin0 -> 289 bytes
-rw-r--r--src/kile/symbols/special/img115special.pngbin0 -> 279 bytes
-rw-r--r--src/kile/symbols/special/img116special.pngbin0 -> 279 bytes
-rw-r--r--src/kile/symbols/special/img117special.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/special/img118special.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/special/img119special.pngbin0 -> 282 bytes
-rw-r--r--src/kile/symbols/special/img120special.pngbin0 -> 282 bytes
-rw-r--r--src/kile/symbols/special/img121special.pngbin0 -> 277 bytes
-rw-r--r--src/kile/symbols/special/img122special.pngbin0 -> 288 bytes
-rw-r--r--src/kile/symbols/special/img123special.pngbin0 -> 296 bytes
-rw-r--r--src/kile/symbols/special/img124special.pngbin0 -> 312 bytes
-rw-r--r--src/kile/symbols/special/img125special.pngbin0 -> 269 bytes
-rw-r--r--src/kile/symbols/special/img126special.pngbin0 -> 292 bytes
-rw-r--r--src/kile/symbols/special/img127special.pngbin0 -> 309 bytes
-rw-r--r--src/kile/symbols/special/img128special.pngbin0 -> 304 bytes
-rw-r--r--src/kile/symbols/special/img129special.pngbin0 -> 308 bytes
-rw-r--r--src/kile/symbols/special/img130special.pngbin0 -> 256 bytes
-rw-r--r--src/kile/symbols/special/img131special.pngbin0 -> 243 bytes
-rw-r--r--src/kile/symbols/special/img132special.pngbin0 -> 253 bytes
-rw-r--r--src/kile/symbols/special/img133special.pngbin0 -> 307 bytes
-rw-r--r--src/kile/symbols/special/img134special.pngbin0 -> 345 bytes
-rw-r--r--src/kile/symbols/special/img135special.pngbin0 -> 303 bytes
-rw-r--r--src/kile/symbols/special/img136special.pngbin0 -> 307 bytes
-rw-r--r--src/kile/symbols/special/img137special.pngbin0 -> 274 bytes
-rw-r--r--src/kile/symbols/special/img138special.pngbin0 -> 320 bytes
-rw-r--r--src/kile/symbols/special/img139special.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/special/img140special.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/special/img141special.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/special/img142special.pngbin0 -> 269 bytes
-rw-r--r--src/kile/symbols/special/img143special.pngbin0 -> 300 bytes
-rw-r--r--src/kile/symbols/special/img144special.pngbin0 -> 272 bytes
-rw-r--r--src/kile/symbols/special/img145special.pngbin0 -> 287 bytes
-rw-r--r--src/kile/symbols/special/img146special.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/special/img147special.pngbin0 -> 290 bytes
-rw-r--r--src/kile/symbols/special/img148special.pngbin0 -> 259 bytes
-rw-r--r--src/kile/symbols/special/img149special.pngbin0 -> 261 bytes
-rw-r--r--src/kile/symbols/special/img150special.pngbin0 -> 281 bytes
-rw-r--r--src/kile/symbols/special/img151special.pngbin0 -> 286 bytes
-rw-r--r--src/kile/symbols/special/img152special.pngbin0 -> 276 bytes
-rw-r--r--src/kile/symbols/special/img153special.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/special/img154special.pngbin0 -> 283 bytes
-rw-r--r--src/kile/symbols/special/img155special.pngbin0 -> 278 bytes
-rw-r--r--src/kile/symbols/special/img156special.pngbin0 -> 274 bytes
-rw-r--r--src/kile/symbols/special/img157special.pngbin0 -> 282 bytes
-rw-r--r--src/kile/symbols/special/img158special.pngbin0 -> 303 bytes
-rw-r--r--src/kile/symbols/special/img159special.pngbin0 -> 268 bytes
-rw-r--r--src/kile/symbols/special/img160special.pngbin0 -> 276 bytes
-rw-r--r--src/kile/symbols/special/img161special.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/special/img162special.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/special/img163special.pngbin0 -> 276 bytes
-rw-r--r--src/kile/symbols/special/img164special.pngbin0 -> 265 bytes
-rw-r--r--src/kile/symbols/special/img165special.pngbin0 -> 257 bytes
-rw-r--r--src/kile/symbols/special/img166special.pngbin0 -> 264 bytes
-rw-r--r--src/kile/symbols/special/img167special.pngbin0 -> 294 bytes
-rw-r--r--src/kile/symbols/special/img168special.pngbin0 -> 299 bytes
-rw-r--r--src/kile/symbols/special/img169special.pngbin0 -> 292 bytes
-rw-r--r--src/kile/symbols/special/img170special.pngbin0 -> 298 bytes
-rw-r--r--src/kile/symbols/special/img171special.pngbin0 -> 297 bytes
-rw-r--r--src/kile/symbols/special/img172special.pngbin0 -> 297 bytes
-rw-r--r--src/kile/symbols/special/img173special.pngbin0 -> 300 bytes
-rw-r--r--src/kile/symbols/special/img174special.pngbin0 -> 307 bytes
-rw-r--r--src/kile/symbols/special/img175special.pngbin0 -> 266 bytes
-rw-r--r--src/kile/symbols/special/img176special.pngbin0 -> 267 bytes
-rw-r--r--src/kile/symbols/special/img177special.pngbin0 -> 275 bytes
-rw-r--r--src/kile/symbols/symbols.kilepr124
-rw-r--r--src/kile/symbols/testfile.tex57
-rw-r--r--src/kile/symbolview.cpp385
-rw-r--r--src/kile/symbolview.h61
-rw-r--r--src/kile/symbolviewconfig.ui142
-rw-r--r--src/kile/syntax/CMakeLists.txt4
-rw-r--r--src/kile/syntax/Makefile.am3
-rw-r--r--src/kile/syntax/bibtex.xml65
-rw-r--r--src/kile/syntax/latex.xml406
-rw-r--r--src/kile/tabbingdialog.cpp102
-rw-r--r--src/kile/tabbingdialog.h52
-rw-r--r--src/kile/tabulardialog.cpp2554
-rw-r--r--src/kile/tabulardialog.h296
-rw-r--r--src/kile/templates.cpp385
-rw-r--r--src/kile/templates.h164
-rw-r--r--src/kile/templates/CMakeLists.txt4
-rw-r--r--src/kile/templates/Makefile.am3
-rw-r--r--src/kile/templates/template_Article.tex18
-rw-r--r--src/kile/templates/template_Beamer.tex8
-rw-r--r--src/kile/templates/template_Book.tex6
-rw-r--r--src/kile/templates/template_HA-prosper.tex8
-rw-r--r--src/kile/templates/template_Letter.tex25
-rw-r--r--src/kile/templates/template_Prosper.tex7
-rw-r--r--src/kile/templates/template_Report.tex15
-rw-r--r--src/kile/templates/template_Scrartcl.tex18
-rw-r--r--src/kile/templates/template_Scrbook.tex6
-rw-r--r--src/kile/templates/template_Scrlttr2.tex25
-rw-r--r--src/kile/templates/template_Scrreprt.tex15
-rw-r--r--src/kile/test/CMakeLists.txt13
-rw-r--r--src/kile/test/Makefile.am3
-rwxr-xr-xsrc/kile/test/runTests.sh209
-rw-r--r--src/kile/test/test.bib6
-rw-r--r--src/kile/test/test.tex4
-rw-r--r--src/kile/test/test_bib.tex6
-rw-r--r--src/kile/test/test_index.tex7
-rw-r--r--src/kile/test/test_plain.tex2
-rw-r--r--src/kile/texdocdialog.cpp660
-rw-r--r--src/kile/texdocdialog.h99
-rw-r--r--src/kile/tips87
-rw-r--r--src/kile/toolconfigwidget.ui627
-rw-r--r--src/kile/userhelp.cpp312
-rw-r--r--src/kile/userhelp.h71
-rw-r--r--src/kile/userhelpdialog.cpp467
-rw-r--r--src/kile/userhelpdialog.h86
-rw-r--r--src/kile/usermenudialog.cpp179
-rw-r--r--src/kile/usermenudialog.h73
1585 files changed, 68186 insertions, 0 deletions
diff --git a/src/kile/CMakeLists.txt b/src/kile/CMakeLists.txt
new file mode 100644
index 0000000..e5734c4
--- /dev/null
+++ b/src/kile/CMakeLists.txt
@@ -0,0 +1,162 @@
+ADD_SUBDIRECTORY( icons )
+ADD_SUBDIRECTORY( pics )
+ADD_SUBDIRECTORY( symbols )
+ADD_SUBDIRECTORY( templates )
+ADD_SUBDIRECTORY( syntax )
+ADD_SUBDIRECTORY( complete )
+ADD_SUBDIRECTORY( help )
+ADD_SUBDIRECTORY( encodings )
+ADD_SUBDIRECTORY( test )
+
+INCLUDE( KDE3Macros )
+INCLUDE( FindPerl )
+
+INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${KDE3_INCLUDE_DIR} ${QT_INCLUDE_DIR} )
+
+########### next target ###############
+
+
+# taken from KDE4's KJS CMakeLists.txt file
+
+SET(CREATE_HASH_TABLE ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table )
+
+MACRO(CREATE_LUT _srcs_LIST _in_FILE _out_FILE _dep_FILE)
+ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_out_FILE}
+ COMMAND ${PERL_EXECUTABLE} ${CREATE_HASH_TABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${_in_FILE} > ${CMAKE_CURRENT_BINARY_DIR}/${_out_FILE}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_in_FILE} )
+ SET( ${_srcs_LIST} ${${_srcs_LIST}} ${CMAKE_CURRENT_BINARY_DIR}/${_out_FILE})
+ENDMACRO(CREATE_LUT)
+
+CREATE_LUT(kile_SRCS kilejscript.cpp kilejscript.lut.h kilejscript.cpp)
+
+SET(kile_SRCS
+ ${kile_SRCS}
+ latexcmd.cpp
+ latexcmddialog.cpp
+ texdocdialog.cpp
+ userhelp.cpp
+ userhelpdialog.cpp
+ floatdialog.cpp
+ mathenvdialog.cpp
+ tabulardialog.cpp
+ postscriptdialog.cpp
+ previewconfigwidget.cpp
+ quickpreview.cpp
+ includegraphicsdialog.cpp
+ newfilewizard.cpp
+ managetemplatesdialog.cpp
+ templates.cpp
+ usermenudialog.cpp
+ kileconfigdialog.cpp
+ tabbingdialog.cpp
+ symbolview.cpp
+ quickdocumentdialog.cpp
+ kilefileselect.cpp
+ kileapplication.cpp
+ docpart.cpp
+ kile.cpp
+ main.cpp
+ kileactions.cpp
+ kilestdactions.cpp
+ kileinfo.cpp
+ kiledocumentinfo.cpp
+ kileproject.cpp
+ kileprojectdlgs.cpp
+ kileprojectview.cpp
+ kilelistselector.cpp
+ kilelyxserver.cpp
+ latexoutputfilter.cpp
+ outputinfo.cpp
+ latexoutputinfo.cpp
+ outputfilter.cpp
+ kilegrepdialog.cpp
+ kiletool.cpp
+ kilelauncher.cpp
+ kiletoolmanager.cpp
+ kilestdtools.cpp
+ kilelogwidget.cpp
+ kileoutputwidget.cpp
+ kilekonsolewidget.cpp
+ kilewizard.cpp
+ kilestructurewidget.cpp
+ codecompletion.cpp
+ configcodecompletion.cpp
+ kiletoolconfigwidget.cpp
+ kileedit.cpp
+ cleandialog.cpp
+ kilehelp.cpp
+ configstructure.cpp
+ convert.cpp
+ kiledocmanager.cpp
+ kileviewmanager.cpp
+ kileeventfilter.cpp
+ kileerrorhandler.cpp
+ configcheckerdlg.cpp
+ configtester.cpp
+ kilesidebar.cpp
+ plaintolatexconverter.cpp
+ kileuntitled.cpp
+ kilestatsdlg.cpp
+ kilestatswidget.cpp
+ previewwidget.cpp
+ kilejscript.h
+ kilejscript.cpp
+ scriptsmanagementwidget.h
+ scriptsmanagementwidget.cpp
+ editorkeysequencemanager.h
+ editorkeysequencemanager.cpp
+ kileversion.cpp
+ kileabbrevview.cpp
+ kileextensions.cpp
+ kilemultitabbar.cpp
+)
+
+KDE3_AUTOMOC(${kile_SRCS})
+
+SET( kile_UI
+ helpconfigwidget.ui
+ latexconfigwidget.ui
+ generalconfigwidget.ui
+ configcheckerwidget.ui
+ toolconfigwidget.ui
+ librarytoolconfigwidget.ui
+ processtoolconfigwidget.ui
+ quicktoolconfigwidget.ui
+ latextoolconfigwidget.ui
+ newtoolwizard.ui
+ envconfigwidget.ui
+ structureconfigwidget.ui
+ symbolviewconfig.ui
+ scriptingconfigwidget.ui
+ graphicsconfigwidget.ui
+ newdocumentwidget.ui
+)
+
+KDE3_ADD_UI_FILES(kile_SRCS ${kile_UI} )
+
+SET( kile_DCOP_SKEL_SRCS
+ kileappIface.h
+)
+
+KDE3_ADD_DCOP_SKELS(kile_SRCS ${kile_DCOP_SKEL_SRCS})
+
+SET( kile_KCFG_SRCS
+ kileconfig.kcfgc
+)
+
+KDE3_ADD_KCFG_FILES(kile_SRCS ${kile_KCFG_SRCS})
+
+KDE3_ADD_EXECUTABLE(kile ${kile_SRCS})
+
+TARGET_LINK_LIBRARIES(kile ${QT_AND_KDECORE_LIBS} kjs kdeprint ktexteditor katepartinterfaces khtml )
+
+INSTALL( TARGETS kile DESTINATION bin )
+
+
+########### install files ###############
+
+INSTALL( FILES kile.desktop DESTINATION share/applications/kde )
+INSTALL( FILES kile.kcfg DESTINATION share/config.kcfg )
+INSTALL( FILES kileui.rc docpartui.rc kilestdtools.rc tips DESTINATION share/apps/kile )
+
+KDE3_INSTALL_ICONS( hicolor )
diff --git a/src/kile/Makefile.am b/src/kile/Makefile.am
new file mode 100644
index 0000000..5ef0fe5
--- /dev/null
+++ b/src/kile/Makefile.am
@@ -0,0 +1,116 @@
+####### kdevelop will overwrite this part!!! (begin)##########
+bin_PROGRAMS = kile
+
+## INCLUDES were found outside kdevelop specific part
+
+
+kile_SOURCES = latexcmd.cpp latexcmddialog.cpp texdocdialog.cpp userhelp.cpp \
+ userhelpdialog.cpp floatdialog.cpp mathenvdialog.cpp tabulardialog.cpp \
+ postscriptdialog.cpp previewconfigwidget.cpp quickpreview.cpp includegraphicsdialog.cpp \
+ newfilewizard.cpp managetemplatesdialog.cpp templates.cpp usermenudialog.cpp \
+ kileconfigdialog.cpp tabbingdialog.cpp symbolview.cpp quickdocumentdialog.cpp \
+ kilefileselect.cpp kileapplication.cpp docpart.cpp kile.cpp main.cpp kileactions.cpp \
+ kilestdactions.cpp kileinfo.cpp kiledocumentinfo.cpp kileproject.cpp kileprojectdlgs.cpp \
+ kileprojectview.cpp kilelistselector.cpp kilelyxserver.cpp latexoutputfilter.cpp \
+ outputinfo.cpp latexoutputinfo.cpp outputfilter.cpp kilegrepdialog.cpp kiletool.cpp \
+ kilelauncher.cpp kiletoolmanager.cpp kilestdtools.cpp kilelogwidget.cpp \
+ kileoutputwidget.cpp kilekonsolewidget.cpp kilewizard.cpp kilestructurewidget.cpp \
+ codecompletion.cpp configcodecompletion.cpp kiletoolconfigwidget.cpp kileedit.cpp \
+ cleandialog.cpp kilehelp.cpp configstructure.cpp kileappIface.skel convert.cpp \
+ helpconfigwidget.ui kiledocmanager.cpp kileviewmanager.cpp kileeventfilter.cpp \
+ latexconfigwidget.ui kileconfig.kcfgc generalconfigwidget.ui kileerrorhandler.cpp \
+ configcheckerdlg.cpp configcheckerwidget.ui configtester.cpp kilesidebar.cpp \
+ toolconfigwidget.ui librarytoolconfigwidget.ui processtoolconfigwidget.ui \
+ quicktoolconfigwidget.ui plaintolatexconverter.cpp latextoolconfigwidget.ui newtoolwizard.ui \
+ kileuntitled.cpp kilestatsdlg.cpp kilestatswidget.cpp envconfigwidget.ui \
+ structureconfigwidget.ui previewwidget.cpp kilejscript.h kilejscript.cpp \
+ scriptsmanagementwidget.h scriptsmanagementwidget.cpp editorkeysequencemanager.h \
+ editorkeysequencemanager.cpp scriptingconfigwidget.ui kileabbrevview.cpp kileextensions.cpp \
+ kileversion.cpp graphicsconfigwidget.ui kilemultitabbar.cpp newdocumentwidget.ui\
+ symbolviewconfig.ui
+
+kile_LDADD = -lkjs -lkdeprint -lktexteditor -lkatepartinterfaces $(LIB_KSPELL) $(LIB_KHTML)
+
+SUBDIRS = icons pics symbols templates syntax complete help encodings test
+
+EXTRA_DIST = main.cpp kile.cpp kile.h \
+ docpart.cpp docpart.h kileappIface.h kileapplication.cpp kileapplication.h kile.desktop kilefileselect.cpp kilefileselect.h kileui.rc docpartui.rc kmultiverttabbar.cpp kmultiverttabbar.h letterdialog.cpp letterdialog.h quickdocumentdialog.cpp quickdocumentdialog.h symbolview.cpp symbolview.h tabbingdialog.cpp tabbingdialog.h \
+ kileconfigdialog.cpp kileconfigdialog.h usermenudialog.cpp \
+ usermenudialog.h kileabbrevview.cpp kileabbrevview.h \
+ newfilewizard.cpp newfilewizard.h templates.cpp templates.h managetemplatesdialog.cpp \
+ managetemplatesdialog.h kileinfo.h kileinfo.cpp kilestdactions.cpp \
+ kilestdactions.h kileproject.h kileproject.cpp kileprojectdlgs.cpp \
+ kileprojectdlgs.h kileprojectview.cpp kileprojectview.h \
+ kilelistselector.cpp kilelistselector.h kilelyxserver.cpp kilelyxserver.h \
+ latexoutputfilter.cpp outputinfo.cpp latexoutputinfo.cpp \
+ outputfilter.cpp latexoutputfilter.h outputinfo.h latexoutputinfo.h \
+ includegraphicsdialog.h includegraphicsdialog.cpp kiletoolconfigwidget.cpp kiletoolconfigwidget.h outputfilter.h kilegrepdialog.cpp kilegrepdialog.h codecompletion.h codecompletion.cpp configcodecompletion.cpp configcodecompletion.h kileedit.cpp cleandialog.cpp kileedit.h cleandialog.h kilehelp.cpp kilehelp.h configstructure.cpp configstructure.h configenvironment.h convert.h convert.cpp \
+ kileconstants.h kilejscript.h kilejscript.cpp scriptsmanagementwidget.h scriptsmanagementwidget.cpp editorkeysequencemanager.h editorkeysequencemanager.cpp kilemultitabbar.cpp kilemultitabbar.h kilemultitabbar_p.h
+
+xdg_apps_DATA = kile.desktop
+
+kde_kcfg_DATA = kile.kcfg
+
+KDE_ICON = AUTO
+
+####### kdevelop will overwrite this part!!! (end)############
+# These paths are KDE specific. Use them:
+# kde_appsdir Where your application's menu entry (.desktop) should go to.
+# kde_icondir Where your icon should go to - better use KDE_ICON.
+# kde_sounddir Where your sounds should go to.
+# kde_htmldir Where your docs should go to. (contains lang subdirs)
+# kde_datadir Where you install application data. (Use a subdir)
+# kde_locale Where translation files should go to. (contains lang subdirs)
+# kde_cgidir Where cgi-bin executables should go to.
+# kde_confdir Where config files should go to (system-wide ones with default values).
+# kde_mimedir Where mimetypes .desktop files should go to.
+# kde_servicesdir Where services .desktop files should go to.
+# kde_servicetypesdir Where servicetypes .desktop files should go to.
+# kde_toolbardir Where general toolbar icons should go to (deprecated, use KDE_ICON).
+# kde_wallpaperdir Where general wallpapers should go to.
+# kde_templatesdir Where templates for the "New" menu (Konqueror/KDesktop) should go to.
+# kde_bindir Where executables should go to. Use bin_PROGRAMS or bin_SCRIPTS.
+# kde_libdir Where shared libraries should go to. Use lib_LTLIBRARIES.
+# kde_moduledir Where modules (e.g. parts) should go to. Use kde_module_LTLIBRARIES.
+# kde_styledir Where Qt/KDE widget styles should go to (new in KDE 3).
+# kde_designerdir Where Qt Designer plugins should go to (new in KDE 3).
+
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+METASOURCES = AUTO
+
+# the library search path.
+kile_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+
+rcdir = $(kde_datadir)/kile
+rc_DATA = kileui.rc docpartui.rc kilestdtools.rc tips
+
+messages: rc.cpp
+ $(PREPARETIPS) > tips.txt
+ LIST=`find . -name \*.h -o -name \*.txt -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
+ if test -n "$$LIST"; then \
+ $(XGETTEXT) $$LIST -o $(podir)/kile.pot; \
+ fi
+ rm -f tips.txt
+
+syntaxdir = $(kde_appsdir)/katepart/syntax
+noinst_HEADERS = kilestatsdlg.h configcheckerdlg.h configtester.h convert.h \
+ envconfigwidget.h kileconstants.h kiledebug.h kiledocmanager.h kileerrorhandler.h \
+ kileeventfilter.h kilekonsolewidget.h kilelauncher.h kilelogwidget.h kilemultitabbar.h \
+ kilemultitabbar_p.h kileoutputwidget.h kilesidebar.h kilestatswidget.h kilestdtools.h \
+ kilestructurewidget.h kiletool.h kiletool_enums.h kiletoolmanager.h kileuntitled.h \
+ kileversion.h kileviewmanager.h kilewizard.h latexconfigwidget.h \
+ plaintolatexconverter.h structureconfigwidget.h
+
+CREATE_HASH_TABLE = $(srcdir)/create_hash_table
+
+kilejscript.lut.h : $(srcdir)/kilejscript.cpp $(CREATE_HASH_TABLE)
+ $(PERL) $(CREATE_HASH_TABLE) $(srcdir)/kilejscript.cpp > $@
+kilejscript.lo: kilejscript.lut.h
+
+kilejscript.o: kilejscript.lut.h
+
+LUT_FILES = kilejscript.lut.h
+
+CLEANFILES = $(LUT_FILES)
diff --git a/src/kile/cleandialog.cpp b/src/kile/cleandialog.cpp
new file mode 100644
index 0000000..05cceb6
--- /dev/null
+++ b/src/kile/cleandialog.cpp
@@ -0,0 +1,96 @@
+/***************************************************************************
+ date : Jan 22 2004
+ version : 0.10
+ copyright : (C) 2004 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "cleandialog.h"
+
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kpushbutton.h>
+#include <klistview.h>
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qpixmap.h>
+#include <qfileinfo.h>
+
+#include "kiledebug.h"
+
+namespace KileDialog
+{
+ Clean::Clean(QWidget *parent, const QString & filename, const QStringList & extlist) :
+ KDialogBase( KDialogBase::Plain, i18n("Delete Files"), Ok | Cancel, Ok, parent, 0, true, true),
+ m_extlist(extlist)
+ {
+ // Layout
+ QVBoxLayout *vbox = new QVBoxLayout(plainPage(), 6,6 );
+
+ // label widgets
+ QWidget *labelwidget = new QWidget(plainPage());
+ QHBoxLayout *labellayout = new QHBoxLayout(labelwidget);
+
+ // line 1: picture and label
+ QLabel *picture = new QLabel("", labelwidget);
+ picture->setPixmap( KGlobal::instance()->iconLoader()->loadIcon("messagebox_warning", KIcon::NoGroup, KIcon::SizeMedium) );
+ QLabel *label = new QLabel(i18n( "Do you really want to delete these files?" ), labelwidget);
+ labellayout->addWidget(picture);
+ labellayout->addSpacing(20);
+ labellayout->addWidget(label);
+
+ // line 2: listview
+ listview = new KListView(plainPage());
+ listview->addColumn(i18n("Files"));
+ listview->setSorting(-1);
+
+ // insert items into listview
+ QString base = QFileInfo(filename).baseName(true);
+ for (uint i=0; i < m_extlist.count(); ++i)
+ {
+ QCheckListItem *item = new QCheckListItem(listview, base + m_extlist[i], QCheckListItem::CheckBox);
+ item->setOn(true);
+ listview->insertItem(item);
+ }
+
+ vbox->addWidget(labelwidget,0,Qt::AlignHCenter);
+ vbox->addWidget(listview);
+ }
+
+ Clean::~Clean()
+ {}
+
+ // get all selected items
+
+ const QStringList & Clean::getCleanlist()
+ {
+ QStringList templist;
+
+ QCheckListItem *item = (QCheckListItem *)listview->firstChild();
+ int i = m_extlist.count() - 1;
+ while ( item )
+ {
+ if ( item->isOn() && item->text(0).endsWith(m_extlist[i]) )
+ templist.append(m_extlist[i]);
+
+ item = (QCheckListItem *)item->nextSibling();
+ --i;
+ }
+
+ m_extlist = templist;
+ return m_extlist;
+ }
+}
+
+#include "cleandialog.moc"
+
diff --git a/src/kile/cleandialog.h b/src/kile/cleandialog.h
new file mode 100644
index 0000000..18636e7
--- /dev/null
+++ b/src/kile/cleandialog.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ date : Jan 22 2004
+ version : 0.10
+ copyright : (C) 2004 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CLEANDIALOG_H
+#define CLEANDIALOG_H
+
+#include <kdialogbase.h>
+#include <qstringlist.h>
+
+class KListView;
+
+/**
+ *@author Holger Danielsson
+ */
+
+namespace KileDialog
+{
+ class Clean : public KDialogBase
+ {
+ Q_OBJECT
+
+ public:
+ Clean(QWidget *parent, const QString & filename, const QStringList &extlist);
+ ~Clean();
+ const QStringList & getCleanlist();
+
+ private:
+ KListView *listview;
+ QStringList m_extlist;
+ };
+}
+
+#endif
diff --git a/src/kile/codecompletion.cpp b/src/kile/codecompletion.cpp
new file mode 100644
index 0000000..ca34243
--- /dev/null
+++ b/src/kile/codecompletion.cpp
@@ -0,0 +1,1465 @@
+/***************************************************************************
+ date : Mar 21 2007
+ version : 0.40
+ copyright : (C) 2004-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "codecompletion.h"
+
+#include <qregexp.h>
+#include <qfile.h>
+#include <qtimer.h>
+#include <qdict.h>
+
+#include "kiledebug.h"
+#include <klocale.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include <kconfig.h>
+#include <kmessagebox.h>
+#include <ktexteditor/codecompletioninterface.h>
+
+#include "kileinfo.h"
+#include "kileviewmanager.h"
+#include "kileconfig.h"
+#include "kileedit.h"
+#include "kiledebug.h"
+
+namespace KileDocument
+{
+
+ static QRegExp::QRegExp reRef;
+ static QRegExp::QRegExp reRefExt;
+ static QRegExp::QRegExp reCite;
+ static QRegExp::QRegExp reCiteExt;
+ static QRegExp::QRegExp reNotRefChars("[^a-zA-Z0-9_@\\.\\+\\-\\*\\:]");
+ static QRegExp::QRegExp reNotCiteChars("[^a-zA-Z0-9_@\\-\\:]");
+
+ CodeCompletion::CodeCompletion(KileInfo *info) : m_ki(info), m_view(0L)
+ {
+ m_firstconfig = true;
+ m_inprogress = false;
+ m_undo = false;
+ m_ref = false;
+ m_kilecompletion = false;
+ m_keylistType = CodeCompletion::ctNone;
+
+ // local abbreviation list
+ m_abbrevListview = 0L;
+ m_localAbbrevFile = locateLocal("appdata", "complete/abbreviation/", true) + "kile-abbrevs.cwl";
+
+ //reRef.setPattern("^\\\\(pageref|ref|xyz)\\{");
+ m_completeTimer = new QTimer( this );
+ connect(m_completeTimer, SIGNAL( timeout() ), this, SLOT( slotCompleteValueList() ) );
+ }
+
+ CodeCompletion::~CodeCompletion() {}
+
+ bool CodeCompletion::isActive()
+ {
+ return m_isenabled;
+ }
+
+ bool CodeCompletion::inProgress()
+ {
+ return m_inprogress;
+ }
+
+ bool CodeCompletion::autoComplete()
+ {
+ return m_autocomplete || m_autocompletetext;
+ }
+
+ CodeCompletion::Type CodeCompletion::getType()
+ {
+ return m_type;
+ }
+
+ CodeCompletion::Type CodeCompletion::getType( const QString &text )
+ {
+ if ( text.find( reRef ) != -1 )
+ return CodeCompletion::ctReference;
+ else if ( text.find( reCite ) != -1 )
+ return CodeCompletion::ctCitation;
+ else
+ return CodeCompletion::ctNone;
+ }
+
+ CodeCompletion::Mode CodeCompletion::getMode()
+ {
+ return m_mode;
+ }
+
+ CodeCompletion::Type CodeCompletion::insideReference(QString &startpattern)
+ {
+ if ( m_view->getDoc() )
+ {
+ uint column = m_view->cursorColumnReal();
+ QString currentline = m_view->getDoc()->textLine(m_view->cursorLine()).left(column);
+ int pos = currentline.findRev('\\');
+ if ( pos >= 0 )
+ {
+ QString command = currentline.mid(pos,column-pos);
+ KILE_DEBUG() << "pos=" << pos << ",column=" << column << ",currentline=" << currentline << ",command=" << command << endl;
+
+ if( command.find(reRefExt) != -1 ){
+ KILE_DEBUG() << "reRefExt" << endl;
+ startpattern = command.right(command.length()-reRefExt.cap(0).length());
+ KILE_DEBUG() << "startpattern=" << startpattern << endl;
+ if ( startpattern.find(reNotRefChars) == -1 ){
+ return CodeCompletion::ctReference ;
+ }
+ }
+ else if ( command.find(reRef) != -1 ){
+ startpattern = command.right(command.length()-reRef.cap(0).length());
+ KILE_DEBUG() << "startpattern=" << startpattern << endl;
+ if ( startpattern.find(reNotRefChars) == -1 ){
+ return CodeCompletion::ctReference ;
+ }
+ }
+ else if( command.find(reCiteExt) != -1 ){
+ KILE_DEBUG() << "reCiteExt" << endl;
+ startpattern = command.right(command.length()-reCiteExt.cap(0).length());
+ KILE_DEBUG() << "startpattern=" << startpattern << endl;
+ if ( startpattern.find(reNotCiteChars) == -1 ){
+ return CodeCompletion::ctCitation;
+ }
+ }
+ else if ( command.find(reCite) != -1 ){
+ startpattern = command.right(command.length()-reCite.cap(0).length());
+ KILE_DEBUG() << "startpattern=" << startpattern << endl;
+ if ( startpattern.find(reNotCiteChars) == -1 ){
+ return CodeCompletion::ctCitation;
+ }
+ }
+ }
+ }
+ return CodeCompletion::ctNone;
+ }
+
+ //////////////////// configuration ////////////////////
+
+ void CodeCompletion::readConfig(KConfig *config)
+ {
+ KILE_DEBUG() << "=== CodeCompletion::readConfig ===================" << endl;
+
+ // save normal parameter
+ //KILE_DEBUG() << " read bool entries" << endl;
+ m_isenabled = KileConfig::completeEnabled();
+ m_setcursor = KileConfig::completeCursor();
+ m_setbullets = KileConfig::completeBullets();
+ m_closeenv = KileConfig::completeCloseEnv();
+ m_autocomplete = KileConfig::completeAuto();
+ m_autocompletetext = KileConfig::completeAutoText();
+ m_autocompleteabbrev = KileConfig::completeAutoAbbrev();
+ m_latexthreshold = KileConfig::completeAutoThreshold();
+ m_textthreshold = KileConfig::completeAutoTextThreshold();
+ m_citationMove = KileConfig::completeCitationMove();
+ m_autoDollar = KileConfig::autoInsertDollar();
+
+ // we need to read some of Kate's config flags
+ readKateConfigFlags(config);
+
+ // reading the wordlists is only necessary at the first start
+ // and when the list of files changes
+ if ( m_firstconfig || KileConfig::completeChangedLists() || KileConfig::completeChangedCommands() )
+ {
+ KILE_DEBUG() << " set regexp for references..." << endl;
+ setReferences();
+
+ KILE_DEBUG() << " read wordlists..." << endl;
+ // wordlists for Tex/Latex mode
+ QStringList files = KileConfig::completeTex();
+ setWordlist( files, "tex", &m_texlist );
+
+ // wordlist for dictionary mode
+ files = KileConfig::completeDict();
+ setWordlist( files, "dictionary", &m_dictlist );
+
+ // wordlist for abbreviation mode
+ files = KileConfig::completeAbbrev();
+ setWordlist( files, "abbreviation", &m_abbrevlist );
+
+ // remember changed lists
+ m_firstconfig = false;
+ KileConfig::setCompleteChangedLists(false);
+ KileConfig::setCompleteChangedCommands(false);
+ }
+ }
+
+ void CodeCompletion::readKateConfigFlags(KConfig *config)
+ {
+ config->setGroup("Kate Document Defaults");
+ m_autobrackets = ( config->readNumEntry("Basic Config Flags",0) & cfAutoBrackets );
+ m_autoindent = ( config->readNumEntry("Indentation Mode",0) > 0 );
+ }
+
+ // save local abbreviation changes
+ // (for example before a new configuration should be read)
+
+ void CodeCompletion::saveLocalChanges()
+ {
+ KILE_DEBUG() << "=== CodeCompletion::saveLocalChanges ===================" << endl;
+ m_abbrevListview->saveLocalAbbreviation(m_localAbbrevFile);
+ }
+
+ //////////////////// references and citations ////////////////////
+
+ void CodeCompletion::setReferences()
+ {
+ // build list of references
+ QString references = getCommandList(KileDocument::CmdAttrReference);
+ references.replace("*","\\*");
+ reRef.setPattern("^\\\\(" + references + ")\\{");
+ reRefExt.setPattern("^\\\\(" + references + ")\\{[^\\{\\}\\\\]+,");
+
+ // build list of citations
+ QString citations = getCommandList(KileDocument::CmdAttrCitations);
+ citations.replace("*","\\*");
+ reCite.setPattern("^\\\\(((c|C|noc)(ite|itep|itet|itealt|itealp|iteauthor|iteyear|iteyearpar|itetext))" + citations + ")\\{");
+ reCiteExt.setPattern("^\\\\(((c|C|noc)(ite|itep|itet|itealt|itealp|iteauthor|iteyear|iteyearpar|itetext))" + citations + ")\\{[^\\{\\}\\\\]+,");
+ }
+
+ QString CodeCompletion::getCommandList(KileDocument::CmdAttribute attrtype)
+ {
+ QStringList cmdlist;
+ QStringList::ConstIterator it;
+
+ // get info about user defined references
+ KileDocument::LatexCommands *cmd = m_ki->latexCommands();
+ cmd->commandList(cmdlist,attrtype,false);
+
+ // build list of references
+ QString commands = QString::null;
+ for ( it=cmdlist.begin(); it != cmdlist.end(); ++it )
+ {
+ if ( cmd->isStarredEnv(*it) )
+ commands += '|' + (*it).mid(1) + '*';
+ commands += '|' + (*it).mid(1);
+ }
+ return commands;
+ }
+
+ //////////////////// wordlists ////////////////////
+
+ void CodeCompletion::setWordlist( const QStringList &files, const QString &dir,
+ QValueList<KTextEditor::CompletionEntry> *entrylist
+ )
+ {
+
+ // read wordlists from files
+ QStringList wordlist;
+ for ( uint i = 0; i < files.count(); ++i )
+ {
+ // if checked, the wordlist has to be read
+ if ( files[ i ].at( 0 ) == '1' )
+ {
+ readWordlist( wordlist, dir + '/' + files[i].right( files[i].length()-2 ) + ".cwl", true );
+ }
+ }
+
+ // add user defined commands and environments
+ if ( dir == "tex" )
+ {
+ addCommandsToTexlist(wordlist);
+ setCompletionEntriesTexmode( entrylist, wordlist );
+ }
+ else if ( dir == "dictionary" )
+ {
+ wordlist.sort();
+ setCompletionEntries( entrylist, wordlist );
+ }
+ else if ( dir == "abbreviation" )
+ {
+ // read local wordlist
+ QStringList localWordlist;
+ readWordlist(localWordlist, QString::null, false);
+
+ // add local/global wordlists to the abbreviation view
+ m_abbrevListview->init(&wordlist,&localWordlist);
+
+ // finally add local wordlists to the abbreviation list
+ QStringList::ConstIterator it;
+ for ( it=localWordlist.begin(); it!=localWordlist.end(); ++it )
+ wordlist.append( *it );
+
+ wordlist.sort();
+ setCompletionEntries( entrylist, wordlist );
+ }
+ }
+
+ void CodeCompletion::addCommandsToTexlist(QStringList &wordlist)
+ {
+ QStringList cmdlist;
+ QStringList::ConstIterator it;
+ KileDocument::LatexCmdAttributes attr;
+
+ // get info about user defined commands and environments
+ KileDocument::LatexCommands *cmd = m_ki->latexCommands();
+ cmd->commandList(cmdlist,KileDocument::CmdAttrNone,true);
+
+ // add entries to wordlist
+ for ( it=cmdlist.begin(); it != cmdlist.end(); ++it )
+ {
+ if ( cmd->commandAttributes(*it,attr) )
+ {
+ QString command,eos;
+ QStringList entrylist;
+ if ( attr.type < KileDocument::CmdAttrLabel ) // environment
+ {
+ command = "\\begin{" + (*it);
+ eos = "}";
+ }
+ else // command
+ {
+ command = (*it);
+ // eos = QString::null;
+ }
+
+ // get all possibilities into a stringlist
+ entrylist.append( command + eos );
+ if ( ! attr.option.isEmpty() )
+ entrylist.append( command + eos + "[option]" );
+ if ( attr.starred )
+ {
+ entrylist.append( command + '*' + eos );
+ if ( ! attr.option.isEmpty() )
+ entrylist.append( command + '*' + eos + "[option]" );
+ }
+
+ // finally append entries to wordlist
+ QStringList::ConstIterator itentry;
+ for ( itentry=entrylist.begin(); itentry != entrylist.end(); ++itentry )
+ {
+ QString entry = (*itentry);
+ if ( ! attr.parameter.isEmpty() )
+ entry += "{param}";
+ if ( attr.type == KileDocument::CmdAttrList )
+ entry += "\\item";
+ wordlist.append( entry );
+ }
+ }
+ }
+ }
+
+ //////////////////// completion box ////////////////////
+
+ void CodeCompletion::completeWord(const QString &text, CodeCompletion::Mode mode)
+ {
+ KILE_DEBUG() << "==CodeCompletion::completeWord(" << text << ")=========" << endl;
+ KILE_DEBUG() << "\tm_view = " << m_view << endl;
+ if ( !m_view) return;
+ KILE_DEBUG() << "ok" << endl;
+
+ // remember all parameters (view, pattern, length of pattern, mode)
+ m_text = text;
+ m_textlen = text.length();
+ m_mode = mode;
+
+ // and the current cursor position
+ m_view->cursorPositionReal( &m_ycursor, &m_xcursor );
+ m_xstart = m_xcursor - m_textlen;
+
+ // and the current document
+ Kate::Document *doc = m_view->getDoc();
+
+ // switch to cmLatex mode, if cmLabel is chosen without any entries
+ if ( mode==cmLabel && m_labellist.count()==0 ) {
+ QString s = doc->textLine(m_ycursor);
+ int pos = s.findRev("\\",m_xcursor);
+ if (pos < 0) {
+ KILE_DEBUG() << "\tfound no backslash! s=" << s << endl;
+ return;
+ }
+ m_xstart = pos;
+ m_text = doc->text(m_ycursor,m_xstart,m_ycursor,m_xcursor);
+ m_textlen = m_text.length();
+ m_mode = cmLatex;
+ }
+
+ // determine the current list
+ QValueList<KTextEditor::CompletionEntry> list;
+ switch ( m_mode )
+ {
+ case cmLatex: // fall through here
+ case cmEnvironment:
+ list = m_texlist;
+ appendNewCommands(list);
+ break;
+ case cmDictionary:
+ list = m_dictlist;
+ break;
+ case cmAbbreviation:
+ list = m_abbrevlist;
+ break;
+ case cmLabel:
+ list = m_labellist;
+ break;
+ case cmDocumentWord:
+ getDocumentWords(text,list);
+ break;
+ }
+
+ // is it necessary to show the complete dialog?
+ QString entry, type;
+ QString pattern = ( m_mode != cmEnvironment ) ? text : "\\begin{" + text;
+ uint n = countEntries( pattern, &list, &entry, &type );
+
+ KILE_DEBUG() << "entries = " << n << endl;
+
+ // nothing to do
+ if ( n == 0 )
+ return ;
+
+
+ // Add a prefix ('\\begin{', length=7) in cmEnvironment mode,
+ // because KateCompletion reads from the current line, This also
+ // means that the original text has to be restored, if the user
+ // aborts the completion dialog
+ if ( m_mode == cmEnvironment )
+ {
+ doc->removeText( m_ycursor, m_xstart, m_ycursor, m_xcursor );
+ doc->insertText( m_ycursor, m_xstart, "\\begin{" + m_text );
+
+ // set the cursor to the new position
+ m_textlen += 7;
+ m_xcursor += 7;
+ m_view->setCursorPositionReal( m_ycursor, m_xcursor );
+
+ // set restore mode
+ m_undo = true;
+ }
+
+ // set restore mode
+ if ( m_mode == cmAbbreviation ) m_undo = true;
+
+ // show the completion dialog
+ m_inprogress = true;
+
+ KTextEditor::CodeCompletionInterface *iface;
+ iface = dynamic_cast<KTextEditor::CodeCompletionInterface *>( m_view );
+ iface->showCompletionBox( list, m_textlen );
+ }
+
+ void CodeCompletion::appendNewCommands(QValueList<KTextEditor::CompletionEntry> & list)
+ {
+ KTextEditor::CompletionEntry e;
+ const QStringList *ncommands = m_ki->allNewCommands();
+ QStringList::ConstIterator it;
+ QStringList::ConstIterator itend(ncommands->end());
+ for ( it = ncommands->begin(); it != itend; ++it )
+ {
+ e.text = *it;
+ list.prepend(e);
+ }
+ }
+
+ void CodeCompletion::completeFromList(const QStringList *list,const QString &pattern)
+ {
+ KTextEditor::CompletionEntry e;
+
+ KILE_DEBUG() << "completeFromList: " << list->count() << " items" << " << pattern=" << pattern<< endl;
+ QStringList sortedlist( *list );
+ sortedlist.sort();
+
+ m_labellist.clear();
+ QStringList::ConstIterator it;
+ QStringList::ConstIterator itend(sortedlist.end());
+ for ( it = sortedlist.begin(); it != itend; ++it )
+ {
+ e.text = *it;
+ m_labellist.append( e );
+ }
+
+ completeWord(pattern, cmLabel);
+ }
+
+ //////////////////// completion was done ////////////////////
+
+ void CodeCompletion::CompletionDone(KTextEditor::CompletionEntry)
+ {
+ // kile completion: is there a new cursor position?
+ if ( m_kilecompletion && m_setcursor && ( m_xoffset != 0 || m_yoffset != 0 ) && m_view )
+ {
+ int newx = ( m_xoffset != 0 ) ? m_xcursor + m_xoffset - m_textlen : m_xcursor;
+ int newy = ( m_yoffset != 0 ) ? m_ycursor + m_yoffset : m_ycursor;
+
+ m_view->setCursorPositionReal( newy, newx );
+ }
+
+ m_undo = false;
+ m_inprogress = false;
+ m_ref = false;
+ }
+
+ void CodeCompletion::CompletionAborted()
+ {
+ KILE_DEBUG() << "CodeCompletion::CompletionAborted()" << endl;
+ // aborted: undo if kile completion is active
+ if ( m_inprogress && m_undo && m_view )
+ {
+ uint row, col;
+ m_view->cursorPositionReal( &row, &col );
+
+ Kate::Document *doc = m_view->getDoc();
+ doc->removeText( m_ycursor, m_xstart, m_ycursor, col );
+ doc->insertText( m_ycursor, m_xstart, m_text );
+
+ m_view->setCursorPositionReal( m_ycursor, m_xstart + m_text.length() );
+ }
+
+ m_undo = false;
+ m_inprogress = false;
+ m_ref = false;
+ }
+
+ //////////////////// build the text for completion ////////////////////
+
+ // parse an entry for kile completion modes:
+ // - delete arguments/parameters
+ // - set cursor position
+ // - insert bullets
+
+ QString CodeCompletion::filterCompletionText( const QString &text, const QString &type )
+ {
+ static QRegExp::QRegExp reEnv = QRegExp("^\\\\(begin|end)[^a-zA-Z]+");
+ KILE_DEBUG() << " complete filter: " << text << " type " << type << endl;
+ m_type = getType( text ); // remember current type
+
+ if ( text!="\\begin{}" && reEnv.search(text)!=-1 )
+ m_mode = cmEnvironment;
+
+ // check the cursor position, because the user may have
+ // typed some characters or the backspace key. This also
+ // changes the length of the current pattern.
+ uint row, col;
+ m_view->cursorPositionReal( &row, &col );
+ if ( m_xcursor != col )
+ {
+ m_textlen += ( col - m_xcursor );
+ m_xcursor = col;
+ }
+
+ // initialize offset for the new cursorposition
+ m_xoffset = m_yoffset = 0;
+
+ // build the text
+ QString s,prefix;
+ Kate::Document *doc = m_view->getDoc();
+ QString textline = doc->textLine(row);
+ switch ( m_mode )
+ {
+ case cmLatex:
+ s = buildLatexText( text, m_yoffset, m_xoffset );
+ if ( m_autobrackets && textline.at(col)=='}' && m_text.find('{')>=0 )
+ {
+ doc->removeText(row,col,row,col+1);
+ }
+ break;
+ case cmEnvironment:
+ prefix = QString::null;
+ if ( m_autoindent )
+ {
+ if ( col-m_textlen>0 )
+ {
+ prefix = textline.left(col-m_textlen);
+ if ( prefix.right(7) == "\\begin{" )
+ prefix.truncate(prefix.length()-7);
+ else if ( prefix.right(5) == "\\end{" )
+ prefix.truncate(prefix.length()-5);
+ }
+ }
+ s = buildEnvironmentText( text, type, prefix, m_yoffset, m_xoffset );
+ if ( m_autobrackets && textline.at(col)=='}' && (textline[m_xstart]!='\\' || m_text.find('{')>=0 ) )
+ {
+ doc->removeText(row,col,row,col+1);
+ }
+ if ( m_xstart>=7 && textline.mid(m_xstart-7,7) == "\\begin{" )
+ {
+ m_textlen += 7;
+ }
+ else if ( m_xstart>=5 && textline.mid(m_xstart-5,5) == "\\end{" )
+ {
+ m_textlen += 5;
+ }
+ break;
+ case cmDictionary:
+ s = text;
+ break;
+ case cmAbbreviation:
+ s = buildAbbreviationText( text );
+ break;
+ case cmLabel:
+ s = buildLabelText( text );
+ if ( m_keylistType==CodeCompletion::ctReference
+ || (m_keylistType==CodeCompletion::ctCitation && m_citationMove) )
+ {
+ m_xoffset = s.length() + 1;
+ }
+ break;
+ case cmDocumentWord:
+ s = text;
+ break;
+ default : s = text; break;
+ }
+
+ if ( s.length() > m_textlen )
+ return s.right( s.length() - m_textlen );
+ else
+ return "";
+ }
+
+ //////////////////// text in cmLatex mode ////////////////////
+
+ QString CodeCompletion::buildLatexText( const QString &text, uint &ypos, uint &xpos )
+ {
+ return parseText( stripParameter( text ), ypos, xpos, true );
+ }
+
+ //////////////////// text in cmEnvironment mode ////////////////////
+
+ QString CodeCompletion::buildEnvironmentText( const QString &text, const QString &type,
+ const QString &prefix, uint &ypos, uint &xpos )
+ {
+ static QRegExp::QRegExp reEnv = QRegExp("^\\\\(begin|end)\\{([^\\}]*)\\}(.*)");
+
+ if (reEnv.search(text) == -1) return text;
+
+ QString parameter = stripParameter( reEnv.cap(3) );
+ QString start = reEnv.cap(1);
+ QString envname = reEnv.cap(2);
+ QString whitespace = getWhiteSpace(prefix);
+ QString envIndent = m_ki->editorExtension()->autoIndentEnvironment();
+
+ QString s = "\\" + start + "{" + envname + "}" + parameter + "\n";
+
+ s += whitespace;
+ if ( start != "end" )
+ s += envIndent;
+
+ bool item = (type == "list" );
+ if ( item )
+ s += "\\item ";
+
+ if ( m_setbullets && !parameter.isEmpty() )
+ s += s_bullet;
+
+ if ( m_closeenv && start != "end" )
+ s += '\n' + whitespace + "\\end{" + envname + "}\n";
+
+ // place cursor
+ if ( m_setcursor )
+ {
+ if ( parameter.isEmpty() )
+ {
+ ypos = 1;
+ xpos = whitespace.length() + envIndent.length() + (( item ) ? 6 : 0);
+ }
+ else
+ {
+ ypos = 0;
+ if( parameter.left(2) == "[<" )
+ xpos = 10 + envname.length();
+ else
+ xpos = 9 + envname.length();
+ }
+ }
+
+ return s;
+ }
+
+ QString CodeCompletion::getWhiteSpace(const QString &s)
+ {
+ QString whitespace = s;
+ for ( uint i=0; i<whitespace.length(); ++i )
+ {
+ if ( ! whitespace[i].isSpace() )
+ whitespace[i] = ' ';
+ }
+ return whitespace;
+ }
+
+ //////////////////// text in cmAbbreviation mode ////////////////////
+
+ QString CodeCompletion::buildAbbreviationText( const QString &text )
+ {
+ QString s;
+
+ int index = text.find( '=' );
+ if ( index >= 0 )
+ {
+ // determine text to insert
+ s = text.right( text.length() - index - 1 );
+
+ // delete abbreviation
+ Kate::Document *doc = m_view->getDoc();
+ doc->removeText( m_ycursor, m_xstart, m_ycursor, m_xcursor );
+ m_view->setCursorPositionReal( m_ycursor, m_xstart );
+ m_xcursor = m_xstart;
+
+ m_textlen = 0;
+ }
+ else
+ s = "";
+
+ return s;
+ }
+
+ //////////////////// text in cmLabel mode ////////////////////
+
+ QString CodeCompletion::buildLabelText( const QString &text )
+ {
+ if ( text.at( 0 ) == ' ' )
+ {
+ // delete space
+ Kate::Document * doc = m_view->getDoc();
+ doc->removeText( m_ycursor, m_xstart, m_ycursor, m_xstart + 1 );
+ m_view->setCursorPositionReal( m_ycursor, m_xstart );
+ m_xcursor = m_xstart;
+
+ m_textlen = 0;
+ return text.right( text.length() - 1 );
+ }
+ else
+ return text;
+ }
+
+
+ //////////////////// some functions ////////////////////
+
+ QString CodeCompletion::parseText( const QString &text, uint &ypos, uint &xpos, bool checkgroup )
+ {
+ bool foundgroup = false;
+ QString s = "";
+
+ xpos = ypos = 0;
+ for ( uint i = 0; i < text.length(); ++i )
+ {
+ switch ( text[ i ] )
+ {
+ case '<':
+ case '{':
+ case '(':
+ case '[': // insert character
+ s += text[ i ];
+ if ( xpos == 0 )
+ {
+ // remember position after first brace
+ if(text[i] == '[' && (i+1) < text.length() && text[i+1] == '<'){
+ xpos = i + 2;
+ s += text[i+1];
+ i++;
+ }// special handling for '[<'
+ else
+ xpos = i + 1;
+ // insert bullet, if this is no cursorposition
+ if ( ( ! m_setcursor ) && m_setbullets && !( text[i] == '[' && (i+1) < text.length() && text[i+1] == '<' ))
+ s += s_bullet;
+ }
+ // insert bullets after following braces
+ else if ( m_setbullets && !( text[i] == '[' && (i+1) < text.length() && text[i+1] == '<' ) )
+ s += s_bullet;
+ break;
+ case '>':
+ case '}':
+ case ')':
+ case ']': // insert character
+ s += text[ i ];
+ break;
+ case ',': // insert character
+ s += text[ i ];
+ // insert bullet?
+ if ( m_setbullets )
+ s += s_bullet;
+ break;
+ case '.': // if the last character is a point of a range operator,
+ // it will be replaced by a space or a bullet surrounded by spaces
+ if ( checkgroup && ( s.right( 1 ) == "." ) )
+ {
+ foundgroup = true;
+ s.truncate( s.length() - 1 );
+ if ( m_setbullets )
+ s += ' ' + s_bullet + ' ';
+ else
+ s += ' ';
+ }
+ else
+ s += text[ i ];
+ break;
+ default: // insert all other characters
+ s += text[ i ];
+ break;
+ }
+ }
+
+ // some more work with groups and bullets
+ if ( checkgroup && foundgroup && ( m_setbullets | m_setcursor ) )
+ {
+ int pos = 0;
+
+ // search for braces, brackets and parens
+ switch ( QChar( s[ 1 ] ) )
+ {
+ case 'l' :
+ if ( s.left( 6 ) == "\\left " )
+ pos = 5;
+ break;
+ case 'b' :
+ if ( s.left( 6 ) == "\\bigl " )
+ pos = 5;
+ else if ( s.left( 7 ) == "\\biggl " )
+ pos = 6;
+ break;
+ case 'B' :
+ if ( s.left( 6 ) == "\\Bigl " )
+ pos = 5;
+ else if ( s.left( 7 ) == "\\Biggl " )
+ pos = 6;
+ break;
+ }
+
+ // update cursorposition and set bullet
+ if ( pos > 0 )
+ {
+ if ( m_setcursor )
+ xpos = pos;
+ if ( m_setbullets )
+ {
+ if ( ! m_setcursor )
+ s.insert( pos, s_bullet );
+ s.append( s_bullet );
+ }
+ }
+ }
+
+ // Ergebnis
+ return s;
+ }
+
+ // strip all names enclosed in braces
+ // consider also beamer like stuff [<...>] and <...>
+
+ QString CodeCompletion::stripParameter( const QString &text )
+ {
+ QString s = "";
+ const QChar *ch = text.unicode();
+ bool ignore = false;
+
+
+ for ( uint i = 0; i < text.length(); ++i )
+ {
+ switch ( *ch )
+ {
+ case '[':
+ case '{':
+ case '(':
+ case '<':
+ s += *ch;
+ ignore = true;
+ break;
+ case ']':
+ case '}':
+ case ')':
+ case '>':
+ s += *ch;
+ ignore = false;
+ break;
+ case ',':
+ s += *ch;
+ break;
+ default:
+ if ( ! ignore )
+ s += *ch;
+ break;
+ }
+ ++ch;
+ }
+ return s;
+ }
+
+ //////////////////// read wordlists ////////////////////
+
+ void CodeCompletion::readWordlist( QStringList &wordlist, const QString &filename, bool global )
+ {
+ QString file = ( global )
+ ? KGlobal::dirs()->findResource( "appdata", "complete/" + filename )
+ : m_localAbbrevFile;
+ if ( file.isEmpty() ) return;
+
+ QFile f( file );
+ if ( f.open( IO_ReadOnly ) )
+ { // file opened successfully
+ QTextStream t( &f ); // use a text stream
+ while ( ! t.eof() )
+ { // until end of file...
+ QString s = t.readLine().stripWhiteSpace(); // line of text excluding '\n'
+ if ( ! ( s.isEmpty() || s.at( 0 ) == '#' ) )
+ {
+ wordlist.append( s );
+ }
+ }
+ f.close();
+ }
+ }
+
+ void CodeCompletion::setCompletionEntries( QValueList<KTextEditor::CompletionEntry> *list,
+ const QStringList &wordlist )
+ {
+ // clear the list of completion entries
+ list->clear();
+
+ KTextEditor::CompletionEntry e;
+ QStringList::ConstIterator it;
+
+ // build new entries
+ for ( it=wordlist.begin(); it != wordlist.end(); ++it )
+ {
+ // set CompletionEntry
+ e.text = *it;
+ e.type = "";
+
+ // add new entry
+ if ( list->findIndex(e) == -1 )
+ list->append(e);
+ }
+ }
+
+ void CodeCompletion::setCompletionEntriesTexmode( QValueList<KTextEditor::CompletionEntry> *list,
+ const QStringList &wordlist )
+ {
+ // clear the list of completion entries
+ list->clear();
+
+ // create a QMap for a user defined sort
+ // order: \abc, \abc[], \abc{}, \abc*, \abc*[], \abc*{}, \abcd, \abcD
+ QStringList keylist;
+ QMap<QString,QString> map;
+
+ for ( uint i=0; i< wordlist.count(); ++i )
+ {
+ QString s = wordlist[i];
+ for ( uint j=0; j<s.length(); ++j )
+ {
+ QChar ch = s[j];
+ if ( ch>='A' && ch<='Z' )
+ s[j] = (int)ch + 32 ;
+ else if ( ch>='a' && ch<='z' )
+ s[j] = (int)ch - 32 ;
+ else if ( ch == '}' )
+ s[j] = 48;
+ else if ( ch == '{' )
+ s[j] = 49;
+ else if ( ch == '[' )
+ s[j] = 50;
+ else if ( ch == '*' )
+ s[j] = 51;
+ else if ( ch == ']' )
+ s[j] = 52;
+ }
+ // don't allow duplicate entries
+ if ( ! map.contains(s) )
+ {
+ map[s] = wordlist[i];
+ keylist.append(s);
+ }
+ }
+
+ // sort mapped keys
+ keylist.sort();
+
+ // build new entries: get the sorted keys and insert
+ // the real entries, which are saved in the map.
+ // if the last 5 chars of an environment are '\item', it is a
+ // list environment, where the '\item' tag is also inserted
+ KTextEditor::CompletionEntry e;
+ QStringList::ConstIterator it;
+
+ for ( it=keylist.begin(); it != keylist.end(); ++it )
+ {
+ // get real entry
+ QString s = map[*it];
+ if ( s.left( 7 ) == "\\begin{" && s.right( 5 ) == "\\item" )
+ {
+ e.text = s.left( s.length() - 5 ); // list environment entry
+ e.type = "list";
+ }
+ else
+ {
+ e.text = s; // normal entry
+ e.type = "";
+ }
+ // add new entry (duplicates are impossible)
+ list->append(e);
+ }
+ }
+
+ //////////////////// determine number of entries ////////////////////
+
+ // Count the number of entries. Stop, wenn there are 2 entries,
+ // because special functions are only called, when there are 0
+ // or 1 entries.
+
+ uint CodeCompletion::countEntries( const QString &pattern,
+ QValueList<KTextEditor::CompletionEntry> *list,
+ QString *entry, QString *type )
+ {
+ QValueList<KTextEditor::CompletionEntry>::Iterator it;
+ uint n = 0;
+
+ for ( it = list->begin(); it != list->end() && n < 2; ++it )
+ {
+ if ( ( *it ).text.startsWith( pattern ) )
+ {
+ *entry = ( *it ).text;
+ *type = ( *it ).type;
+ ++n;
+ }
+ }
+
+ return n;
+ }
+
+ QString CodeCompletion::findExpansion(const QString &abbrev)
+ {
+ QValueList<KTextEditor::CompletionEntry>::Iterator it;
+
+ for ( it=m_abbrevlist.begin(); it!=m_abbrevlist.end(); ++it )
+ {
+ QString s = (*it).text;
+ int index = s.find("=");
+ if ( index>=0 && s.left(index)==abbrev )
+ return s.right( s.length()-index-1 );
+ }
+
+ return QString::null;
+ }
+
+ void CodeCompletion::editComplete(Kate::View *view, Mode mode)
+ {
+ KILE_DEBUG() << "void CodeCompletion::editComplete(Kate::View *view, Mode "<< mode << ")" << endl;
+ KILE_DEBUG() << "m_inprogress=" << m_inprogress << ", isActive()=" << isActive() << endl;
+ m_view = view;
+
+ if ( !m_view || !isActive() )
+ return ;
+
+ m_inprogress=true;
+
+ KILE_DEBUG() << "proceeded" << endl;
+ // check for a special case: call from inside of a reference command
+ if ( mode==cmLatex )
+ {
+ QString startpattern;
+ CodeCompletion::Type reftype = insideReference(startpattern);
+ if ( reftype != CodeCompletion::ctNone )
+ {
+ m_ref = true;
+ editCompleteList(reftype,startpattern);
+ return;
+ }
+ }
+
+ QString word;
+ Type type;
+ if ( getCompleteWord(( mode == cmLatex ) ? true : false, word, type ) )
+ {
+ if ( mode == cmLatex && word.at( 0 ) != '\\' )
+ {
+ mode = cmDictionary;
+ }
+
+ if ( type == CodeCompletion::ctNone )
+ completeWord(word, mode);
+ else
+ editCompleteList(type);
+ }
+ }
+
+ void CodeCompletion::editCompleteList(Type type,const QString &pattern)
+ {
+ KILE_DEBUG() << "==editCompleteList=============" << endl;
+ m_keylistType = type;
+ if ( type == ctReference )
+ completeFromList(info()->allLabels(),pattern);
+ else if ( type == ctCitation )
+ completeFromList(info()->allBibItems(),pattern);
+ else
+ {
+ m_keylistType = CodeCompletion::ctNone;
+ kdWarning() << "unsupported type in CodeCompletion::editCompleteList" << endl;
+ }
+ }
+
+ //////////////////// slots for code completion ////////////////////
+
+ void CodeCompletion::slotCompletionDone(KTextEditor::CompletionEntry entry)
+ {
+ KILE_DEBUG() << "==slotCompletionDone (" << m_kilecompletion << "," << m_inprogress << ")=============" << endl;
+ CompletionDone(entry);
+
+ // if kile completion was active, look if we need to show an additional list
+ if ( m_kilecompletion )
+ {
+ m_kilecompletion = false;
+ if ( getMode() == cmLatex )
+ {
+ m_type = getType(entry.text);
+ if ( (m_type==CodeCompletion::ctReference && info()->allLabels()->count()>0) ||
+ (m_type==CodeCompletion::ctCitation && info()->allBibItems()->count()>0) )
+ {
+ m_keylistType = m_type;
+ m_ref = true;
+ m_completeTimer->start(20,true);
+ }
+ }
+ }
+ }
+
+ void CodeCompletion::slotCompleteValueList()
+ {
+ KILE_DEBUG() << "==slotCompleteValueList (" << m_kilecompletion << "," << m_inprogress << ")=============" << endl;
+ m_completeTimer->stop();
+ editCompleteList(getType());
+ }
+
+ void CodeCompletion::slotCompletionAborted()
+ {
+ KILE_DEBUG() << "==slotCompletionAborted (" << m_kilecompletion << "," << m_inprogress << ")=============" << endl;
+ CompletionAborted();
+ }
+
+ void CodeCompletion::slotFilterCompletion( KTextEditor::CompletionEntry* c, QString *s )
+ {
+ KILE_DEBUG() << "==slotFilterCompletion (" << m_kilecompletion << "," << m_inprogress << ")=============" << endl;
+ if ( inProgress() ) // dani 28.09.2004
+ {
+ KILE_DEBUG() << "\tin progress: s=" << *s << endl;
+ *s = filterCompletionText( c->text, c->type );
+ KILE_DEBUG() << "\tfilter --->" << *s << endl;
+ m_inprogress = false;
+ m_kilecompletion = true;
+ }
+ }
+
+ void CodeCompletion::slotCharactersInserted(int, int, const QString& string )
+ {
+ KILE_DEBUG() << "==slotCharactersInserted (" << m_kilecompletion << "," << m_inprogress << ", " << m_ref << ", " << string << ")=============" << endl;
+
+ if ( !inProgress() && m_autoDollar && string=="$" )
+ {
+ autoInsertDollar();
+ return;
+ }
+
+ // only work, if autocomplete mode of Kile is active
+ if ( !isActive() || !autoComplete() )
+ return ;
+
+ //FIXME this is not very efficient
+ m_view = info()->viewManager()->currentTextView();
+
+ // try to autocomplete abbreviations after punctuation symbol
+ if ( !inProgress() && m_autocompleteabbrev && completeAutoAbbreviation(string) )
+ return;
+
+ // rather unsusual, but it may happen: the cursor is inside
+ // of a reference command without a labellist.
+ if ( ! m_ref )
+ {
+ QString startpattern;
+ CodeCompletion::Type reftype = insideReference(startpattern);
+ if ( reftype != CodeCompletion::ctNone )
+ {
+ m_ref = true;
+ editCompleteList(reftype,startpattern);
+ return;
+ }
+ }
+
+ QString word;
+ Type type;
+ bool found = ( m_ref ) ? getReferenceWord(word) : getCompleteWord(true,word,type );
+ if ( found )
+ {
+ int wordlen = word.length();
+ KILE_DEBUG() << " auto completion: word=" << word << " mode=" << m_mode << " inprogress=" << inProgress() << endl;
+ if ( inProgress() ) // continue a running mode?
+ {
+ KILE_DEBUG() << " auto completion: continue current mode" << endl;
+ completeWord(word, m_mode);
+ }
+ else if ( word.at( 0 )=='\\' && m_autocomplete && wordlen>=m_latexthreshold)
+ {
+ KILE_DEBUG() << " auto completion: latex mode" << endl;
+ if ( string.at( 0 ).isLetter() )
+ {
+ completeWord(word, cmLatex);
+ }
+ else if ( string.at( 0 ) == '{' )
+ {
+ editCompleteList(type);
+ }
+ }
+ else if ( word.at(0).isLetter() && m_autocompletetext && wordlen>=m_textthreshold)
+ {
+ KILE_DEBUG() << " auto completion: document mode" << endl;
+ completeWord(word,cmDocumentWord);
+ }
+ }
+ }
+
+ //////////////////// testing characters (dani) ////////////////////
+
+ static bool isBackslash ( QChar ch )
+ {
+ return ( ch == '\\' );
+ }
+
+ bool CodeCompletion::getCompleteWord(bool latexmode, QString &text, Type &type )
+ {
+ if ( !m_view ) return false;
+
+ uint row, col;
+ QChar ch;
+
+ // get current position
+ m_view->cursorPositionReal( &row, &col );
+
+ // there must be et least one sign
+ if ( col < 1 )
+ return "";
+
+ // get current text line
+ QString textline = m_view->getDoc()->textLine( row );
+
+ //
+ int n = 0; // number of characters
+ int index = col; // go back from here
+ while ( --index >= 0 )
+ {
+ // get current character
+ ch = textline.at( index );
+
+ if ( ch.isLetter() || ch=='.' || ch == '_' || ch.isDigit() || ( latexmode && ( index + 1 == ( int ) col ) && ch == '{' ) )
+ ++n; // accept letters and '{' as first character in latexmode
+ else
+ {
+ if ( latexmode && isBackslash( ch ) && oddBackslashes( textline, index ) ) // backslash?
+ ++n;
+ break; // stop when a backslash was found
+ }
+ }
+
+ // select pattern and set type of match
+ text = textline.mid( col - n, n );
+ type = getType( text );
+
+ return !text.isEmpty();
+ }
+
+ bool CodeCompletion::getReferenceWord(QString &text)
+ {
+ if ( !m_view ) return false;
+
+ uint row, col;
+ QChar ch;
+
+ // get current position
+ m_view->cursorPositionReal( &row, &col );
+ // there must be et least one sign
+ if ( col < 1 )
+ return false;
+
+ // get current text line
+ QString textline = m_view->getDoc()->textLine( row );
+
+ // search the current reference string
+ int pos = textline.findRev(reNotRefChars,col-1);
+ if ( pos < 0 )
+ pos = 0;
+
+ // select pattern
+ text = textline.mid(pos+1,col-1-pos);
+ return ( (uint)pos < col-1 );
+ }
+
+ void CodeCompletion::getDocumentWords(const QString &text,
+ QValueList<KTextEditor::CompletionEntry> &list)
+ {
+ KILE_DEBUG() << "getDocumentWords: " << endl;
+ list.clear();
+
+ QRegExp reg("(\\\\?\\b" + QString(text[0]) + "[^\\W\\d_]+)\\b");
+ Kate::Document *doc = m_view->getDoc();
+
+ QString s;
+ KTextEditor::CompletionEntry e;
+ QDict<bool> seen;
+ bool alreadyseen = true;
+
+ for (uint i=0; i<doc->numLines(); ++i) {
+ s = doc->textLine(i);
+ int pos = 0;
+ while ( pos >= 0 ) {
+ pos = reg.search(s,pos);
+ if ( pos >= 0 ) {
+ if ( reg.cap(1).at(0)!='\\' && text!=reg.cap(1) && !seen.find(reg.cap(1)) ) {
+ e.text = reg.cap(1); // normal entry
+ e.type = "";
+ list.append( e );
+ seen.insert(reg.cap(1),&alreadyseen);
+ }
+ pos += reg.matchedLength();
+ }
+ }
+ }
+ }
+
+ //////////////////// counting backslashes (dani) ////////////////////
+
+ bool CodeCompletion::oddBackslashes( const QString& text, int index )
+ {
+ uint n = 0;
+ while ( index >= 0 && isBackslash( text.at( index ) ) )
+ {
+ ++n;
+ --index;
+ }
+ return ( n % 2 ) ? true : false;
+ }
+
+ //////////////////// complete auto abbreviation ////////////////////
+
+ bool CodeCompletion::completeAutoAbbreviation(const QString &text)
+ {
+ if ( text.length() != 1 )
+ return false;
+
+ QChar ch = text[0];
+ if ( ! (ch.isSpace() || ch.isPunct()) )
+ return false;
+
+ uint row,col;
+ m_view->cursorPositionReal( &row, &col );
+ QString abbrev = getAbbreviationWord(row,col-1);
+ if ( abbrev.isEmpty() )
+ return false;
+
+ QString expansion = findExpansion(abbrev);
+ if ( expansion.isEmpty() )
+ return false;
+
+ KILE_DEBUG() << "=== CodeCompletion::completeAutoAbbreviation: abbrev=" << abbrev << " exp=" << expansion << endl;
+
+ uint len = abbrev.length();
+ uint startcol = col - len - 1;
+ Kate::Document *doc = m_view->getDoc();
+ doc->removeText( row,startcol,row,startcol+abbrev.length()+1 );
+ doc->insertText( row,startcol,expansion+ch);
+ m_view->setCursorPositionReal( row,startcol+expansion.length()+1 );
+
+ return true;
+ }
+
+ QString CodeCompletion::getAbbreviationWord(uint row, uint col)
+ {
+ QString textline = m_view->getDoc()->textLine( row );
+
+ int index = (int)col;
+ while ( --index >= 0 )
+ {
+ QChar ch = textline.at( index );
+ if ( ! ch.isLetterOrNumber() )
+ break;
+ }
+
+ return textline.mid(index+1,col-index-1);
+ }
+
+ //////////////////// connection with the abbreviation listview ////////////////////
+
+ void CodeCompletion::setAbbreviationListview(KileAbbrevView *listview)
+ {
+ m_abbrevListview = listview;
+
+ connect( m_abbrevListview, SIGNAL(updateAbbrevList(const QString &, const QString &)),
+ this, SLOT(slotUpdateAbbrevList(const QString &, const QString &)) );
+
+ }
+
+ void CodeCompletion::slotUpdateAbbrevList(const QString &ds, const QString &as)
+ {
+ if ( ! ds.isEmpty() )
+ {
+ deleteAbbreviationEntry(ds);
+ }
+ if ( ! as.isEmpty() )
+ {
+ addAbbreviationEntry(as);
+ }
+ }
+
+ void CodeCompletion::deleteAbbreviationEntry( const QString &entry )
+ {
+ KILE_DEBUG() << "=== CodeCompletion::deleteAbbreviationEntry (" << entry << ")" << endl;
+ QValueList<KTextEditor::CompletionEntry>::Iterator it;
+ for ( it=m_abbrevlist.begin(); it!=m_abbrevlist.end(); ++it )
+ {
+ if ( (*it).text == entry )
+ {
+ m_abbrevlist.remove( it );
+ return;
+ }
+ }
+ }
+
+ void CodeCompletion::addAbbreviationEntry( const QString &entry )
+ {
+ KILE_DEBUG() << "=== CodeCompletion::addAbbreviationEntry (" << entry << ")" << endl;
+ QValueList<KTextEditor::CompletionEntry>::Iterator it;
+ for ( it=m_abbrevlist.begin(); it!=m_abbrevlist.end(); ++it )
+ {
+ if ( (*it).text > entry )
+ break;
+ }
+
+ KTextEditor::CompletionEntry e;
+ e.text = entry;
+ e.type = QString::null;
+
+ if ( it == m_abbrevlist.begin() )
+ m_abbrevlist.prepend(e);
+ else if ( it == m_abbrevlist.end() )
+ m_abbrevlist.append(e);
+ else
+ m_abbrevlist.insert(it,e);
+ }
+
+ //////////////////// autoinsert $ ////////////////////
+
+ void CodeCompletion::autoInsertDollar()
+ {
+ Kate::View *view = info()->viewManager()->currentTextView();
+ if ( view )
+ {
+ uint row,col;
+ view = info()->viewManager()->currentTextView();
+ view->cursorPositionReal( &row, &col );
+ view->getDoc()->insertText(row,col,"$");
+ view->setCursorPositionReal( row, col );
+ }
+ }
+
+}
+
+#include "codecompletion.moc"
diff --git a/src/kile/codecompletion.h b/src/kile/codecompletion.h
new file mode 100644
index 0000000..d1da2e0
--- /dev/null
+++ b/src/kile/codecompletion.h
@@ -0,0 +1,211 @@
+/***************************************************************************
+ date : Mar 21 2007
+ version : 0.40
+ copyright : (C) 2004-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CODECOMPLETION_H
+#define CODECOMPLETION_H
+
+#include <qobject.h>
+
+#include <kate/view.h>
+#include <kate/document.h>
+#include <ktexteditor/codecompletioninterface.h>
+#include <kconfig.h>
+
+#include "latexcmd.h"
+#include "kileabbrevview.h"
+
+//default bullet char (a cross)
+static const QChar s_bullet_char = QChar(0xd7);
+static const QString s_bullet = QString(&s_bullet_char, 1);
+
+/**
+ *@author Holger Danielsson
+ */
+
+class QTimer;
+
+class KileInfo;
+
+namespace KileDocument
+{
+
+//FIXME fix the way the Kate::View is passed, I'm not 100% confident m_view doesn't turn into a wild pointer
+//FIXME refactor the complete class, it's pretty ugly, there are too many methods with similar names suggesting that the code could be more efficient
+class CodeCompletion : public QObject
+{
+ Q_OBJECT
+
+public:
+ CodeCompletion(KileInfo *ki);
+ ~CodeCompletion();
+
+ enum Mode
+ {
+ cmLatex,
+ cmEnvironment,
+ cmDictionary,
+ cmAbbreviation,
+ cmLabel,
+ cmDocumentWord
+ };
+
+ enum Type
+ {
+ ctNone,
+ ctReference,
+ ctCitation
+ };
+
+ enum KateConfigFlags
+ {
+ cfAutoIndent= 0x1,
+ cfAutoBrackets= 0x40
+ };
+
+ bool isActive();
+ bool inProgress();
+ bool autoComplete();
+ CodeCompletion::Mode getMode();
+ CodeCompletion::Type getType();
+ CodeCompletion::Type getType(const QString &text);
+
+ KileInfo* info() const { return m_ki;}
+
+ void readConfig(KConfig *config);
+ void readKateConfigFlags(KConfig *config);
+ void saveLocalChanges();
+
+ void setAbbreviationListview(KileAbbrevView *listview);
+
+public slots:
+ //in these two methods we should set m_view
+ void slotCharactersInserted(int, int, const QString&);
+ void editComplete(Kate::View *view, KileDocument::CodeCompletion::Mode mode);
+
+ void slotCompletionDone(KTextEditor::CompletionEntry);
+ void slotCompleteValueList();
+ void slotCompletionAborted();
+
+ void slotFilterCompletion(KTextEditor::CompletionEntry* c,QString *s);
+
+ // a abbreviation was modified ind the abbreviation view (add, edit or delete)
+ // so the abbreviation list was must also be updated
+ void slotUpdateAbbrevList(const QString &ds, const QString &as);
+
+private:
+ void completeWord(const QString &text, CodeCompletion::Mode mode);
+ QString filterCompletionText(const QString &text, const QString &type);
+
+ void CompletionDone(KTextEditor::CompletionEntry);
+ void CompletionAborted();
+
+ void completeFromList(const QStringList *list,const QString &pattern=QString::null);
+ void editCompleteList(KileDocument::CodeCompletion::Type type,const QString &pattern=QString::null);
+ bool getCompleteWord(bool latexmode, QString &text, KileDocument::CodeCompletion::Type &type);
+ bool getReferenceWord(QString &text);
+ bool oddBackslashes(const QString& text, int index);
+
+ void appendNewCommands(QValueList<KTextEditor::CompletionEntry> & list);
+ void getDocumentWords(const QString &text,QValueList<KTextEditor::CompletionEntry> &list);
+
+ bool completeAutoAbbreviation(const QString &text);
+ QString getAbbreviationWord(uint row, uint col);
+
+ CodeCompletion::Type insideReference(QString &startpattern);
+
+private:
+ // wordlists
+ QValueList<KTextEditor::CompletionEntry> m_texlist;
+ QValueList<KTextEditor::CompletionEntry> m_dictlist;
+ QValueList<KTextEditor::CompletionEntry> m_abbrevlist;
+ QValueList<KTextEditor::CompletionEntry> m_labellist;
+
+ KileInfo *m_ki;
+ QTimer *m_completeTimer;
+
+ // some flags
+ bool m_isenabled;
+ bool m_setcursor;
+ bool m_setbullets;
+ bool m_closeenv;
+ bool m_autocomplete;
+ bool m_autocompletetext;
+ bool m_autocompleteabbrev;
+ bool m_citationMove;
+ bool m_autoDollar;
+ int m_latexthreshold;
+ int m_textthreshold;
+
+ // flags from Kate configuration
+ bool m_autobrackets;
+ bool m_autoindent;
+
+ // state of complete: some flags
+ bool m_firstconfig;
+ bool m_inprogress;
+ bool m_ref;
+ bool m_kilecompletion;
+
+ // undo text
+ bool m_undo;
+
+ // special types: ref, bib
+ CodeCompletion::Type m_type;
+ CodeCompletion::Type m_keylistType;
+
+ // local abbreviation
+ QString m_localAbbrevFile;
+ KileAbbrevView *m_abbrevListview;
+
+ // internal parameter
+ Kate::View *m_view; // View
+ QString m_text; // current pattern
+ uint m_textlen; // length of current pattern
+ CodeCompletion::Mode m_mode; // completion mode
+ uint m_ycursor,m_xcursor,m_xstart; // current cursor position
+ uint m_yoffset,m_xoffset; // offset of the new cursor position
+
+ QString buildLatexText(const QString &text, uint &ypos, uint &xpos);
+ QString buildEnvironmentText(const QString &text, const QString &type, const QString &prefix, uint &ypos, uint &xpos);
+ QString getWhiteSpace(const QString &s);
+ QString buildAbbreviationText(const QString &text);
+ QString buildLabelText(const QString &text);
+
+ QString parseText(const QString &text, uint &ypos, uint &xpos, bool checkgroup);
+ QString stripParameter(const QString &text);
+
+ void setWordlist(const QStringList &files,const QString &dir, QValueList<KTextEditor::CompletionEntry> *entrylist);
+ void readWordlist(QStringList &wordlist, const QString &filename, bool global);
+ void addCommandsToTexlist(QStringList &wordlist);
+
+ void setReferences();
+ QString getCommandList(KileDocument::CmdAttribute attrtype);
+
+ void setCompletionEntries(QValueList<KTextEditor::CompletionEntry> *list, const QStringList &wordlist);
+ void setCompletionEntriesTexmode(QValueList<KTextEditor::CompletionEntry> *list, const QStringList &wordlist);
+
+ uint countEntries(const QString &pattern, QValueList<KTextEditor::CompletionEntry> *list, QString *entry, QString *type);
+
+ void addAbbreviationEntry( const QString &entry );
+ void deleteAbbreviationEntry( const QString &entry );
+ QString findExpansion(const QString &abbrev);
+
+ void autoInsertDollar();
+};
+
+}
+
+#endif
diff --git a/src/kile/complete/CMakeLists.txt b/src/kile/complete/CMakeLists.txt
new file mode 100644
index 0000000..209f0bd
--- /dev/null
+++ b/src/kile/complete/CMakeLists.txt
@@ -0,0 +1,3 @@
+ADD_SUBDIRECTORY( abbreviation )
+ADD_SUBDIRECTORY( tex )
+ADD_SUBDIRECTORY( dictionary )
diff --git a/src/kile/complete/Makefile.am b/src/kile/complete/Makefile.am
new file mode 100644
index 0000000..72ff197
--- /dev/null
+++ b/src/kile/complete/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS=abbreviation tex dictionary
diff --git a/src/kile/complete/abbreviation/CMakeLists.txt b/src/kile/complete/abbreviation/CMakeLists.txt
new file mode 100644
index 0000000..29f72f0
--- /dev/null
+++ b/src/kile/complete/abbreviation/CMakeLists.txt
@@ -0,0 +1,4 @@
+
+########### install files ###############
+
+INSTALL( FILES example.cwl DESTINATION share/apps/kile/complete/abbreviation )
diff --git a/src/kile/complete/abbreviation/Makefile.am b/src/kile/complete/abbreviation/Makefile.am
new file mode 100644
index 0000000..f52bb0c
--- /dev/null
+++ b/src/kile/complete/abbreviation/Makefile.am
@@ -0,0 +1,2 @@
+abbcompletedir = $(kde_datadir)/kile/complete/abbreviation
+abbcomplete_DATA = example.cwl
diff --git a/src/kile/complete/abbreviation/example.cwl b/src/kile/complete/abbreviation/example.cwl
new file mode 100644
index 0000000..dac4f4d
--- /dev/null
+++ b/src/kile/complete/abbreviation/example.cwl
@@ -0,0 +1,14 @@
+# abbreviation mode: example
+# dani/8.1.2004
+ba=baseline
+bab=babel package
+bar=baselineskip rubber length
+bdc=book document class
+bi=bibliography styles
+bip=bibliography style parameters
+bs=\backslash
+cc=\textsc{CodeCompletion}
+kile=KDE integrated LaTeX editor
+x=\
+T=\TeX
+L=\LaTeX
diff --git a/src/kile/complete/dictionary/CMakeLists.txt b/src/kile/complete/dictionary/CMakeLists.txt
new file mode 100644
index 0000000..9954664
--- /dev/null
+++ b/src/kile/complete/dictionary/CMakeLists.txt
@@ -0,0 +1,4 @@
+
+########### install files ###############
+
+INSTALL( FILES example.cwl metapost.cwl DESTINATION share/apps/kile/complete/dictionary )
diff --git a/src/kile/complete/dictionary/Makefile.am b/src/kile/complete/dictionary/Makefile.am
new file mode 100644
index 0000000..6158911
--- /dev/null
+++ b/src/kile/complete/dictionary/Makefile.am
@@ -0,0 +1,2 @@
+dictcompletedir = $(kde_datadir)/kile/complete/dictionary
+dictcomplete_DATA = example.cwl metapost.cwl
diff --git a/src/kile/complete/dictionary/example.cwl b/src/kile/complete/dictionary/example.cwl
new file mode 100644
index 0000000..ff43021
--- /dev/null
+++ b/src/kile/complete/dictionary/example.cwl
@@ -0,0 +1,12 @@
+# dictionary mode: example
+# dani/8.1.2004
+afterpage
+align environment
+aligned environment
+alltt
+amsbook
+amsfonts
+annotate
+annotation
+arabic
+array environment
diff --git a/src/kile/complete/dictionary/metapost.cwl b/src/kile/complete/dictionary/metapost.cwl
new file mode 100644
index 0000000..933b942
--- /dev/null
+++ b/src/kile/complete/dictionary/metapost.cwl
@@ -0,0 +1,307 @@
+# replacement for the removed metapost view
+# 11.02.2007 tbraun
+
+beginfig();
+endfig;
+extra_beginfig()
+extra_endfig
+begingraph()
+endgraph
+begingroup
+endgroup
+for upto
+forever:
+forsuffixes :
+endfor
+if :
+else :
+fi
+abs
+addto also
+addto contour
+addto doublepath
+ahangle
+ahlength
+and
+angle
+arclength
+arctime of
+augment.
+auto.
+Autoform
+autogrid()
+background
+bbox
+bboxmargin
+beveled
+black
+blue
+bluepart
+boolean
+bot
+boxit
+boxjoin()
+bp
+bpath
+btex etex
+buildcycle()
+butt
+ceiling
+char
+charcode
+circleit
+circmargin
+clip
+color
+controls
+cosd
+curl
+currentpen
+currentpicture
+cutafter
+cutbefore
+cutdraw
+cycle
+dashed
+dashpattern
+day
+dd
+decimal
+decr
+defaultdx:=
+defaultdy:=
+defaultfont:=
+defaultpen:=
+defaultscale:=
+def enddef
+direction of
+directionpoint of
+directiontime of
+ditto
+div
+dotlabel.
+dotlabels.
+dotprod
+down
+downto
+draw
+draw_mark()
+draw_marked()
+drawarrow
+drawblarrow
+drawboxed()
+drawboxes()
+drawoptions()
+drawshadowed()
+drawunboxed()
+epsilon
+evenly
+exitif
+exitunless
+expr
+Fe_base
+Fe_plus
+fill
+filldraw
+fixpos()
+fixsize()
+floor
+fontsize
+format()
+frame.
+fullcircle
+gdata()
+gdotlabel.
+gdraw
+gdrawarrow
+gdrawdblarrow
+getmid
+gfill
+glabel.
+Gmarks
+Gminlog
+Gpaths
+green
+greenpart
+grid.
+halfcircle
+hex
+hide()
+identity
+image()
+in
+incr()
+infinity
+infont
+init_numbers()
+input
+interim
+intersectionpoint
+intersectiontimes
+inverse
+itick.
+joinup()
+known
+label.
+labeloffset
+labels.
+left
+length
+let
+lft
+linear
+linecap:=
+linejoin:=
+llcorner
+llft
+log
+loggingall
+lrcorner
+lrt
+makepath
+makepen
+mark_angle()
+mark_rt_angle()
+max
+mexp
+mfplain
+middlepoint()
+midpoint()
+min
+mitered
+miterlimit:=
+Mlog
+mlog
+mm
+mod
+month
+mp
+mpxbreak
+Mreadpath()
+Mten
+newinternal
+normaldeviate
+not
+nullpicture
+numeric
+oct
+odd
+or
+origin
+otick.
+OUT
+pair
+path
+pausing
+pc
+pen
+pencircle
+penoffset
+pensquare
+pic
+pickup
+picture
+plot
+point of
+postcontrol
+precontrol
+primarydef enddef
+pt
+quartecircle
+readfrom
+red
+redpart
+reflectedabout()
+reverse
+right
+rotated
+rotatedaround()
+round
+rounded
+rt
+Sabs
+Sadd
+sarith
+save
+scaled
+Scvnum
+Sdiv
+secondarydef enddef
+self
+setbounds to
+setcoords()
+setrange()
+shifted
+shipout
+show
+showdependencies
+showstopping
+showtoken
+showvariable
+sind
+slanted
+Sleq
+Smul
+Sneq
+special
+sqrt
+squared
+Ssub
+step
+str
+string
+stroked
+subpath
+substring
+tertiarydef enddef
+text
+thelabel.
+time
+top
+tracingall
+tracingcapsules
+tracingchoices
+tracingcommands
+tracingequations
+tracinglostchars
+tracingmacros
+tracingnone
+tracingonline
+tracingoutput
+tracingrestores
+tracingspecs
+tracingstats
+tracingtitles
+transform
+transformed
+true
+truecorners:=
+ulcorner
+ulft
+undraw
+unfill
+unfilldraw
+uniformdeviate
+unitsquare
+unitvector
+unknown
+until
+up
+urcorner
+urt
+vardef enddef
+whatever[]
+white
+withcolor
+withdots
+withpen
+write to
+xpart
+xscaled
+xxpart
+xypart
+year
+yscaled
+yxpart
+yypart
+zscaled
diff --git a/src/kile/complete/tex/CMakeLists.txt b/src/kile/complete/tex/CMakeLists.txt
new file mode 100644
index 0000000..83c63a0
--- /dev/null
+++ b/src/kile/complete/tex/CMakeLists.txt
@@ -0,0 +1,100 @@
+
+########### install files ###############
+# get this cwl list with "for i in `ls *.cwl -1`; do echo "$i"; done"
+SET(kile_texCompleteFiles
+ acronym.cwl
+ amsopn.cwl
+ afterpage.cwl
+ amsbsy.cwl
+ amsfonts.cwl
+ amsmath.cwl
+ amssymb.cwl
+ amsthm.cwl
+ array.cwl
+ attachfile.cwl
+ beamerfoils.cwl
+ beamerprosper.cwl
+ beamerseminar.cwl
+ beamertexpower.cwl
+ booktabs.cwl
+ braket.cwl
+ calc.cwl
+ class-beamer.cwl
+ class-letter.cwl
+ class-scrartcl,scrreprt,scrbook.cwl
+ class-scrlttr2.cwl
+ color.cwl
+ colortbl.cwl
+ coordsys.cwl
+ currvita.cwl
+ cyrillic.cwl
+ diagxy.cwl
+ doi.cwl
+ enumerate.cwl
+ fancybox.cwl
+ fancyhdr.cwl
+ fancyunits-base.cwl
+ fancyunits_big-fractions.cwl
+ fancyunits_medium-fractions.cwl
+ fancyunits-np.cwl
+ fancyunits-per.cwl
+ fancyunits_small-fractions.cwl
+ fancyvrb.cwl
+ fontspec.cwl
+ graphicx.cwl
+ hyperref.cwl
+ ifthen.cwl
+ import.cwl
+ jurabib.cwl
+ latex-209.cwl
+ latex-dev.cwl
+ latex-document.cwl
+ latex-l2tabu.cwl
+ latex-mathsymbols.cwl
+ layout.cwl
+ listings.cwl
+ logsys.cwl
+ longtable.cwl
+ lscape.cwl
+ manyfoot.cwl
+ mdwlist.cwl
+ multicol.cwl
+ multido.cwl
+ pdfpages.cwl
+ psfrag.cwl
+ pst-3d.cwl
+ pst-blur.cwl
+ pst-char.cwl
+ pst-coil.cwl
+ pst-eps.cwl
+ pst-fill.cwl
+ pst-node.cwl
+ pst-plot.cwl
+ pstricks.cwl
+ pst-text.cwl
+ pst-tree.cwl
+ rotating.cwl
+ scraddr.cwl
+ scrdate.cwl
+ scrlfile.cwl
+ scrpage2.cwl
+ scrtime.cwl
+ setspace.cwl
+ subfig.cwl
+ supertabular.cwl
+ svninfo.cwl
+ svn-multi.cwl
+ tabularx.cwl
+ tex.cwl
+ textcomp.cwl
+ url.cwl
+ varioref.cwl
+ verse.cwl
+ virginialake.cwl
+ xifthen.cwl
+ xltxtra.cwl
+ xtab.cwl
+ yfonts.cwl
+)
+
+INSTALL( FILES ${kile_texCompleteFiles} DESTINATION share/apps/kile/complete/tex )
diff --git a/src/kile/complete/tex/Makefile.am b/src/kile/complete/tex/Makefile.am
new file mode 100644
index 0000000..97de7d4
--- /dev/null
+++ b/src/kile/complete/tex/Makefile.am
@@ -0,0 +1,95 @@
+texcompletedir = $(kde_datadir)/kile/complete/tex
+texcomplete_DATA = \
+ acronym.cwl \
+ afterpage.cwl \
+ amsbsy.cwl \
+ amsfonts.cwl \
+ amsmath.cwl \
+ amsopn.cwl \
+ amssymb.cwl \
+ amsthm.cwl \
+ array.cwl \
+ attachfile.cwl \
+ beamerfoils.cwl \
+ beamerprosper.cwl \
+ beamerseminar.cwl \
+ beamertexpower.cwl \
+ booktabs.cwl \
+ braket.cwl \
+ calc.cwl \
+ class-beamer.cwl \
+ class-letter.cwl \
+ class-scrartcl,scrreprt,scrbook.cwl \
+ class-scrlttr2.cwl \
+ color.cwl \
+ colortbl.cwl \
+ coordsys.cwl \
+ currvita.cwl \
+ cyrillic.cwl \
+ diagxy.cwl \
+ doi.cwl \
+ enumerate.cwl \
+ fancybox.cwl \
+ fancyhdr.cwl \
+ fancyunits-base.cwl \
+ fancyunits_big-fractions.cwl \
+ fancyunits_medium-fractions.cwl \
+ fancyunits-np.cwl \
+ fancyunits-per.cwl \
+ fancyunits_small-fractions.cwl \
+ fancyvrb.cwl \
+ fontspec.cwl \
+ graphicx.cwl \
+ hyperref.cwl \
+ ifthen.cwl \
+ import.cwl \
+ jurabib.cwl \
+ latex-209.cwl \
+ latex-dev.cwl \
+ latex-document.cwl \
+ latex-l2tabu.cwl \
+ latex-mathsymbols.cwl \
+ layout.cwl \
+ listings.cwl \
+ logsys.cwl \
+ longtable.cwl \
+ lscape.cwl \
+ manyfoot.cwl \
+ mdwlist.cwl \
+ multicol.cwl \
+ multido.cwl \
+ pdfpages.cwl \
+ psfrag.cwl \
+ pst-3d.cwl \
+ pst-blur.cwl \
+ pst-char.cwl \
+ pst-coil.cwl \
+ pst-eps.cwl \
+ pst-fill.cwl \
+ pst-node.cwl \
+ pst-plot.cwl \
+ pstricks.cwl \
+ pst-text.cwl \
+ pst-tree.cwl \
+ rotating.cwl \
+ scraddr.cwl \
+ scrdate.cwl \
+ scrlfile.cwl \
+ scrpage2.cwl \
+ scrtime.cwl \
+ setspace.cwl \
+ subfig.cwl \
+ supertabular.cwl \
+ svninfo.cwl \
+ svn-multi.cwl \
+ tabularx.cwl \
+ tex.cwl \
+ textcomp.cwl \
+ url.cwl \
+ varioref.cwl \
+ verse.cwl \
+ virginialake.cwl \
+ xifthen.cwl \
+ xltxtra.cwl \
+ xtab.cwl \
+ yfonts.cwl
diff --git a/src/kile/complete/tex/acronym.cwl b/src/kile/complete/tex/acronym.cwl
new file mode 100644
index 0000000..4e504db
--- /dev/null
+++ b/src/kile/complete/tex/acronym.cwl
@@ -0,0 +1,38 @@
+# acronym package
+# ygrange 04/16/2007
+# URL: http://www.ctan.org/tex-archive/help/Catalogue/entries/acronym.html
+
+\begin{acronym}
+\begin{acronym}[longest]
+\acro{acronym}{full name}
+\acro{acronym}[short name]{full name}
+\acroextra{additional info}
+\end{acronym}
+\acresetall
+\ac{acronym}
+\ac*{acronym}
+\acf{acronym}
+\acf*{acronym}
+\acs{acronym}
+\acs*{acronym}
+\acl{acronym}
+\acl*{acronym}
+\acp{acronym}
+\acp*{acronym}
+\acfp{acronym}
+\acfp*{acronym}
+\acsp{acronym}
+\acsp*{acronym}
+\aclp{acronym}
+\aclp*{acronym}
+\acfi{acronym}
+\acfi*{acronym}
+\acsu{acronym}
+\acsu*{acronym}
+\aclu{acronym}
+\aclu*{acronym}
+\acused{acronym}
+\acsfont
+\acffont
+\acfsfont
+
diff --git a/src/kile/complete/tex/afterpage.cwl b/src/kile/complete/tex/afterpage.cwl
new file mode 100644
index 0000000..7feead7
--- /dev/null
+++ b/src/kile/complete/tex/afterpage.cwl
@@ -0,0 +1,3 @@
+# tex/latex mode: Tex commands
+# neeraavi 20 Mar 2007
+\afterpage{command}
diff --git a/src/kile/complete/tex/amsbsy.cwl b/src/kile/complete/tex/amsbsy.cwl
new file mode 100644
index 0000000..6999e8f
--- /dev/null
+++ b/src/kile/complete/tex/amsbsy.cwl
@@ -0,0 +1,4 @@
+# Commands from AMSBSY package
+# neeraavi 22 Mar 2007
+\boldsymbol{symbol}
+\pmb{symbol}
diff --git a/src/kile/complete/tex/amsfonts.cwl b/src/kile/complete/tex/amsfonts.cwl
new file mode 100644
index 0000000..69d97fd
--- /dev/null
+++ b/src/kile/complete/tex/amsfonts.cwl
@@ -0,0 +1,33 @@
+# tbraun
+# ctan: amsfonts package
+# 07/13/2007
+
+\ulcorner
+\urcorner
+\llcorner
+\lrcorner
+\dashrightarrow
+\dashleftarrow
+\rightleftharpoons
+\angle
+\hbar
+\sqsubset
+\sqsupset
+\mho
+\mathfrak
+\square
+\lozenge
+\mathbb{text}
+\mathfrak{text}
+\mathbf{text}
+\vartriangleright
+\vartriangleleft
+\trianglerighteq
+\trianglelefteq
+\rightsquigarrow
+\lhd
+\unlhd
+\rhd
+\unrhd
+\widehat{letter}
+\widetilde{letter}
diff --git a/src/kile/complete/tex/amsmath.cwl b/src/kile/complete/tex/amsmath.cwl
new file mode 100644
index 0000000..8f99252
--- /dev/null
+++ b/src/kile/complete/tex/amsmath.cwl
@@ -0,0 +1,142 @@
+# mode: amsmath.sty
+# dani/2006-02-19
+\AmS
+\AmSfont
+\begin{align}
+\begin{align*}
+\begin{alignat}[alignment]{n}
+\begin{alignat*}[alignment]{n}
+\begin{alignat}{n}
+\begin{alignat*}{n}
+\begin{aligned}
+\begin{aligned}[alignment]
+\begin{alignedat}
+\begin{bmatrix}
+\begin{Bmatrix}
+\begin{cases}
+\begin{equation*}
+\begin{flalign}
+\begin{flalign*}
+\begin{gather}
+\begin{gather*}
+\begin{gathered}
+\begin{gathered}[alignment]
+\begin{matrix}
+\begin{multline}
+\begin{multline*}
+\begin{pmatrix}
+\begin{smallmatrix}
+\begin{split}
+\begin{subarray}
+\begin{subarray}[align]
+\begin{subequations}
+\begin{vmatrix}
+\begin{Vmatrix}
+\begin{xalignat}
+\begin{xalignat*}
+\begin{xxalignat}
+\binom{above}{below}
+\boxed{argument}
+\cfrac[align]{numerator}{denominator}
+\cfrac{numerator}{denominator}
+\dbinom{above}{below}
+\ddddot{text}
+\dddot{text}
+\DeclareMathOperator{command}{text}
+\DeclareMathOperator*{command}{text}
+\dfrac{numerator}{denominator}
+\displaybreak
+\displaybreak[value]
+\dotsb
+\dotsc
+\dotsi
+\dotsm
+\dotso
+\end{align}
+\end{align*}
+\end{alignat}
+\end{alignat*}
+\end{aligned}
+\end{alignedat}
+\end{bmatrix}
+\end{Bmatrix}
+\end{cases}
+\end{equation*}
+\end{flalign}
+\end{flalign*}
+\end{gather}
+\end{gather*}
+\end{gathered}
+\end{matrix}
+\end{multline}
+\end{multline*}
+\end{pmatrix}
+\end{smallmatrix}
+\end{split}
+\end{subarray}
+\end{subequations}
+\end{vmatrix}
+\end{Vmatrix}
+\end{xalignat}
+\end{xalignat*}
+\end{xxalignat}
+\eqref{label}
+\hdotsfor{columns}
+\hdotsfor[multiplier]{columns}
+\idotsint
+\iiiint
+\iiint
+\iint
+\impliedby
+\implies
+\intertext{word or phrase}
+\leftroot{argument}
+\lvert
+\lVert
+\medspace
+\mod{value}
+\mspace{dimen}
+\negmedspace
+\negthickspace
+\negthinspace
+\nobreakdash
+\notag
+\operatorname{name}
+\operatornamewithlimits{name}
+\overleftrightarrow{argument}
+\overset{superscript}{argument}
+\pod{value}
+\raisetag{dimen}
+\rvert
+\rVert
+\sideset{left}{right}{symbol}
+\smash{argument}
+\smash[valign]{argument}
+\substack{argument}
+\tag{label}
+\tag*{label}
+\tbinom{above}{below}
+\text{word or phrase}
+\tfrac{numerator}{denominator}
+\thickspace
+\thinspace
+\underleftarrow{argument}
+\underleftrightarrow{argument}
+\underrightarrow{argument}
+\underset{subscript}{argument}
+\uproot{argument}
+\varDelta
+\varGamma
+\varLambda
+\varOmega
+\varPhi
+\varPi
+\varPsi
+\varSigma
+\varTheta
+\varUpsilon
+\varXi
+\xleftarrow[subscript]{superscript}
+\xleftarrow{superscript}
+\xrightarrow[subscript]{superscript}
+\xrightarrow{superscript}
diff --git a/src/kile/complete/tex/amsopn.cwl b/src/kile/complete/tex/amsopn.cwl
new file mode 100644
index 0000000..44a85e1
--- /dev/null
+++ b/src/kile/complete/tex/amsopn.cwl
@@ -0,0 +1,42 @@
+# amsopn package
+# tbraun 4/09/2007
+\nolimits
+\arccos
+\arcsin
+\arctan
+\arg
+\cos
+\cosh
+\cot
+\coth
+\csc
+\deg
+\det
+\dim
+\exp
+\gcd
+\hom
+\inf
+\injlim
+\ker
+\lg
+\lim
+\liminf
+\limsup
+\ln
+\log
+\max
+\min
+\Pr
+\projlim
+\sec
+\sin
+\sinh
+\sup
+\tan
+\tanh
+\operatornamewithlimits
+\varinjlim
+\varprojlim
+\varliminf
+\varlimsup
diff --git a/src/kile/complete/tex/amssymb.cwl b/src/kile/complete/tex/amssymb.cwl
new file mode 100644
index 0000000..30f9980
--- /dev/null
+++ b/src/kile/complete/tex/amssymb.cwl
@@ -0,0 +1,207 @@
+# amssymb package
+# tbraun 01.06.2007
+\approxeq
+\backepsilon
+\backprime
+\backsim
+\backsimeq
+\barwedge
+\Bbbk
+\because
+\beth
+\between
+\bigstar
+\blacklozenge
+\blacksquare
+\blacktriangle
+\blacktriangledown
+\blacktriangleleft
+\blacktriangleright
+\boxdot
+\boxminus
+\boxplus
+\boxtimes
+\bumpeq
+\Bumpeq
+\Cap
+\centerdot
+\circeq
+\circlearrowleft
+\circlearrowright
+\circledast
+\circledcirc
+\circleddash
+\circledS
+\complement
+\Cup
+\curlyeqprec
+\curlyeqsucc
+\curlyvee
+\curlywedge
+\curvearrowleft
+\curvearrowright
+\daleth
+\diagdown
+\diagup
+\digamma
+\divideontimes
+\doteqdot
+\dotplus
+\doublebarwedge
+\downdownarrows
+\downharpoonleft
+\downharpoonright
+\eqcirc
+\eqsim
+\eqslantgtr
+\eqslantless
+\eth
+\fallingdotseq
+\Finv
+\Game
+\geqq
+\geqslant
+\ggg
+\gimel
+\gnapprox
+\gneq
+\gneqq
+\gnsim
+\gtrapprox
+\gtrdot
+\gtreqless
+\gtreqqless
+\gtrless
+\gtrsim
+\gvertneqq
+\hslash
+\intercal
+\leftarrowtail
+\leftleftarrows
+\leftrightarrows
+\leftrightharpoons
+\leftrightsquigarrow
+\leftthreetimes
+\leqq
+\leqslant
+\lessapprox
+\lessdot
+\lesseqgtr
+\lesseqqgtr
+\lessgtr
+\lesssim
+\Lleftarrow
+\lll
+\lnapprox
+\lneq
+\lneqq
+\lnsim
+\looparrowleft
+\looparrowright
+\lozenge
+\Lsh
+\ltimes
+\lvertneqq
+\measuredangle
+\multimap
+\ncong
+\nexists
+\ngeq
+\ngeqq
+\ngeqslant
+\ngtr
+\nleftarrow
+\nLeftarrow
+\nleftrightarrow
+\nLeftrightarrow
+\nleq
+\nleqq
+\nleqslant
+\nless
+\nmid
+\nparallel
+\nprec
+\npreceq
+\nrightarrow
+\nRightarrow
+\nshortmid
+\nshortparallel
+\nsim
+\nsubseteq
+\nsubseteqq
+\nsucc
+\nsucceq
+\nsupseteq
+\nsupseteqq
+\ntriangleleft
+\ntrianglelefteq
+\ntriangleright
+\ntrianglerighteq
+\nvdash
+\nvDash
+\nVdash
+\nVDash
+\pitchfork
+\precapprox
+\preccurlyeq
+\precnapprox
+\precneqq
+\precnsim
+\precsim
+psamsfonts
+\rightarrowtail
+\rightleftarrows
+\rightrightarrows
+\rightsquigarrow
+\rightthreetimes
+\risingdotseq
+\Rrightarrow
+\Rsh
+\rtimes
+\shortmid
+\shortparallel
+\smallfrown
+\smallsetminus
+\smallsmile
+\sphericalangle
+\square
+\Subset
+\subseteqq
+\subsetneq
+\subsetneqq
+\succapprox
+\succcurlyeq
+\succnapprox
+\succneqq
+\succnsim
+\succsim
+\Supset
+\supseteqq
+\supsetneq
+\supsetneqq
+\therefore
+\thickapprox
+\thicksim
+\triangledown
+\trianglelefteq
+\triangleq
+\trianglerighteq
+\twoheadleftarrow
+\twoheadrightarrow
+\upharpoonleft
+\upharpoonright
+\upuparrows
+\varkappa
+\varnothing
+\varpropto
+\varsubsetneq
+\varsubsetneqq
+\varsupsetneq
+\varsupsetneqq
+\vartriangle
+\vartriangleleft
+\vartriangleright
+\vDash
+\Vdash
+\veebar
+\Vvdash
diff --git a/src/kile/complete/tex/amsthm.cwl b/src/kile/complete/tex/amsthm.cwl
new file mode 100644
index 0000000..c1fbb4e
--- /dev/null
+++ b/src/kile/complete/tex/amsthm.cwl
@@ -0,0 +1,18 @@
+# amsthm
+# Ryan Reich/2007-11-03
+# http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=amsthm
+\newtheorem{envname}{caption}
+\newtheorem{envname}{caption}[within]
+\newtheorem{envname}[numberedlike]{caption}
+\newtheorem*{envname}{caption}
+\newtheorem*{envname}{caption}[within]
+\newtheorem*{envname}[numberedlike]{caption}
+\theoremstyle{style}
+\swapnumbers
+\newtheoremstyle{stylename}{spaceabove}{spacebelow}{bodyfont}{indentamt}{headfont}{headpunct}{headspace}{headspec}
+\begin{proof}
+\begin{proof}[caption]
+\end{proof}
+\qedsymbol
+\qedhere
+\qed
diff --git a/src/kile/complete/tex/array.cwl b/src/kile/complete/tex/array.cwl
new file mode 100644
index 0000000..c50bb6c
--- /dev/null
+++ b/src/kile/complete/tex/array.cwl
@@ -0,0 +1,8 @@
+# mode: array.sty
+# dani/2006-02-18
+\extrarowheight
+\extratabsurround
+\firsthline
+\lasthline
+\newcolumntype{name}{argument}
+\showcols
diff --git a/src/kile/complete/tex/attachfile.cwl b/src/kile/complete/tex/attachfile.cwl
new file mode 100644
index 0000000..4a2d4e7
--- /dev/null
+++ b/src/kile/complete/tex/attachfile.cwl
@@ -0,0 +1,12 @@
+# attachfile package
+# mario 09/06/2007
+# URL: http://tug.ctan.org/tex-archive/macros/latex/contrib/attachfile/
+\attachfile[options]{filename}
+\attachfile{filename}
+\attachfilesetup{options}
+\noattachfile[options]
+\notextattachfile[options]{text}
+\notextattachfile{text}
+\textattachfile[options]{filename}{text}
+\textattachfile{filename}{text}
+
diff --git a/src/kile/complete/tex/beamerfoils.cwl b/src/kile/complete/tex/beamerfoils.cwl
new file mode 100644
index 0000000..a86de00
--- /dev/null
+++ b/src/kile/complete/tex/beamerfoils.cwl
@@ -0,0 +1,17 @@
+# tbraun 11/5/2006
+# added commands for beamer emulation package
+\begin{boldequation}*
+\begin{boldequation}
+\end{boldequation}
+\MyLogo{logo text}
+\LogoOn
+\LogoOff
+\foilhead[dimension]{frame title}
+\foilhead{frame title}
+\rotatefoilhead[dimension]{frame title}
+\rotatefoilhead{frame title}
+\endfoil
+\FoilTeX
+\bm{text}
+\bmstyle{text}{more text}
+
diff --git a/src/kile/complete/tex/beamerprosper.cwl b/src/kile/complete/tex/beamerprosper.cwl
new file mode 100644
index 0000000..7834175
--- /dev/null
+++ b/src/kile/complete/tex/beamerprosper.cwl
@@ -0,0 +1,49 @@
+# tbraun 11/5/2006
+# added commands for beamer emulation package
+\begin{slides}[options]{frame title}
+\begin{slides}{frame title}
+\end{slides}
+\begin{notes}{title}
+\end{notes}
+\begin{Itemize}\item
+\end{Itemize}
+\begin{itemstep}\item
+\end{itemstep}
+\begin{enumstep}\item
+\end{enumstep}
+\email{text}
+\institution{text}
+\Logo(x,y){logo}
+\Logo{logo}
+\overlays{number}{slide environment}
+\fromSlide{slide number}{text}
+\fromSlide*{slide number}{text}
+\fromSlide{slide number}{text}
+\onlySlide{slide number}{text}
+\onlySlide*{slide number}{text}
+\onlySlide{slide number}{text}
+\untilSlide{slide number}{text}
+\untilsSlide*{slide number}{text}
+\untilsSlide{slide number}{text}
+\FromSlide{slide number}
+\OnlySlide{slide number}
+\UntilSlide{slide number}
+\slideCaption{text}
+\fontTitle{text}
+\fontText{text}
+\PDFtransition{prosper transition}
+\hiddenitem
+\prosperpart[options]{text}
+\prosperpart{text}
+\tsection*{section name}
+\tsection{section name}
+\tsectionandpart*{part text}
+\tsectionandpart{part text}
+\dualslide[x][y][z]{options}{left column}{right column}
+\dualslide[y][z]{options}{left column}{right column}
+\dualslide[z]{options}{left column}{right column}
+\dualslide{options}{left column}{right column}
+\PDForPS{PostScript text}{PDF text}
+\onlyInPDF<PDF text>
+\onlyInPS<PS text>
+
diff --git a/src/kile/complete/tex/beamerseminar.cwl b/src/kile/complete/tex/beamerseminar.cwl
new file mode 100644
index 0000000..92ef4d0
--- /dev/null
+++ b/src/kile/complete/tex/beamerseminar.cwl
@@ -0,0 +1,14 @@
+# tbraun 11/5/2006
+# added commands for beamer emulation package
+\begin{slide}*
+\begin{slide}
+\end{slide}
+\overlay{number}
+\red
+\blue
+\green
+\ifslide
+\ifslidesonly
+\ifarticle
+\ifportrait
+
diff --git a/src/kile/complete/tex/beamertexpower.cwl b/src/kile/complete/tex/beamertexpower.cwl
new file mode 100644
index 0000000..40c739e
--- /dev/null
+++ b/src/kile/complete/tex/beamertexpower.cwl
@@ -0,0 +1,21 @@
+# tbraun 11/5/2006
+# added commands for beamer emulation package
+\stepwise{text}
+\parstepwise{text}
+\liststepwise{text}
+\step{text}
+\steponce{text}
+\switch{alternate text}{text}
+\bstep{text}
+\dstep
+\vstep
+\restep{text}
+\reswitch{alternate text}<text>
+\rebstep<text>
+\redstep
+\revstep
+\boxedsteps
+\nonboxedsteps
+\code{text}
+\codeswitch
+
diff --git a/src/kile/complete/tex/booktabs.cwl b/src/kile/complete/tex/booktabs.cwl
new file mode 100644
index 0000000..7606fcd
--- /dev/null
+++ b/src/kile/complete/tex/booktabs.cwl
@@ -0,0 +1,15 @@
+# mode: booktabs.sty
+# dani/2006-02-18
+\addlinespace
+\addlinespace[space]
+\bottomrule
+\bottomrule[width]
+\cmidrule{a-b}
+\cmidrule(trim){a-b}
+\cmidrule[width](trim){a-b}
+\midrule
+\midrule[width]
+\morecmidrules
+\specialrule[width]{abovespace}{belowspace}
+\toprule
+\toprule[width]
diff --git a/src/kile/complete/tex/braket.cwl b/src/kile/complete/tex/braket.cwl
new file mode 100644
index 0000000..336ab5e
--- /dev/null
+++ b/src/kile/complete/tex/braket.cwl
@@ -0,0 +1,8 @@
+\bra{text}
+\Bra{text}
+\ket{text}
+\Ket{text}
+\braket{text}
+\Braket{text}
+\set{text}
+\Set{text}
diff --git a/src/kile/complete/tex/calc.cwl b/src/kile/complete/tex/calc.cwl
new file mode 100644
index 0000000..4ebf3c1
--- /dev/null
+++ b/src/kile/complete/tex/calc.cwl
@@ -0,0 +1,21 @@
+# calc package
+# nja 17 July 2007
+# url: http://www.ctan.org/tex-archive/help/Catalogue/entries/calc.html
+
+\setcounter{ctr}{num}
+\addtocounter{ctr}{num}
+\setlength{cmd}{len}
+\addtolength{cmd}{len}
+
+\real{decimal constant}
+\ratio{dimen expression}{dimen expression}
+
+\widthof{text}
+\heightof{text}
+\depthof{text}
+\totalheightof{text}
+\settototalheight{cmd}{text}
+
+\maxof{type expression}{type expression}
+\minof{type expression}{type expression}
+
diff --git a/src/kile/complete/tex/class-beamer.cwl b/src/kile/complete/tex/class-beamer.cwl
new file mode 100644
index 0000000..5575a8b
--- /dev/null
+++ b/src/kile/complete/tex/class-beamer.cwl
@@ -0,0 +1,446 @@
+# tbraun 11/5/2006
+# added most/all beamer commands
+# be sure to use an up to date kile svn version, only that will work properly with the strange syntax here
+# 11/24/2006 added missing commands, thanks to Marco Bertolini
+\begin{frame}
+\begin{frame}<overlay specification>
+\begin{frame}<overlay specification>[<default overlay specification>]
+\begin{frame}<overlay specification>[<default overlay specification>][options]
+\begin{frame}<overlay specification>[<default overlay specification>][options]{title}
+\begin{frame}<overlay specification>[<default overlay specification>][options]{title}{subtitle}
+\begin{frame}[<default overlay specification>]
+\begin{frame}[<default overlay specification>][options]
+\begin{frame}[<default overlay specification>][options]{title}
+\begin{frame}[<default overlay specification>][options]{title}{subtitle}
+\begin{frame}[<default overlay specification>][options]{title}{subtitle}
+\begin{frame}[options]
+\begin{frame}[options]{title}
+\begin{frame}[options]{title}{subtitle}
+\begin{frame}[options]{title}{subtitle}
+\begin{frame}{title}
+\begin{frame}{subtitle}
+\end{frame}
+\begin{thebibliography}{longest label text}
+\end{thebibliography}
+\begin{itemize}[<default overlay specification>]\item
+\begin{itemize}\item
+\end{itemize}
+\begin{enumerate}[<default overlay specification>][mini template]\item
+\begin{enumerate}[mini template]\item
+\begin{enumerate}\item
+\end{enumerate}
+\begin{description}[<default overlay specification>][long text]\item
+\begin{description}[long text]\item
+\begin{description}\item
+\end{description}
+\begin{structureenv}<overlay specification>
+\begin{structureenv}
+\end{structureenv}
+\begin{alertenv}<overlay specification>
+\begin{alertenv}
+\end{alertenv}
+\begin{block}<action specification>{block title}<action specification>
+\end{block}
+\begin{alertblock}<action specification>{block title}<action specification>
+\end{alertblock}
+\begin{exampleblock}<action specification>{block title}<overlay specification>
+\end{exampleblock}
+\begin{theorem}<action specification>[additional text]<action specification>
+\begin{theorem}<action specification><action specification>
+\end{theorem}
+\begin{definition}<action specification>[additional text]<action specification>
+\begin{definition}<action specification><action specification>
+\end{definition}
+\begin{example}<action specification>[additional text]<action specification>
+\begin{example}<action specification><action specification>
+\end{example}
+\begin{proof}<action specification>[proof name]<action specification>
+\begin{proof}<action specification><action specification>
+\end{proof}
+\begin{beamercolorbox}[options]{beamer color}
+\begin{beamercolorbox}{beamer color}
+\end{beamercolorbox}
+\begin{beamerboxesrounded}[options]{head}
+\begin{beamerboxesrounded}{head}
+\end{beamerboxesrounded}
+\begin{columns}[options]
+\begin{columns}
+\end{columns}
+\begin{column}[placement]{column width}
+\begin{column}{column width}
+\end{column}
+\begin{semiverbatim}
+\end{semiverbatim}
+\begin{abstract}<action specification>
+\end{abstract}
+\begin{verse}<action specification>
+\end{verse}
+\begin{quotation}<action specification>
+\end{quotation}
+\begin{quote}<action specification>
+\end{quote}
+\begin{onlyenv}<overlay specification>
+\begin{onlyenv}
+\end{onlyenv}
+\begin{altenv}<overlay specification>{begin text}{end text}{alternate begin text}{alternate end text}<overlay specification>
+\begin{altenv}{begin text}{end text}{alternate begin text}{alternate end text}<overlay specification>
+\end{altenv}
+\begin{overlayarea}{area width}{area height}
+\end{overlayarea}
+\begin{overprint}[area width]
+\begin{overprint}
+\end{overprint}
+\begin{actionenv}<action specification>
+\end{actionenv}
+\movie[options]{poster text}{movie filename}
+\movie{poster text}{movie filename}
+\hyperlinkmovie[options]{movie label}{text}
+\hyperlinkmovie{movie label}{text}
+\animate
+\animate<overlay specification>
+\animatevalue<start slide - end slide>{name}{start value}{end value}
+\animatevalue{name}{start value}{end value}
+\multiinclude[<default overlay specification>][options]{base file name}
+\multiinclude[options]{base file name}
+\multiinclude{base file name}
+\sound[options]{sound poster text}{sound filename}
+\sound{sound poster text}{sound filename}
+\hyperlinksound[options]{sound label}{text}
+\hyperlinksound{sound label}{text}
+\hyperlinkmute{text}
+\transblindshorizontal<overlay specification>[options]
+\transblindshorizontal<overlay specification>
+\transblindshorizontal[options]
+\transblindshorizontal
+\transblindsvertical<overlay specification>[options]
+\transblindsvertical<overlay specification>
+\transblindsvertical[options]
+\transblindsvertical
+\transboxin<overlay specification>[options]
+\transboxin<overlay specification>
+\transboxin[options]
+\transboxin
+\transboxout<overlay specification>[options]
+\transboxout<overlay specification>
+\transboxout[options]
+\transboxout
+\transdissolve<overlay specification>[options]
+\transdissolve<overlay specification>
+\transdissolve[options]
+\transdissolve
+\transglitter<overlay specification>[options]
+\transglitter<overlay specification>
+\transglitter[options]
+\transglitter
+\transsplitverticalin<overlay specification>[options]
+\transsplitverticalin<overlay specification>
+\transsplitverticalin[options]
+\transsplitverticalin
+\transsplitverticalout<overlay specification>[options]
+\transsplitverticalout<overlay specification>
+\transsplitverticalout[options]
+\transsplitverticalout
+\transsplithorizontalin<overlay specification>[options]
+\transsplithorizontalin<overlay specification>
+\transsplithorizontalin[options]
+\transsplithorizontalin
+\transsplithorizontalout<overlay specification>[options]
+\transsplithorizontalout<overlay specification>
+\transsplithorizontalout[options]
+\transsplithorizontalout
+\transwipe<overlay specification>[options]
+\transwipe<overlay specification>
+\transwipe[options]
+\transwipe
+\transduration<overlay specification>{number of seconds}
+\transduration{number of seconds}
+\usebeamercolor*[fg or bg]{beamer-color name}
+\usebeamercolor*{beamer-color name}
+\usebeamercolor[fg or bg]{beamer-color name}
+\usebeamercolor{beamer-color name}
+\ifbeamercolorempty[fg or bg]{beamer-color name}{if undefined}{if defined}
+\ifbeamercolorempty{beamer-color name}{if undefined}{if defined}
+\setbeamercolor*{beamer-color name}{options}
+\setbeamercolor{beamer-color name}{options}
+\setbeamercovered{options}
+\opaqueness{percentage of opaqueness}
+\opaqueness<overlay specification>{percentage of opaqueness}
+\opaqueness{percentage of opaqueness}
+\usebeamertemplate{element name}
+\usebeamertemplate*{element name}
+\usebeamertemplate**{element name}
+\usebeamertemplate***{element name}
+\ifbeamertemplateempty{beamer template name}{executed if empty}{executed otherwise}
+\expandbeamertemplate{beamer template name}
+\setbeamertemplate{element name}[predefined option]{args}
+\setbeamertemplate{element name}{args}
+\addtobeamertemplate{element name}{pre-text}{post-text}
+\defbeamertemplate<mode specification>*{element name}{predefined option}[argument number][default optional argument]{predefined text}[action]{action command}
+\defbeamertemplate<mode specification>*{element name}{predefined option}[default optional argument]{predefined text}[action]{action command}
+\defbeamertemplate<mode specification>*{element name}{predefined option}{predefined text}[action]{action command}
+\defbeamertemplate<mode specification>*{element name}{predefined option}[argument number][default optional argument]{predefined text}
+\defbeamertemplate<mode specification>*{element name}{predefined option}[argument number]{predefined text}
+\defbeamertemplate<mode specification>*{element name}{predefined option}{predefined text}
+\defbeamertemplate{element name}{predefined option}[argument number][default optional argument]{predefined text}[action]{action command}
+\defbeamertemplate{element name}{predefined option}[default optional argument]{predefined text}[action]{action command}
+\defbeamertemplate{element name}{predefined option}{predefined text}[action]{action command}
+\defbeamertemplate{element name}{predefined option}[argument number][default optional argument]{predefined text}
+\defbeamertemplate{element name}{predefined option}[argument number]{predefined text}
+\defbeamertemplate{element name}{predefined option}{predefined text}
+\defbeamertemplatealias{element name}{new predefined option name}{existing predefined option name}
+\defbeamertemplateparent{parent template name}[predefined option name]{child template list} [argument number][default optional argument]{arguments for children}
+\defbeamertemplateparent{parent template name}{child template list} [argument number][default optional argument]{arguments for children}
+\defbeamertemplateparent{parent template name}{child template list} [default optional argument]{arguments for children}
+\defbeamertemplateparent{parent template name}{child template list} {arguments for children}
+\usebeamerfont*{beamer-font name}
+\usebeamerfont{beamer-font name}
+\setbeamerfont*{beamer-font name}{attributes}
+\setbeamerfont{beamer-font name}{attributes}
+\insertnavigation
+\insertpagenumber
+\insertsection
+\insertsectionnavigation
+\insertsectionnavigationhorizontal
+\insertshortauthor
+\insertshortdate
+\insertshortinstitute
+\insertshortpart
+\insertshorttitle
+\insertshortsubtitle
+\insertsubsection
+\insertsubsectionnavigation
+\insertsubsectionnavigationhorizontal
+\insertverticalnavigation
+\insertframenumber
+\inserttotalframenumber
+\insertframestartpage
+\insertframeendpage
+\insertsubsectionstartpage
+\insertsubsectionendpage
+\insertsectionstartpage
+\insertsectionendpage
+\insertpartstartpage
+\insertpartendpage
+\insertpresentationstartpage
+\insertpresentationendpage
+\insertappendixstartpage
+\insertappendixendpage
+\insertdocumentstartpage
+\insertdocumentendpage
+\setbeamersize{}
+\insertsectionhead
+\insertsectionheadnumber
+\insertpartheadnumber
+\insertsubsectionhead
+\insertsubsectionheadnumber
+\insertslidenavigationsymbol
+\insertframenavigationsymbol
+\insertsubsectionnavigationsymbol
+\insertsectionnavigationsymbol
+\insertdocnavigationsymbol
+\insertbackfindforwardnavigationsymbol
+\insertenumlabel
+\insertenumlabel
+\insertsubsubenumlabel
+\insertdescriptionitem
+\inserttheoremheadfont
+\inserttheoremname
+\inserttheoremnumber
+\inserttheoremaddition
+\inserttheorempunctuation
+\insertcaption
+\insertcaptionname
+\insertcaptionnumber
+\insertfootnotetext
+\insertfootnotemark
+\insertnote
+\insertslideintonotes
+\logo{logo text}
+\insertlogo
+\frametitle<overlay specification>[short frame title]{frame title text}
+\frametitle<overlay specification>{frame title text}
+\frametitle[short frame title]{frame title text}
+\frametitle{frame title text}
+\framesubtitle<overlay specification>{frame subtitle text}
+\framesubtitle{frame subtitle text}
+\setbeamersize{options}
+\titlepage
+\maketitle
+\title[short title]{title}
+\title{title}
+\subtitle[short subtitle]{subtitle}
+\subtitle{subtitle}
+\author[short author names]{author names}
+\author{author names}
+\institute[short institute]{institute}
+\institute{institute}
+\date[short date]{date}
+\date{date}
+\titlegraphic{text}
+\subject{text}
+\keywords{text}
+\section<mode specification>[short section name]{section name}
+\section<mode specification>{section name}
+\section[short section name]{section name}
+\section{section name}
+\section<mode specification>*[short section name]{section name}
+\section<mode specification>*{section name}
+\section*[short section name]{section name}
+\section*{section name}
+\subsection<mode specification>[short section name]{section name}
+\subsection<mode specification>{section name}
+\subsection[short section name]{section name}
+\subsection{section name}
+\subsection<mode specification>*[short section name]{section name}
+\subsection<mode specification>*{section name}
+\subsection*[short section name]{section name}
+\subsection*{section name}
+\subsubsection<mode specification>[short section name]{section name}
+\subsubsection<mode specification>{section name}
+\subsubsection[short section name]{section name}
+\subsubsection{section name}
+\subsubsection<mode specification>*[short section name]{section name}
+\subsubsection<mode specification>*{section name}
+\subsubsection*[short section name]{section name}
+\subsubsection*{section name}
+\AtBeginSection[special star text]{text}
+\AtBeginSection{text}
+\AtBeginSubsection[special star text]{text}
+\AtBeginSubsection{text}
+\AtBeginSubsubsection[special star text]{text}
+\AtBeginSubsubsection{text}
+\part<mode specification>[short part name]{part name}
+\part<mode specification>{part name}
+\part[short part name]{part name}
+\part{part name}
+\partpage
+\AtBeginPart{text}
+\lecture[short lecture name]{lecture name}{lecture label}
+\lecture{lecture name}{lecture label}
+\includeonlylecture{lecture label}
+\AtBeginLecture{text}
+\tableofcontents[comma-separated option list]
+\tableofcontents
+\bibitem<overlay specification>[citation text]{label name}
+\bibitem<overlay specification>{label name}
+\bibitem[citation text]{label name}
+\bibitem{label name}
+\appendix<mode specification>
+\appendix
+\hypertarget<overlay specification>{target name}{text}
+\hypertarget{target name}{text}
+\beamerbutton{button text}
+\beamergotobutton{button text}
+\beamerskipbutton{button text}
+\beamerreturnbutton{button text}
+\hyperlink<overlay specification>{target name}{link text}<overlay specification>
+\hyperlink{target name}{link text}<overlay specification>
+\hyperlink{target name}{link text}
+\hyperlinkslideprev<overlay specification>{link text}
+\hyperlinkslideprev{link text}
+\hyperlinkslidenext<overlay specification>{link text}
+\hyperlinkslidenext{link text}
+\hyperlinkframestart<overlay specification>{link text}
+\hyperlinkframestart{link text}
+\hyperlinkframeend<overlay specification>{link text}
+\hyperlinkframeend{link text}
+\hyperlinkframestartnext<overlay specification>{link text}
+\hyperlinkframestartnext{link text}
+\hyperlinkframeendprev<overlay specification>{link text}
+\hyperlinkframeendprev{link text}
+\hyperlinkpresentationstart<overlay specification>{link text}
+\hyperlinkpresentationstart{link text}
+\hyperlinkpresentationend<overlay specification>{link text}
+\hyperlinkpresentationend{link text}
+\hyperlinkappendixstart<overlay specification>{link text}
+\hyperlinkappendixstart{link text}
+\hyperlinkappendixend<overlay specification>{link text}
+\hyperlinkappendixend{link text}
+\hyperlinkdocumentstart<overlay specification>{link text}
+\hyperlinkdocumentstart{link text}
+\hyperlinkdocumentend<overlay specification>{link text}
+\hyperlinkdocumentend{link text}
+\againframe<overlay specification>[<default overlay specification>][options]{name}
+\againframe<overlay specification>[options]{name}
+\againframe<overlay specification>{name}
+\againframe[<default overlay specification>][options]{name}
+\againframe[options]{name}
+\againframe{name}
+\framezoom<button overlay specification><zoomed overlay specification>[options](upper left x,upper left y)(zoom area width,zoom area depth)
+\framezoom<button overlay specification><zoomed overlay specification>(upper left x,upper left y)(zoom area width,zoom area depth)
+\structure<overlay specification>{text}
+\structure{text}
+\alert<overlay specification>{highlighted text}
+\alert{highlighted text}
+\newtheorem*{environment name}[numbered same as]{head text}[number within]
+\newtheorem*{environment name}{head text}[number within]
+\newtheorem*{environment name}{head text}
+\newtheorem{environment name}[numbered same as]{head text}[number within]
+\newtheorem{environment name}{head text}[number within]
+\newtheorem{environment name}{head text}
+\footnote<overlay specification>[options]{text}
+\footnote<overlay specification>{text}
+\footnote[options]{text}
+\footnote{text}
+\setjobnamebeamerversion{filename without extension}
+\includeslide[options]{label name}
+\includeslide{label name}
+\mode<mode specification>{text}
+\mode{text}
+\mode<mode specification>
+\mode*
+\mode
+\note<overlay specification>[options]{note text}
+\note<overlay specification>{note text}
+\note[options]{note text}
+\note{note text}
+\AtBeginNote{text}
+\AtEndNote{text}
+\pause[number]
+\pause
+\onslide<overlay specification>{text}
+\onslide+<overlay specification>{text}
+\onslide*<overlay specification>{text}
+\onslide<overlay specification>
+\onslide
+\only<overlay specification>{text}<overlay specification>
+\only{text}<overlay specification>
+\only{text}
+\uncover<overlay specification>{text}
+\uncover{text}
+\visible<overlay specification>{text}
+\visible{text}
+\invisible<overlay specification>{text}
+\invisible{text}
+\alt<overlay specification>{default text}{alternative text}<overlay specification>
+\alt{default text}{alternative text}<overlay specification>
+\alt{default text}{alternative text}
+\temporal{before slide text}{default text}{after slide text}
+\temporal<overlay specification>{before slide text}{default text}{after slide text}
+\temporal{before slide text}{default text}{after slide text}
+\item<alert specification>[item label]<alert specification>
+\item<alert specification><alert specification>
+\item[item label]<alert specification>
+\item[item label]
+\item
+\label<overlay specification>{label name}
+\label{label name}
+\resetcounteronoverlays{counter name}
+\resetcountonoverlays{count register name}
+\action<action specification>{text}
+\action{text}
+\beamerdefaultoverlayspecification{default overlay specification}
+\usetheme[options]{name list}
+\usetheme{name list}
+\usecolortheme[options]{name list}
+\usecolortheme{name list}
+\usefonttheme[options]{name}
+\usefonttheme{name}
+\useinnertheme[options]{name}
+\useinnertheme{name}
+\useoutertheme[options]{name}
+\useoutertheme{name}
+\addheadbox{beamer color}{box template}
+\addfootbox{beamer color}{box template}
+\includeonlyframes{frame label list}
+
diff --git a/src/kile/complete/tex/class-letter.cwl b/src/kile/complete/tex/class-letter.cwl
new file mode 100644
index 0000000..3b62b80
--- /dev/null
+++ b/src/kile/complete/tex/class-letter.cwl
@@ -0,0 +1,15 @@
+# latex mode: LaTeX commands (letter class)
+# dani/2006-02-18
+\begin{letter}{name}
+\end{letter}
+\address{returnaddress}
+\signature{yourname}
+\opening{text}
+\closing{text}
+\cc{text}
+\encl{text}
+\name{text}
+\ps{text}
+\location{address}
+\telephone{number}
+\subject{text}
diff --git a/src/kile/complete/tex/class-scrartcl,scrreprt,scrbook.cwl b/src/kile/complete/tex/class-scrartcl,scrreprt,scrbook.cwl
new file mode 100644
index 0000000..aa74773
--- /dev/null
+++ b/src/kile/complete/tex/class-scrartcl,scrreprt,scrbook.cwl
@@ -0,0 +1,124 @@
+# mode: koma classes (scrartcl,scrreprt,scrbook)
+# dani/2006-02-21
+\addchap[short]{title}
+\addchap{title}
+\addchap*{title}
+\addpart[short]{title}
+\addpart{title}
+\addpart*{title}
+\addsec[short]{title}
+\addsec{title}
+\addsec*{title}
+\addtokomafont{name}{cmd}
+\areaset[bcor]{width}{height}
+\areaset{width}{height}
+\begin{addmargin}{indent}
+\begin{addmargin*}{indent}
+\begin{addmargin}[leftindent]{indent}
+\begin{addmargin*}[middleindent]{indent}
+\begin{captionbeside}[short]{title}
+\begin{captionbeside}[short]{title}[pos]
+\begin{captionbeside}[short]{title}[pos][width]
+\begin{captionbeside}{title}
+\begin{captionbeside}{title}[pos]
+\begin{captionbeside}{title}[pos][width]
+\begin{captionbeside}{title}[pos][width][offset]
+\begin{labeling}[div]{template}\item
+\begin{labeling}{template}\item
+\captionabove[entry]{text}
+\captionabove{text}
+\captionbelow[entry]{text}
+\captionbelow{text}
+\chapappifchapterprefix{text}
+\dedication{text}
+\deffootnote{indent}{parindent}{definition}
+\deffootnotemark{definition}
+\deffootnote[width]{indent}{parindent}{definition}
+\dictumauthorformat{cmd}
+\dictum[author]{text}
+\dictum{text}
+\end{addmargin}
+\end{addmargin*}
+\end{captionbeside}
+\end{captionbeside}[short]{title}[pos][width][offset]
+\end{labeling}
+\enlargethispage
+\extratitle{shorttitle}
+\ifpdfoutput{then}{else}
+\ifthispageodd{true}{false}
+\ifthispagewasodd..\else..\fi
+\linespread{factor}
+\lowertitleback{text}
+\maketitle{pagenumber}
+\marginline{text}
+\markboth
+\markleft
+\markright
+\minisec{title}
+\othersectionlevelsformat{level}
+\publishers{text}
+\setbibpreamble{text}
+\setcapindent{indent}
+\setcapindent*{indent}
+\setcapmargin{indent}
+\setcapmargin*{indent}
+\setcapmargin[left]{indent}
+\setcapmargin*[middle]{indent}
+\setcapwidth[align]{width}
+\setcapwidth{width}
+\setchapterpreamble[pos]{text}
+\setchapterpreamble[pos][width]{text}
+\setchapterpreamble{text}
+\SetDIVList{list}
+\setindexpreamble{text}
+\setkomafont{name}{cmd}
+\setpartpreamble[pos]{text}
+\setpartpreamble[pos][width]{text}
+\setpartpreamble{text}
+\subject{text}
+\textsubscript{text}
+\textsuperscript{text}
+\titlehead{head}
+\typearea[bcor]{div}
+\typearea{div}
+\uppertitleback{text}
+\usekomafont{name}
+# macros
+\appendixmore
+\autodot
+\backmatter
+\capfont
+\caplabelfont
+\captionformat
+\chapapp
+\chapterformat
+\chaptermarkformat
+\chapterpagestyle
+\cleardoubleemptypage
+\cleardoubleplainpage
+\cleardoublestandardpage
+\contentsname
+\descfont
+\dictumwidth
+\figureformat
+\frontmatter
+\indexpagestyle
+\listfigurename
+\listtablename
+\mainmatter
+\partformat
+\partpagestyle
+\raggeddictum
+\raggeddictumauthor
+\raggeddictumtext
+\raggedsection
+\sectfont
+\sectionmarkformat
+\setcaphanging
+\subsectionmarkformat
+\tableformat
+\titlepagestyle
+# variable
+\pdfoutput
+\pdfpageheight
+\pdfpagewidth
diff --git a/src/kile/complete/tex/class-scrlttr2.cwl b/src/kile/complete/tex/class-scrlttr2.cwl
new file mode 100644
index 0000000..f535cce
--- /dev/null
+++ b/src/kile/complete/tex/class-scrlttr2.cwl
@@ -0,0 +1,91 @@
+# mode: koma letter class (scrlttr2)
+# dani/2006-02-21
+\addrchar
+\addrentry{last}{first}{address}{tel}{f1}{f2}{f3}{f4}{comment}{short}
+\addtolengthplength[factor]{length}{plength}
+\addtolengthplength{length}{plength}
+\addtoreffields{name}
+\adrchar
+\adrentry{last}{first}{address}{tel}{f1}{f2}{comment}{short}
+\AtBeginLetter{commands}
+\bankname
+\begin{letter}{name}
+\captionsamerican
+\captionsaustrian
+\captionsbritish
+\captionscroatian
+\captionsdutch
+\captionsenglish
+\captionsfinnish
+\captionsfrench
+\captionsgerman
+\captionsitalian
+\captionsngerman
+\captionsspanish
+\captionsUKenglish
+\captionsUSenglish
+\ccname
+\cc{text}
+\closing{text}
+\customername
+\dateamerican
+\dateaustrian
+\datebritish
+\datecroatian
+\datedutch
+\dateenglish
+\datefinnish
+\datefrench
+\dategerman
+\dateitalian
+\datename
+\datengerman
+\datespanish
+\dateUKenglish
+\dateUSenglish
+\defaultreffields
+\emailname
+\enclname
+\encl{text}
+\end{letter}
+\faxname
+\firstfoot{text}
+\firsthead{text}
+\headfromname
+\headtoname
+\ifkomavarempty{name}{true}{false}
+\ifkomavarempty*{name}{true}{false}
+\invoicename
+\KOMAoptions{list}
+\LetterOptionNeedsPapersize{option}{papersize}
+\LoadLetterOption{name}
+\myrefname
+\newcaptionname{language}{name}{text}
+\newkomavar[alias]{name}
+\newkomavar*[alias]{name}
+\newkomavar{name}
+\newkomavar*{name}
+\nextfoot{text}
+\nexthead{text}
+\opening{text}
+\phonename
+\providecaptionname{language}{name}{text}
+\ps{text}
+\raggedsignature
+\removereffields
+\renewcaptionname{language}{name}{text}
+\setkomavar{name}[alias]{value}
+\setkomavar*{name}[alias]{value}
+\setkomavar{name}{value}
+\setkomavar*{name}{value}
+\setlengthtoplength[factor]{length}{plength}
+\setlengthtoplength{length}{plength}
+\subjectname
+\usekomavar[alias]{name}
+\usekomavar*[alias]{name}
+\usekomavar{name}
+\usekomavar*{name}
+\useplength{name}
+\wwwname
+\yourmailname
+\yourrefname
diff --git a/src/kile/complete/tex/color.cwl b/src/kile/complete/tex/color.cwl
new file mode 100644
index 0000000..e2a0e21
--- /dev/null
+++ b/src/kile/complete/tex/color.cwl
@@ -0,0 +1,13 @@
+# color.sty
+# tbraun 11/2/2006
+\textcolor{declared-color}{text}
+\textcolor[model]{color-spec}{text}
+\pagecolor[declared-color}
+\definecolor{name}{model}{color-spec}
+\normalcolor
+\color[model]{color}
+\color{declared-color}
+\colorbox[model]{declared-color}{text}
+\colorbox{declared-color}{text}
+\fcolorbox[model]{border-color}{fill-color}{text}
+\fcolorbox{declared-border-color}{declared-fill-color}{text}
diff --git a/src/kile/complete/tex/colortbl.cwl b/src/kile/complete/tex/colortbl.cwl
new file mode 100644
index 0000000..55c06fd
--- /dev/null
+++ b/src/kile/complete/tex/colortbl.cwl
@@ -0,0 +1,12 @@
+# colortbl package
+# neeraavi 26 Mar 2007
+\arrayrulecolor{declared-color}
+\arrayrulecolor[color model]{color}
+\cellcolor{declared-color}
+\cellcolor[color model]{color}[left overhang][right overhang]
+\columncolor{declared-color}
+\columncolor[color model]{color}[left overhang][right overhang]
+\doublerulesepcolor{declared-color}
+\doublerulesepcolor[color model]{color}
+\rowcolor{declared-color}
+\rowcolor[color model]{color}[left overhang][right overhang]
diff --git a/src/kile/complete/tex/coordsys.cwl b/src/kile/complete/tex/coordsys.cwl
new file mode 100644
index 0000000..02f22a7
--- /dev/null
+++ b/src/kile/complete/tex/coordsys.cwl
@@ -0,0 +1,25 @@
+#coordsys.cwl
+#for coordsys package
+#neeraavi 26 Mar 2007
+\numbline[spacing]{from}{to}
+\numbline*[spacing]{from}{to}
+\vnumbline[spacing]{from}{to}
+\vnumbline*[spacing]{from}{to}
+\coordsys[h-spacing][v-spacing](lower-left)(upper-right)
+\coordsys*[h-spacing][v-spacing](lower-leftl)(upper-right)
+\fcoordsys[h-spacing][v-spacing](lower-left)(upper-right)
+\fcoordsys*[h-spacing][v-spacing](lower-leftl)(upper-right)
+\bcoordsys[h-spacing][v-spacing](lower-left)(upper-right)
+\bcoordsys*[h-spacing][v-spacing](lower-leftl)(upper-right)
+\window[h-spacing][v-spacing](lower-left)(upper-right)
+\window*[h-spacing][v-spacing](lower-leftl)(upper-right)
+\coordgrid[h-spacing][v-spacing](lower-left)(upper-right)
+\coordgrid*[h-spacing][v-spacing](lower-leftl)(upper-right)
+\gridstyle{thin-declaration}{thick-declaration}
+\sethlabel[alignment]{label}
+\setvlabel[alignment]{label}
+\htickratio
+\vtickratio
+\rescaleby[symb]{num}{den}{cmd}
+\tickstyle{thin-declaration}{thick-declaration}
+\ticklength
diff --git a/src/kile/complete/tex/currvita.cwl b/src/kile/complete/tex/currvita.cwl
new file mode 100644
index 0000000..365ce35
--- /dev/null
+++ b/src/kile/complete/tex/currvita.cwl
@@ -0,0 +1,14 @@
+# currvita.sty
+# tbraun 11/15/2006
+\begin{cv}{heading of the curriculum vitae}
+\end{cv}
+\begin{cvlist}{heading of the list}\item
+\end{cvlist}
+\cvplace{location}
+\cvheadingfont
+\cvlistheadingfont
+\cvlabelfont
+\cvlabelwidth
+\cvlabelskip
+\cvlabelsep
+\cvbibname
diff --git a/src/kile/complete/tex/cyrillic.cwl b/src/kile/complete/tex/cyrillic.cwl
new file mode 100644
index 0000000..1835e08
--- /dev/null
+++ b/src/kile/complete/tex/cyrillic.cwl
@@ -0,0 +1,159 @@
+# created 08/05/2006 by tbraun
+
+\CYRA
+\CYRB
+\CYRV
+\CYRG
+\CYRD
+\CYRE
+\CYRYO
+\CYRZH
+\CYRZ
+\CYRI
+\CYRISHRT
+\CYRK
+\CYRL
+\CYRM
+\CYRN
+\CYRO
+\CYRP
+\CYRR
+\CYRS
+\CYRT
+\CYRU
+\CYRF
+\CYRH
+\CYRC
+\CYRCH
+\CYRSH
+\CYRSHCH
+\CYRHRDSN
+\CYRERY
+\CYRSFTSN
+\CYREREV
+\CYRYU
+\CYRYA
+\cyra
+\cyrb
+\cyrv
+\cyrg
+\cyrd
+\cyre
+\cyryo
+\cyrzh
+\cyrz
+\cyri
+\cyrishrt
+\cyrk
+\cyrl
+\cyrm
+\cyrn
+\cyro
+\cyrp
+\cyrr
+\cyrs
+\cyrt
+\cyru
+\cyrf
+\cyrh
+\cyrc
+\cyrch
+\cyrsh
+\cyrshch
+\cyrhrdsn
+\cyrery
+\cyrsftsn
+\cyrerev
+\cyryu
+\cyrya
+\CYRABHCH
+\CYRABHCHDSC
+\CYRZHDSC
+\CYRABHDZE
+\CYRZDSC
+\CYRKHK
+\CYRKHCRS
+\CYRKDSC
+\CYRKVCRS
+\CYRLJE
+\CYRLDSC
+\CYRMDSC
+\CYRNDSC
+\CYRNG
+\CYRNJE
+\CYRNHK
+\CYROTLD
+\CYRPHK
+\CYRRTICK
+\CYRSDSC
+\CYRTDSC
+\CYRTSHE
+\CYRDJE
+\CYRUSHRT
+\CYRSHHA
+\CYRGHK
+\CYRGUP
+\CYRGHCRS
+\CYRHDSC
+\CYRDZHE
+\CYRDZE
+\CYRTETSE
+\CYRCHLDSC
+\CYRCHVCRS
+\CYRCHRDSC
+\CYRSEMISFTSN
+\CYRIE
+\CYRSCHWA
+\CYRII
+\CYRJE
+\CYRYI
+\CYRY
+\CYRYHCRS
+\CYRAE
+\CYRABHHA
+\CYRpalochka
+\cyrabhch
+\cyrabhchdsc
+\cyrzhdsc
+\cyrabhdze
+\cyrzdsc
+\cyrkhk
+\cyrkhcrs
+\cyrkdsc
+\cyrkvcrs
+\cyrlje
+\cyrldsc
+\cyrmdsc
+\cyrndsc
+\cyrng
+\cyrnje
+\cyrnhk
+\cyrotld
+\cyrphk
+\cyrrtick
+\cyrsdsc
+\cyrtdsc
+\cyrtshe
+\cyrdje
+\cyrushrt
+\cyrshha
+\cyrghk
+\cyrgup
+\cyrghcrs
+\cyrhdsc
+\cyrdzhe
+\cyrdze
+\cyrtetse
+\cyrchldsc
+\cyrchvcrs
+\cyrchrdsc
+\cyrsemisftsn
+\cyrie
+\cyrschwa
+\cyrii
+\cyrje
+\cyryi
+\cyry
+\cyryhcrs
+\cyrae
+\cyrabhha
diff --git a/src/kile/complete/tex/diagxy.cwl b/src/kile/complete/tex/diagxy.cwl
new file mode 100644
index 0000000..fc03b15
--- /dev/null
+++ b/src/kile/complete/tex/diagxy.cwl
@@ -0,0 +1,43 @@
+# diagxy package - Michael Barr's commutative-diagram package
+# freyj 04/04/2007
+# version 2: freyj 7/10/2007
+#-----------------
+# delimiters
+\bfig
+\efig
+# in-line macros
+\to/{sh}/^{L}_{L}
+\mon^{L}_{L}
+\epi^{L}_{L}
+\toleft^{L}_{L}
+\monleft^{L}_{L}
+\epileft^{L}_{L}
+# diagram macros
+\place({x},{y})[{item}]
+\twoar({dx},{dy})
+\morphism({x},{y})|{p}|/{sh}/<{dx},{dy}>[{N}`{N};{L}]
+\square({x},{y})|{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}]
+\hsquares({x},{y})|{p}{p}{p}{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}`{sh}`{sh}`{sh}/<{dx},{dx},{dy}>[{N}`{N}`{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}`{L}`{L}`{L}]
+\vsquares({x},{y})|{p}{p}{p}{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}`{sh}`{sh}`{sh}/<{dx},{dy},{dy}>[{N}`{N}`{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}`{L}`{L}`{L}]
+\ptriangle({x},{y})|{p}{p}{p}|/{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N};{L}`{L}`{L}]
+\qtriangle({x},{y})|{p}{p}{p}|/{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N};{L}`{L}`{L}]
+\dtriangle({x},{y})|{p}{p}{p}|/{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N};{L}`{L}`{L}]
+\btriangle({x},{y})|{p}{p}{p}|/{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N};{L}`{L}`{L}]
+\Atriangle({x},{y})|{p}{p}{p}|/{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N};{L}`{L}`{L}]
+\Vtriangle({x},{y})|{p}{p}{p}|/{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N};{L}`{L}`{L}]
+\Ctriangle({x},{y})|{p}{p}{p}|/{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N};{L}`{L}`{L}]
+\Dtriangle({x},{y})|{p}{p}{p}|/{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N};{L}`{L}`{L}]
+\Atrianglepair({x},{y})|{p}{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}`{L}]
+\Vtrianglepair({x},{y})|{p}{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}`{L}]
+\Ctrianglepair({x},{y})|{p}{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}`{L}]
+\Dtrianglepair({x},{y})|{p}{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}`{L}]
+\pullback({x},{y})|{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}/<{dx}`{dy}>[{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}]|{p}{p}{p}|/{sh}`{sh}`{sh}/<{dx},{dy}>[{N};{L}`{L}`{L}]
+\Square({x},{y})|{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}/<{dy}>[{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}] # width automatically determined
+\hSquares({x},{y})|{p}{p}{p}{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}`{sh}`{sh}`{sh}/<{dy}>[{N}`{N}`{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}`{L}`{L}`{L}] # width automatically determined
+\vSquares({x},{y})|{p}{p}{p}{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}`{sh}`{sh}`{sh}/<{dy},{dy}>[{N}`{N}`{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}`{L}`{L}`{L}] # width automatically determined
+\cube({x},{y})|{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}]({x},{y})|{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}/<{dx},{dy}>[{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}]|{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}/[{L}`{L}`{L}`{L}]
+\node {id}({x},{y})[{N}]
+\arrow|{p}|/{sh}/[{id}`{id};{L}]
+\Loop({x},{y}){N}({dirstart},{dirend})_{L}
+\iiixiii({x},{y})|{p}{p}{p}{p}{p}{p}{p}{p}{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}`{sh}`{sh}`{sh}`{sh}`{sh}`{sh}`{sh}`{sh}/<{dx},{dy}>{zeroes}<{dx},{dy}>[{N}`{N}`{N}`{N}`{N}`{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}`{L}`{L}`{L}`{L}`{L}`{L}`{L}`{L}]
+\iiixii({x},{y})|{p}{p}{p}{p}{p}{p}{p}|/{sh}`{sh}`{sh}`{sh}`{sh}`{sh}`{sh}/<{dx},{dy}>{zeroes}<{dx},{dy}>[{N}`{N}`{N}`{N}`{N}`{N};{L}`{L}`{L}`{L}`{L}`{L}`{L}]
diff --git a/src/kile/complete/tex/doi.cwl b/src/kile/complete/tex/doi.cwl
new file mode 100644
index 0000000..1fc1272
--- /dev/null
+++ b/src/kile/complete/tex/doi.cwl
@@ -0,0 +1,7 @@
+# tbraun
+# ctan: doi package
+# 07/4/2007
+
+\doi{ref}
+\doitext
+
diff --git a/src/kile/complete/tex/enumerate.cwl b/src/kile/complete/tex/enumerate.cwl
new file mode 100644
index 0000000..37b1c96
--- /dev/null
+++ b/src/kile/complete/tex/enumerate.cwl
@@ -0,0 +1,3 @@
+# mode: enumerate.sty
+# dani/2006-02-18
+\begin{enumerate}[option]
diff --git a/src/kile/complete/tex/fancybox.cwl b/src/kile/complete/tex/fancybox.cwl
new file mode 100644
index 0000000..86c8ead
--- /dev/null
+++ b/src/kile/complete/tex/fancybox.cwl
@@ -0,0 +1,58 @@
+# mode: fancybox.sty
+# dani/2006-02-18
+\begin{Bcenter}
+\begin{Bdescription}\item
+\begin{Bdescription}[valign]\item
+\begin{Benumerate}\item
+\begin{Benumerate}[valign]\item
+\begin{Beqnarray}
+\begin{Beqnarray*}
+\begin{Bflushleft}
+\begin{Bflushright}
+\begin{Bitemize}\item
+\begin{Bitemize}[valign]\item
+\begin{BVerbatim}
+\begin{BVerbatim}[pos]
+\begin{landfloat}{float}{rotation command}
+\begin{Landscape}{paperwidth}{paperheight}{rotation command}
+\begin{LandScape}{rotation command}
+\begin{LVerbatim}
+\begin{Sbox}
+\begin{Verbatim}
+\boxput(x,y){lr stuff11}{lr stuff2}
+\boxput*(x,y){lr stuff11}{lr stuff2}
+\BVerbatimInput{file}
+\BVerbatimInput[pos]{file}
+\cornersize*{dim}
+\cornersize{num}
+\doublebox{argument}
+\end{Bcenter}
+\end{Bdescription}
+\end{Benumerate}
+\end{Beqnarray}
+\end{Beqnarray*}
+\end{Bflushleft}
+\end{Bflushright}
+\end{Bitemize}
+\end{BVerbatim}
+\end{landfloat}
+\end{Landscape}
+\end{LandScape}
+\end{LVerbatim}
+\end{Sbox}
+\end{Verbatim}
+\fancypage{cmds1}{cmds2}
+\fancyput(x,y){lr stuff}
+\fancyput*(x,y){lr stuff}
+\LVerbatimInput{file}
+\ovalbox{argument}
+\Ovalbox{argument}
+\shadowbox{argument}
+\shadowsize
+\TheSbox
+\thisfancypage{cmds1}{cmds2}
+\thisfancyput(x,y){lr stuff}
+\thisfancyput*(x,y){lr stuff}
+\Verb
+\VerbatimInput{file}
+\VerbBox{cmd}{lr stuff}
diff --git a/src/kile/complete/tex/fancyhdr.cwl b/src/kile/complete/tex/fancyhdr.cwl
new file mode 100644
index 0000000..d25ec3c
--- /dev/null
+++ b/src/kile/complete/tex/fancyhdr.cwl
@@ -0,0 +1,21 @@
+# mode: fancyhdr.sty
+# dani/2006-02-18
+\chead[LH-even]{LH-odd}
+\chead{stuff}
+\fancyfootoffset{length}
+\fancyfootoffset[place]{length}
+\fancyfoot[option]{stuff}
+\fancyfoot{stuff}
+\fancyheadoffset{length}
+\fancyheadoffset[place]{length}
+\fancyhead[option]{stuff}
+\fancyhead{stuff}
+\fancyhfoffset{length}
+\fancyhfoffset[place]{length}
+\fancyhf[option]{stuff}
+\fancyhf{stuff}
+\fancypagestyle{name}{style}
+\lhead[LH-even]{LH-odd}
+\lhead{stuff}
+\rhead[LH-even]{LH-odd}
+\rhead{stuff}
diff --git a/src/kile/complete/tex/fancyunits-base.cwl b/src/kile/complete/tex/fancyunits-base.cwl
new file mode 100644
index 0000000..b21788e
--- /dev/null
+++ b/src/kile/complete/tex/fancyunits-base.cwl
@@ -0,0 +1,175 @@
+# fancyunits package
+# get it from http://www.physics.ox.ac.uk/users/bauke/LaTeX/Tips_und_Tricks/fancyunits/index.html
+# tbraun 27.06.2007
+# basic commands
+\unit{number}{unit commands}
+\addunit{new unit command}{text}
+\pow{number}
+\ufrac{}{}
+\Ufrac{}{}
+\UFrac{}{}
+\per
+\power{text}{exponent}
+\Square{text}
+\Squared
+\cubic{base}
+\cubed
+\fourth{base}
+\reciprocal{text}
+\rp{text}
+\rpsquare{text}
+\rpsquared
+\rpcubic{text}
+\rpcubed
+\rpfourth{text}
+
+\metre
+\meter
+\kilogram
+\second
+\ampere
+\kelvin
+\mole
+\candela
+
+\yocto
+\zepto
+\atto
+\fempto
+\pico
+\nano
+\micro
+\milli
+\centi
+\deci
+\deca
+\deka
+\hecto
+\kilo
+\mega
+\giga
+\tera
+\peta
+\exa
+\zetta
+\yotta
+
+\yoctod
+\zeptod
+\attod
+\femptod
+\picod
+\nanod
+\microd
+\millid
+\centid
+\decid
+\decad
+\dekad
+\decaD
+\hectod
+\kilod
+\megad
+\gigad
+\terad
+\petad
+\exad
+\zettad
+\yottad
+
+\rad
+\sterad
+\radian
+\steradian
+\hertz
+\newton
+\pascal
+\joule
+\watt
+\coulomb
+\volt
+\farad
+\ohm
+\weber
+\tesla
+\henry
+\celsius
+\degreecelsius
+\lumen
+\lux
+\becquerel
+\Gray
+\sievert
+## derived units in base units
+\radianbase
+\steradianbase
+\hertzbase
+\newtonbase
+\pascalbase
+\joulebase
+\wattbase
+\coulombbase
+\voltbase
+\faradbase
+\ohmbase
+\siemensbase
+\weberbase
+\teslabase
+\henrybase
+\celsiusbase
+\degreecelsiusbase
+\lumenbase
+\luxbase
+\becquerelbase
+\Graybase
+\sievertbase
+## derived units
+\derradian
+\dersteradian
+\derhertz
+\dernewton
+\derpascal
+\derjoule
+\derwatt
+\dercoulomb
+\dervolt
+\derfarad
+\derohm
+\dersiemens
+\derweber
+\dertesla
+\derhenry
+\dercelsius
+\derdegreecelsius
+\derlumen
+\derlux
+\derbecquerel
+\derGray
+\dersievert
+# non SI units
+\minute
+\hour
+\dday
+\degree
+\paminute
+\parsecond
+\angstrom
+\AstroE
+\lightyear
+\parsec
+\gal
+\liter
+\litre
+\atomicmass
+\gram
+\ton
+\tonne
+\barn
+\hectare
+\are
+\bbar
+\curie
+\rem
+\roentgen
+\oersted
+\electronvolt
diff --git a/src/kile/complete/tex/fancyunits-np.cwl b/src/kile/complete/tex/fancyunits-np.cwl
new file mode 100644
index 0000000..9070c54
--- /dev/null
+++ b/src/kile/complete/tex/fancyunits-np.cwl
@@ -0,0 +1,60 @@
+# fancyunits package
+# get it from http://www.physics.ox.ac.uk/users/bauke/LaTeX/Tips_und_Tricks/fancyunits/index.html
+# tbraun 27.06.2007
+# commands in np form
+\Graypersecondnp
+\metrepersquaresecondnp
+\joulepermolenp
+\molepercubicmetrenp
+\radianpersquaresecondnp
+\kilogramsquaremetrepersecondnp
+\radianpersecondnp
+\Squaremetrepercubicmetrenp
+\coulombpermolnp
+\amperepersquaremetrenp
+\kilogrampercubicmetrenp
+\Squaremetrepernewtonsecondnp
+\pascalsecondnp
+\coulombpercubicmetrenp
+\voltpermetrenp
+\coulombpersquaremetrenp
+\faradpermetrenp
+\wattpersquaremetrenp
+\joulepersquaremetrenp
+\newtonpercubicmetrenp
+\newtonperkilogramnp
+\jouleperkelvinnp
+\jouleperkilogramnp
+\coulombperkilogramnp
+\Squaremetrepersecondnp
+\Squaremetrepersquaresecondnp
+\kilogrammetrepersecondnp
+\candelapersquaremetrenp
+\amperepermetrenp
+\jouleperteslanp
+\henrypermetrenp
+\kilogrampersecondnp
+\kilogrampersquaremetresecondnp
+\kilogrampersquaremetrenp
+\kilogrampermetrenp
+\joulepermolekelvinnp
+\kilogramperkilomolenp
+\kilogramsquaremetrenp
+\kilogrammetrepersquaresecondnp
+\newtonpersquaremetrenp
+\persquaremetresecondnp
+\wattperkilogramnp
+\wattpercubicmetrenp
+\wattpersquaremetresteradiannp
+\jouleperkilogramkelvinnp
+\Squaremetreperkilogramnp
+\cubicmetreperkilogramnp
+\newtonpermetrenp
+\wattpermetrekelvinnp
+\newtonmetrenp
+\Squaremetrepercubicsecondnp
+\metrepersecondnp
+\joulepercubicmetrenp
+\kilogrampercubicmetrecoulombnp
+\cubicmetrepersecondnp
+\kilogrampersecondcubicmetrenp
diff --git a/src/kile/complete/tex/fancyunits-per.cwl b/src/kile/complete/tex/fancyunits-per.cwl
new file mode 100644
index 0000000..cb0e8e2
--- /dev/null
+++ b/src/kile/complete/tex/fancyunits-per.cwl
@@ -0,0 +1,71 @@
+# fancyunits package
+# get it from http://www.physics.ox.ac.uk/users/bauke/LaTeX/Tips_und_Tricks/fancyunits/index.html
+# tbraun 27.06.2007
+# commands in per form
+\Squaremetre
+\cubicmetre
+\Graypersecond
+\metrepersquaresecond
+\joulepermole
+\molepercubicmetre
+\radianpersquaresecond
+\kilogramsquaremetrepersecond
+\radianpersecond
+\Squaremetrepercubicmetre
+\coulombpermol
+\amperepersquaremetre
+\kilogrampercubicmetre
+\Squaremetrepernewtonsecond
+\pascalsecond
+\coulombpercubicmetre
+\amperemetresecond
+\voltpermetre
+\coulombpersquaremetre
+\faradpermetre
+\ohmmetre
+\kilowatthour
+\wattpersquaremetre
+\joulepersquaremetre
+\newtonpercubicmetre
+\newtonperkilogram
+\jouleperkelvin
+\jouleperkilogram
+\coulombperkilogram
+\Squaremetrepersecond
+\rpsquaremetrepersecond
+\Squaremetrepersquaresecond
+\rpsquaremetrepersquaresecond
+\kilogrammetrepersecond
+\candelapersquaremetre
+\amperepermetre
+\joulepertesla
+\henrypermetre
+\kilogrampersecond
+\kilogrampersquaremetresecond
+\kilogrampersquaremetre
+\kilogrampermetre
+\joulepermolekelvin
+\kilogramperkilomole
+\kilogramsquaremetre
+\kilogrammetrepersquaresecond
+\newtonpersquaremetre
+\persquaremetresecond
+\wattperkilogram
+\wattpercubicmetre
+\wattpersquaremetresteradian
+\jouleperkilogramkelvin
+\Squaremetreperkilogram
+\rpsquaremetreperkilogram
+\cubicmetreperkilogram
+\rpcubicmetreperkilogram
+\newtonpermetre
+\Celsius
+\wattpermetrekelvin
+\newtonmetre
+\Squaremetrepercubicsecond
+\metrepersecond
+\joulepercubicmetre
+\kilogrampercubicmetrecoulomb
+\cubicmetrepersecond
+\rpcubicmetrepersecond
+\kilogrampersecondcubicmetre
diff --git a/src/kile/complete/tex/fancyunits_big-fractions.cwl b/src/kile/complete/tex/fancyunits_big-fractions.cwl
new file mode 100644
index 0000000..984bcbf
--- /dev/null
+++ b/src/kile/complete/tex/fancyunits_big-fractions.cwl
@@ -0,0 +1,58 @@
+# fancyunits package
+# get it from http://www.physics.ox.ac.uk/users/bauke/LaTeX/Tips_und_Tricks/fancyunits/index.html
+# tbraun 27.06.2007
+# commands in UF form
+\GraypersecondUF
+\metrepersquaresecondUF
+\joulepermoleUF
+\molepercubicmetreUF
+\radianpersquaresecondUF
+\kilogramsquaremetrepersecondUF
+\radianpersecondUF
+\SquaremetrepercubicmetreUF
+\coulombpermolUF
+\amperepersquaremetreUF
+\kilogrampercubicmetreUF
+\SquaremetrepernewtonsecondUF
+\pascalsecondUF
+\coulombpercubicmetreUF
+\voltpermetreUF
+\coulombpersquaremetreUF
+\faradpermetreUF
+\wattpersquaremetreUF
+\joulepersquaremetreUF
+\newtonpercubicmetreUF
+\newtonperkilogramUF
+\jouleperkelvinUF
+\jouleperkilogramUF
+\coulombperkilogramUF
+\SquaremetrepersecondUF
+\SquaremetrepersquaresecondUF
+\kilogrammetrepersecondUF
+\candelapersquaremetreUF
+\amperepermetreUF
+\jouleperteslaUF
+\henrypermetreUF
+\kilogrampersecondUF
+\kilogrampersquaremetresecondUF
+\kilogrampersquaremetreUF
+\kilogrampermetreUF
+\joulepermolekelvinUF
+\kilogramperkilomoleUF
+\kilogrammetrepersquaresecondUF
+\newtonpersquaremetreUF
+\persquaremetresecondUF
+\wattperkilogramUF
+\wattpercubicmetreUF
+\wattpersquaremetresteradianUF
+\jouleperkilogramkelvinUF
+\SquaremetreperkilogramUF
+\cubicmetreperkilogramUF
+\newtonpermetreUF
+\wattpermetrekelvinUF
+\SquaremetrepercubicsecondUF
+\metrepersecondUF
+\joulepercubicmetreUF
+\kilogrampercubicmetrecoulombUF
+\cubicmetrepersecondUF
+\kilogrampersecondcubicmetreUF
diff --git a/src/kile/complete/tex/fancyunits_medium-fractions.cwl b/src/kile/complete/tex/fancyunits_medium-fractions.cwl
new file mode 100644
index 0000000..c4d8c18
--- /dev/null
+++ b/src/kile/complete/tex/fancyunits_medium-fractions.cwl
@@ -0,0 +1,58 @@
+# fancyunits package
+# get it from http://www.physics.ox.ac.uk/users/bauke/LaTeX/Tips_und_Tricks/fancyunits/index.html
+# tbraun 27.06.2007
+# commands in Uf form
+\GraypersecondUf
+\metrepersquaresecondUf
+\joulepermoleUf
+\molepercubicmetreUf
+\radianpersquaresecondUf
+\kilogramsquaremetrepersecondUf
+\radianpersecondUf
+\SquaremetrepercubicmetreUf
+\coulombpermolUf
+\amperepersquaremetreUf
+\kilogrampercubicmetreUf
+\SquaremetrepernewtonsecondUf
+\pascalsecondUf
+\coulombpercubicmetreUf
+\voltpermetreUf
+\coulombpersquaremetreUf
+\faradpermetreUf
+\wattpersquaremetreUf
+\joulepersquaremetreUf
+\newtonpercubicmetreUf
+\newtonperkilogramUf
+\jouleperkelvinUf
+\jouleperkilogramUf
+\coulombperkilogramUf
+\SquaremetrepersecondUf
+\SquaremetrepersquaresecondUf
+\kilogrammetrepersecondUf
+\candelapersquaremetreUf
+\amperepermetreUf
+\jouleperteslaUf
+\henrypermetreUf
+\kilogrampersecondUf
+\kilogrampersquaremetresecondUf
+\kilogrampersquaremetreUf
+\kilogrampermetreUf
+\joulepermolekelvinUf
+\kilogramperkilomoleUf
+\kilogrammetrepersquaresecondUf
+\newtonpersquaremetreUf
+\persquaremetresecondUf
+\wattperkilogramUf
+\wattpercubicmetreUf
+\wattpersquaremetresteradianUf
+\jouleperkilogramkelvinUf
+\SquaremetreperkilogramUf
+\cubicmetreperkilogramUf
+\newtonpermetreUf
+\wattpermetrekelvinUf
+\SquaremetrepercubicsecondUf
+\metrepersecondUf
+\joulepercubicmetreUf
+\kilogrampercubicmetrecoulombUf
+\cubicmetrepersecondUf
+\kilogrampersecondcubicmetreUf
diff --git a/src/kile/complete/tex/fancyunits_small-fractions.cwl b/src/kile/complete/tex/fancyunits_small-fractions.cwl
new file mode 100644
index 0000000..cb23701
--- /dev/null
+++ b/src/kile/complete/tex/fancyunits_small-fractions.cwl
@@ -0,0 +1,58 @@
+# fancyunits package
+# get it from http://www.physics.ox.ac.uk/users/bauke/LaTeX/Tips_und_Tricks/fancyunits/index.html
+# tbraun 27.06.2007
+# commands in uf form
+\Grayperseconduf
+\metrepersquareseconduf
+\joulepermoleuf
+\molepercubicmetreuf
+\radianpersquareseconduf
+\kilogramsquaremetreperseconduf
+\radianperseconduf
+\Squaremetrepercubicmetreuf
+\coulombpermoluf
+\amperepersquaremetreuf
+\kilogrampercubicmetreuf
+\Squaremetrepernewtonseconduf
+\pascalseconduf
+\coulombpercubicmetreuf
+\voltpermetreuf
+\coulombpersquaremetreuf
+\faradpermetreuf
+\wattpersquaremetreuf
+\joulepersquaremetreuf
+\newtonpercubicmetreuf
+\newtonperkilogramuf
+\jouleperkelvinuf
+\jouleperkilogramuf
+\coulombperkilogramuf
+\Squaremetreperseconduf
+\Squaremetrepersquareseconduf
+\kilogrammetreperseconduf
+\candelapersquaremetreuf
+\amperepermetreuf
+\jouleperteslauf
+\henrypermetreuf
+\kilogramperseconduf
+\kilogrampersquaremetreseconduf
+\kilogrampersquaremetreuf
+\kilogrampermetreuf
+\joulepermolekelvinuf
+\kilogramperkilomoleuf
+\kilogrammetrepersquareseconduf
+\newtonpersquaremetreuf
+\persquaremetreseconduf
+\wattperkilogramuf
+\wattpercubicmetreuf
+\wattpersquaremetresteradianuf
+\jouleperkilogramkelvinuf
+\Squaremetreperkilogramuf
+\cubicmetreperkilogramuf
+\newtonpermetreuf
+\wattpermetrekelvinuf
+\Squaremetrepercubicseconduf
+\metreperseconduf
+\joulepercubicmetreuf
+\kilogrampercubicmetrecoulombuf
+\cubicmetreperseconduf
+\kilogrampersecondcubicmetreuf
diff --git a/src/kile/complete/tex/fancyvrb.cwl b/src/kile/complete/tex/fancyvrb.cwl
new file mode 100644
index 0000000..a394037
--- /dev/null
+++ b/src/kile/complete/tex/fancyvrb.cwl
@@ -0,0 +1,14 @@
+#fancyvrb.cwl
+#for fancyvrb package
+#neeraavi 12 Apr 2007
+
+\VerbatimFootnotes
+\DefineShortVerb{verb}
+\UndefineShortVerb{verb}
+\begin{Verbatim}
+\begin{Verbatim}[key=value]
+\end{Verbatim}
+\begin{Verbatim*}
+\end{Verbatim*}
+\begin{BVerbatim*}
+\end{BVerbatim*}
diff --git a/src/kile/complete/tex/fontspec.cwl b/src/kile/complete/tex/fontspec.cwl
new file mode 100644
index 0000000..98b8152
--- /dev/null
+++ b/src/kile/complete/tex/fontspec.cwl
@@ -0,0 +1,49 @@
+# fontspec 1.14 package
+# nja 17 July 2007
+# url: http://www.ctan.org/tex-archive/help/Catalogue/entries/fontspec.html
+
+\usepackage[cm-default/lm-default/math/no-math/config/no-config/quiet]{fontspec}
+
+\fontspec{fontname}
+\fontspec[fontfeature=option]{fontname}
+\fontspec[fontfeature=option,fontfeature=option]{fontname}
+
+\setmainfont{fontname}
+\setmainfont[fontfeature=option]{fontname}
+\setmainfont[fontfeature=option,fontfeature=option]{fontname}
+
+\setsansfont{fontname}
+\setsansfont[fontfeature=option]{fontname}
+\setsansfont[fontfeature=option,fontfeature=option]{fontname}
+
+\setmonofont{fontname}
+\setmonofont[fontfeature=option]{fontname}
+\setmonofont[fontfeature=option,fontfeature=option]{fontname}
+
+\newfontfamily<fontinstance>{fontname}
+
+\newfontface<fontface>{fontname}
+\newfontface<fontface>[fontfeature=option]{fontname}
+\newfontface<fontface>[fontfeature=option,fontfeature=option]{fontname}
+
+\setmathrm
+\setboldmathrm
+\setmathsf
+\setmathtt
+
+
+\defaultfontfeatures{fontfeature=option}
+\defaultfontfeatures{fontfeature=option,fontfeature=option}
+\addfontfeatures{fontfeatures}
+\addfontfeatures{fontfeature=option,fontfeature=option}
+
+\newfontscript{fontspecname}{OpenTypedefinition}
+\newfontlanguage{fontspecname}{OpenTypedefinition}
+
+\newAATfeature{feature}{option}{featurecode}{selectorcode}
+\newfeaturecode{feature}{option}{featurecode}{selectorcode}
+\newICUfeature{feature}{option}{featuretag}
+\newfontfeature{name}{inputstring}
+\aliasfontfeature{existingname}{newname}
+\aliasfontfeatureoption{fontfeature}{existingname}{newname}
+
diff --git a/src/kile/complete/tex/graphicx.cwl b/src/kile/complete/tex/graphicx.cwl
new file mode 100644
index 0000000..444b95c
--- /dev/null
+++ b/src/kile/complete/tex/graphicx.cwl
@@ -0,0 +1,25 @@
+# graphicx package
+# mario 09/06/2007
+# URL: http://tug.ctan.org/tex-archive/macros/latex/required/graphics/
+\color{name}
+\color[model]{specification}
+\color{specification}
+\colorbox{name}{text}
+\colorbox[model]{specification}{text}
+\DeclareGraphicsExtensions{ext-list}
+\DeclareGraphicsRule{ext}{type}{read-file}{command}
+\definecolor{name}{model}{colour specification}
+\fcolorbox{name1}{name2}{text}
+\fcolorbox[model]{specification1}{specification2}{text}
+\graphicspath{dir-list}
+\includegraphics*[key val list]{file}
+\includegraphics[key val list]{file}
+\pagecolor{name}
+\pagecolor[model]{specification}
+\reflectbox{text}
+\resizebox*{h-length}{v-length}{text}
+\rotatebox[key val list]{angle}{text}
+\scalebox{h-scale}[v-scale]{text}
+\setkeys{Gin}{key val}
+\textcolor{name}{text}
+\textcolor[model]{specification}{text}
diff --git a/src/kile/complete/tex/hyperref.cwl b/src/kile/complete/tex/hyperref.cwl
new file mode 100644
index 0000000..8d27fa9
--- /dev/null
+++ b/src/kile/complete/tex/hyperref.cwl
@@ -0,0 +1,35 @@
+# hyperref package
+# neeraavi 21 Mar 2007
+\hypersetup{options}
+\href{URL}{text}
+\url{URL}
+\nolinkurl{URL}
+\hyperbaseurl{URL}
+\hyperimage{imageURL}{text}
+\hyperdef{category}{name}{text}
+\hyperref{URL}{category}{name}{text}
+\hyperref[label]{text}
+\hyperlink{name}{text}
+\hypertarget{name}{text}
+\phantomsection
+\autoref{label}
+\ref*{label}
+\pageref*{label}
+\pdfstringdef{macroname}{TEXstring}
+\texorpdfstring{TEXstring}{PDFstring}
+\hypercalcbp{dimen specification}
+\Acrobatmenu{menuoption}{text}
+\TextField[parameters]{label}
+\CheckBox[parameters]{label}
+\ChoiceMenu[parameters]{label}{choices}
+\PushButton[parameters]{label}
+\Submit[parameters]{label}
+\Reset[parameters]{label}
+\LayoutTextField{label}{field}
+\LayoutChoiceField{label}{field}
+\LayoutCheckField{label}{field}
+\MakeRadioField{width}{height}
+\MakeCheckField{width}{height}
+\MakeTextField{width}{height}
+\MakeChoiceField{width}{height}
+\MakeButtonField{text}
diff --git a/src/kile/complete/tex/ifthen.cwl b/src/kile/complete/tex/ifthen.cwl
new file mode 100644
index 0000000..3cc378b
--- /dev/null
+++ b/src/kile/complete/tex/ifthen.cwl
@@ -0,0 +1,18 @@
+# ifthen 1.1 package
+# nja 17 July 2007
+# url: http://www.ctan.org/tex-archive/help/Catalogue/entries/ifthen.html
+
+\ifthenelse{test}{then clause}{else clause}
+\isodd{number}
+\isundefined{command}
+\equal{string}{string}
+\AND
+\OR
+\NOT
+\lengthtest{dimen operator dimen}
+\boolean{name}
+\newboolean{name}
+\provideboolean{name}
+\setboolean{name}{truth value}
+\whiledo{test}{while clause}
+
diff --git a/src/kile/complete/tex/import.cwl b/src/kile/complete/tex/import.cwl
new file mode 100644
index 0000000..b5fcddc
--- /dev/null
+++ b/src/kile/complete/tex/import.cwl
@@ -0,0 +1,11 @@
+# tbraun
+# 2006/30/05
+
+\import{full path}{file}
+\import*{full path}{file}
+\subimport{relative path}{file}
+\subimport*{relative path}{file}
+\includefrom{full path}{file}
+\includefrom*{full path}{file}
+\subincludefrom{relative path}{file}
+\subincludefrom*{relative path}{file}
diff --git a/src/kile/complete/tex/jurabib.cwl b/src/kile/complete/tex/jurabib.cwl
new file mode 100644
index 0000000..c90b343
--- /dev/null
+++ b/src/kile/complete/tex/jurabib.cwl
@@ -0,0 +1,32 @@
+# jurabib package
+# author: Francisco Fernández Labastida 10 Apr 2007
+# last modified: Ben E. Hard 27 august 2007
+\cite[page-range]{key}
+\cite[Annotator/See][page-range]{key}
+\cite*[page-range]{key}
+\cite*[Annotator/See][page-range]{key}
+\citefield[page-range]{field}{key}
+\citenotitlefortype{article,book,…}
+\citeswithoutentry{key1,key2,…}
+\citetitle[page-range]{key}
+\citetitle[Annotator/See][page-range]{key}
+\citetitlefortype{article,book,…}
+\footcite[page-range]{key}
+\footcite[Annotator/See][page-range]{key}
+\footcite*[page-range]{key}
+\footcite*[Annotator/See][page-range]{key}
+\footcitetitle[page-range]{key}
+\footcitetitle[Annotator/See][page-range]{key}
+\footfullcite[page-range]{key}
+\footfullcite[Annotator/See][page-range]{key}
+\fullcite[page-range]{key}
+\fullcite[Annotator/See][page-range]{key}
+\nextcitefull{key1,key2,…}
+\nextcitenotitle{key1,key2,…}
+\nextcitereset{key1,key2,…}
+\nextciteshort{key1,key2,…}
+\nobibliography{bibfile}
+\noibidem
+\noidem
+\nocite{key-or-*}
+
diff --git a/src/kile/complete/tex/latex-209.cwl b/src/kile/complete/tex/latex-209.cwl
new file mode 100644
index 0000000..90b08fd
--- /dev/null
+++ b/src/kile/complete/tex/latex-209.cwl
@@ -0,0 +1,5 @@
+# latex mode: LaTeX commands (latex 2.09 level)
+# obsolete commands from LaTeX 2.09
+# dani/2006-02-18
+ \documentstyle[options]{style}
+ \documentstyle{style}
diff --git a/src/kile/complete/tex/latex-dev.cwl b/src/kile/complete/tex/latex-dev.cwl
new file mode 100644
index 0000000..aa23740
--- /dev/null
+++ b/src/kile/complete/tex/latex-dev.cwl
@@ -0,0 +1,177 @@
+# latex mode: LaTeX commands (package level)
+# dani/2006-02-18
+# commands with big Letters and others
+\AtBeginDocument{code}
+\AtEndDocument{code}
+\AtEndOfClass{code}
+\AtEndOfPackage{code}
+\CheckCommand{cmd}[args][default]{def}
+\CheckCommand{cmd}[args]{def}
+\CheckCommand{cmd}{def}
+\CurrentOption
+\DeclareOption*{code}
+\DeclareOption{option}{code}
+\DeclareRobustCommand
+\ExecuteOptions{optionlist}
+\IfFileExists{file}{then}{else}
+\InputIfFileExists{file}{then}{else}
+\LoadClass[optionlist]{class}
+\LoadClass[optionlist]{class}[release]
+\LoadClass{class}
+\LoadClass{class}[release]
+\NeedsTeXFormat{format}
+\NeedsTeXFormat{format}[release]
+\OptionNotUsed
+\PackageError{text}
+\PackageInfo{text}
+\PackageWarning{text}
+\PackageWarningNoLine{text}
+\PassOptionsToClass{optionlist}{class}
+\PassOptionsToPackage{optionlist}{package}
+\ProcessOptions
+\ProcessOptions*
+\ProvidesClass{name}
+\ProvidesClass{name}[release]
+\ProvidesFile{ma,e}
+\ProvidesFile{name}{release}
+\ProvidesPackage{name}
+\ProvidesPackage{name}[release]
+\RequirePackage[optionlist]{package}
+\RequirePackage[optionlist]{package}[release]
+\RequirePackage{package}
+\RequirePackage{package}[release]
+# counter, lengths and dimens
+\setcounter{counter}{value}
+\setlanguage{language}
+\setlength{\gnat}{length}
+\setpapersize{layout}
+\settodepth{\gnat}{text}
+\settoheight{\gnat}{text}
+\settowidth{\gnat}{text}
+\addto
+\addtocontents{file}{text}
+\addtocounter{counter}{value}
+\addtolength{\gnat}{length}
+\addtoversion
+\addvspace{length}
+\deffootnote[width}{indention}{par indention}{definition}
+\newcounter{foo}
+\newcounter{foo}[counter]
+\refstepcounter{counter}
+\restorecr
+\reversemarginpar
+\stepcounter{counter}
+\stretch{number}
+\usecounter{counter}
+\usefont{enc}{family}{series}{shape}
+\value{counter}
+\newfont{cmd}{fontname}
+# counter representative
+\thechapter
+\theenumi
+\theenumiv
+\theequation
+\thefigure
+\thefootnote
+\thefootnotemark
+\thehours
+\theminutes
+\thempfn
+\thempfootnote
+\thepage
+\theparagraph
+\thepart
+\thesection
+\thesubparagraph
+\thesubsection
+\thesubsubsection
+\thetable
+# boxes
+\savebox{cmd}[width][pos]{text}
+\savebox{cmd}[width]{text}
+\savebox{cmd}{text}
+\dashbox{dashlength}(width,height)[position]{text}
+\dashbox{dashlength}(width,height){text}
+\makebox(width,height)[position]{text}
+\makebox(width,height){text}
+\makebox[width][position]{text}
+\makebox[width]{text}
+\usebox{\box}
+\raisebox{distance}[extendabove][extendbelow]{text}
+\raisebox{distance}[extendabove]{text}
+\raisebox{distance}{text}
+\newsavebox{\box}
+# variables
+\belowcaptionskip
+\binoppenalty
+\bottomfraction
+\bottomnumber
+\dblfigrule
+\dblfloatpagefraction
+\dblfloatsep
+\dbltextfloatsep
+\dbltopfraction
+\dbltopnumber
+\defaultscriptratio
+\defaultscriptscriptratio
+\doublerulesep
+\emergencystretch
+\footnotesep
+\footskip
+\intextsep
+\itemindent
+\itemsep
+\labelenumi
+\labelitemi
+\labelitemii
+\labelitemiii
+\labelitemiv
+\labelsep
+\labelwidth
+\leftmargin
+\leftmargini
+\leftmarginii
+\leftmarginiii
+\leftmarginiv
+\leftmarginv
+\leftmarginvi
+\leftmark
+\marginparpush
+\marginparsep
+\marginparwidth
+\paperheight
+\paperwidth
+\tabbingsep
+\tabcolsep
+\topfigrule
+\topfraction
+\topmargin
+\topnumber
+\topsep
+\totalheight
+\totalnumber
+\textfloatsep
+\textfraction
+\abovecaptionskip
+\addpenalty
+\arraycolsep
+\arrayrulewidth
+\arraystretch
+\badness
+\baselinestretch
+\columnsep
+\columnseprule
+\columnwidth
+\evensidemargin
+\extracolsep
+\fboxrule
+\fboxsep
+\floatpagefraction
+\floatsep
+\headheight
+\headsep
+\height
+\partopsep
+\parsep
+\lineskiplimits
+\footheight
diff --git a/src/kile/complete/tex/latex-document.cwl b/src/kile/complete/tex/latex-document.cwl
new file mode 100644
index 0000000..7925940
--- /dev/null
+++ b/src/kile/complete/tex/latex-document.cwl
@@ -0,0 +1,462 @@
+# latex mode: LaTeX commands (document level)
+# dani/2006-02-18
+# tbraun/2006-08-03 removed dup inserted by me ...
+# tbraun/2007-02-24 added left/right variants
+\abstractname{name}
+\addcontentsline{file}{secunit}{entry}
+\Alph{counter}
+\alph{counter}
+\and
+\appendix
+\appendixname
+\arabic{counter}
+\author{names}
+\begin{}
+\begin{abstract}
+\begin{alltt}
+\begin{array}{cols}
+\begin{array}[pos]{cols}
+\begin{center}
+\begin{description}\item
+\begin{displaymath}
+\begin{document}
+\begin{enumerate}\item
+\begin{equation}
+\begin{figure}
+\begin{figure}[placement]
+\begin{figure*}
+\begin{figure*}[placement]
+\begin{filecontents}
+\begin{flushleft}
+\begin{flushright}
+\begin{itemize}\item
+\begin{list}{label}{spacing}
+\begin{lrbox}
+\begin{math}
+\begin{minipage}[position]{width}
+\begin{minipage}{width}
+\begin{picture}(width,height)
+\begin{picture}(width,height)(xoffset,yoffset)
+\begin{quotation}
+\begin{quote}
+\begin{tabbing}
+\begin{table*}
+\begin{table*}[placement]
+\begin{table}
+\begin{table}[placement]
+\begin{tabular}{cols}
+\begin{tabular}[pos]{cols}
+\begin{tabular*}{width}[pos]{cols}
+\begin{tabular*}{width}{cols}
+\begin{thebibliography}{widestlabel}
+\begin{theindex}
+\begin{theorem}
+\begin{theorem}[optional]
+\begin{titlepage}
+\begin{trivlist}
+\begin{verbatim}
+\begin{verbatim*}
+\begin{verse}
+\end{}
+\end{abstract}
+\end{alltt}
+\end{array}
+\end{center}
+\end{description}
+\end{displaymath}
+\end{document}
+\end{enumerate}
+\end{equation}
+\end{figure}
+\end{figure*}
+\end{filecontents}
+\end{flushleft}
+\end{flushright}
+\end{itemize}
+\end{list}
+\end{lrbox}
+\end{math}
+\end{minipage}
+\end{picture}
+\end{quotation}
+\end{quote}
+\end{tabbing}
+\end{table}
+\end{table*}
+\end{tabular}
+\end{tabular*}
+\end{thebibliography}
+\end{theindex}
+\end{theorem}
+\end{titlepage}
+\end{trivlist}
+\end{verbatim}
+\end{verbatim*}
+\end{verse}
+\ensuremath{text}
+\bezier{n}(x1,y1)(x2,y2)(x3,y3)
+\bfseries
+\bibitem{citekey}
+\bibitem[label]{citekey}
+\bibliographystyle{style}
+\bibliography{file}
+\boldmath
+\botfigrule
+\cal
+\caption{title}
+\caption[short]{title}
+\cdots
+\chapter{title}
+\chapter*{title}
+\chapter[short]{title}
+\chaptermark{code}
+\chaptername{name}
+\cite{keylist}
+\cite[text]{keylist}
+\circle{diameter}
+\circle*{diameter}
+\cleardoublepage
+\clearpage
+\cline{i-j}
+\contentsline{type}{text}{page}
+\contentsname{name}
+\date{text}
+\ddots
+\depth
+\descriptionlabel{code}
+\documentclass[options]{style}
+\documentclass{style}
+\emph{text}
+\enlargethispage*{size}
+\enlargethispage{size}
+\family
+\fbox{text}
+\figurename{name}
+\flq
+\flqq
+\flushbottom
+\fnsymbol{counter}
+\fontencoding{enc}
+\fontfamily{family}
+\fontseries{series}
+\fontshape{shape}
+\fontsize{size}{skip}
+\fontsubfuzz
+\footnotemark
+\footnotemark[number]
+\footnotesize
+\footnotetext[number]{text}
+\footnotetext{text}
+\footnote[number]{text}
+\footnote{text}
+\frac{num}{den}
+\framebox(xdimen,ydimen)[position]{text}
+\framebox(xdimen,ydimen){text}
+\framebox[width][position]{text}
+\framebox[width]{text}
+\frame{text}
+\frq
+\frqq
+\glossaryentry{text}{pagenum}
+\glossary{text}
+\glq
+\glqq
+\grq
+\grqq
+\hline
+\hlinefill
+\hspace*{length}
+\hspace{length}
+\hss
+\huge
+\Huge
+\hyphenation{words}
+\include{file}
+\input{file}
+\includegraphics[options]{name}
+\includegraphics{name}
+\includeonly{filelist}
+\indexname{name}
+\indexspace
+\index{entry}
+\inputlineno
+\item
+\item[label]
+\iterate
+\itshape
+\kill
+\label{key}
+\language
+\LARGE
+\Large
+\large
+\LaTeX
+\LaTeXe
+\ldots
+\lefteqn
+\lefthyphenmin
+\line(xslope,yslope){length}
+\linebreak
+\linebreak[number]
+\linethickness{dimension}
+\linewidth
+\listfigurename{name}
+\listfiles
+\listoffigures
+\listoftables
+\listparindent
+\listtablename{name}
+\makeatletter
+\makeatother
+\makeglossary
+\makeindex
+\makelabel
+\makelabels{number}
+\MakeLowercase{text}
+\maketitle
+\MakeUppercase{text}
+\marginpar[left]{right}
+\marginpar{right}
+\markboth{lefthead}{righthead}
+\markright{righthead}
+\mathbb
+\mathbf
+\mathcal
+\mathds
+\mathellipsis
+\mathfrak
+\mathgroup
+\mathit
+\mathnormal
+\mathrm
+\mathscr
+\mathsf
+\mathsterling
+\mathtt
+\mathunderscore
+\mathversion
+\mbox{text}
+\mdseries
+\multicolumn{cols}{pos}{text}
+\multiput(xcoord,ycoord)(xdelta,ydelta){copies}{object}
+\newlabel
+\newlength{\length}
+\newline
+\newpage
+\newtheorem{envname}[numberedlike]{caption}
+\newtheorem{envname}{caption}
+\newtheorem{envname}{caption}[within]
+\nocite{keylist}
+\nocorr
+\nocorrlist{charlist}
+\nofiles
+\nolinebreak
+\nolinebreak[number]
+\nonumber
+\nopagebreak
+\nopagebreak[number]
+\normalcolor
+\normalfont
+\normalmarginpar
+\normalsize
+\nouppercase
+\null
+\obeycr
+\oddsidemargin
+\oldstylenums
+\onecolumn
+\oval(width,height)
+\oval(width,height)[portion]
+\overbrace{text}
+\overline{text}
+\pagebreak
+\pagebreak[number]
+\pagename
+\pagenumbering{numstyle}
+\pageref{key}
+\pagestyle{option}
+\pagetotal
+\paragraph*{title}
+\paragraph[short]{title}
+\paragraphmark
+\paragraph{title}
+\parbox[position]{width}{text}
+\parbox{width}{text}
+\part*{title}
+\part[short]{title}
+\partname{name}
+\part{title}
+\plus
+\poptabs
+\pounds
+\put(xcoord,ycoord){text}
+\ref{key}
+\refname{name}
+\righthyphenmin
+\rightmargin
+\rightmark
+\rmfamily
+\Roman{counter}
+\roman{counter}
+\rule[lift]{width}{thickness}
+\rule{width}{thickness}
+\samepage
+\sbox{cmd}[text]
+\scriptsize
+\scshape
+\section{title}
+\section*{title}
+\section[short]{title}
+\sectionmark{code}
+\selectfont
+\sffamily
+\shortstack[position]{text\\text}
+\shortstack{text\\text}
+\slshape
+\small
+\smash
+\space
+\sqrt[root]{arg}
+\sqrt{arg}
+\stackrel{above}{under}
+\stop
+\subitem
+\subparagraph*{title}
+\subparagraph[short]{title}
+\subparagraphmark{code}
+\subparagraph{title}
+\subsection{title}
+\subsection*{title}
+\subsection[short]{title}
+\subsectionmark{code}
+\subsubitem
+\subsubsection*{title}
+\subsubsection[short]{title}
+\subsubsectionmark{code}
+\subsubsection{title}
+\suppressfloats
+\suppressfloats[placement]
+\symbol{n}
+\tablename{name}
+\tableofcontents
+\textasciicircum
+\textasciitilde
+\textasteriskcentered
+\textbackslash
+\textbar
+\textbf{text}
+\textbraceleft
+\textbraceright
+\textbullet
+\textcircled
+\textcompwordmark
+\textdagger
+\textdaggerdbl
+\textdollar
+\textellipsis
+\textemdash
+\textendash
+\textexclamdown
+\textgreater
+\textheight
+\textit{text}
+\textless
+\textmd{text}
+\textnormal
+\textparagraph
+\textperiodcentered
+\textquestiondown
+\textquotedblleft
+\textquotedblright
+\textquoteleft
+\textquoteright
+\textregistered
+\textrm{text}
+\textsc{text}
+\textsection
+\textsf{text}
+\textsl{text}
+\textsterling
+\textsuperscript
+\texttrademark
+\texttt{text}
+\textunderscore
+\textup{text}
+\textvisiblespace
+\textwidth
+\thanks{text}
+\thicklines
+\thinlines
+\thispagestyle{empty/plain/headings/myheadings}
+\time
+\tiny
+\title{text}
+\today
+\ttfamily
+\twocolumn[text]
+\typein[cmd]{msg}
+\typein{msg}
+\typeout{msg}
+\unboldmath
+\underbrace{text}
+\underline{text}
+\upshape
+\usepackage[options]{package}
+\usepackage{package}
+\vdots
+\vector(xslope,yslope){length}
+\verb
+\vline
+\vspace*{length}
+\vspace{length}
+\width
+# new definitions
+\newcommand{cmd}[args][default]{def}
+\newcommand{cmd}[args]{def}
+\newcommand{cmd}{def}
+\providecommand{cmd}[args][default]{def}
+\providecommand{cmd}[args]{def}
+\providecommand{cmd}{def}
+\newenvironment{nam}[args][default]{begdef}{enddef}
+\newenvironment{nam}[args]{begdef}{enddef}
+\newenvironment{nam}{begdef}{enddef}
+\renewcommand{cmd}[args][default]{def}
+\renewcommand{cmd}[args]{def}
+\renewcommand{cmd}{def}
+\renewenvironment{nam}[args][default]{begdef}{enddef}
+\renewenvironment{nam}[args]{begdef}{enddef}
+\renewenvironment{nam}{begdef}{enddef}
+\left(
+\left[
+\left\lbrace
+\left|
+\left\|
+\left/
+\left\backslash
+\left\langle
+\left\lfloor
+\left\lceil
+\left\uparrow
+\left\downarrow
+\left\updownarrow
+\left\Uparrow
+\left\Downarrow
+\left\Updownarrow
+\left.
+\right(
+\right[
+\right\rbrace
+\right|
+\right\|
+\right/
+\right\backslash
+\right\rangle
+\right\rfloor
+\right\rceil
+\right\uparrow
+\right\downarrow
+\right\updownarrow
+\right\Uparrow
+\right\Downarrow
+\right\Updownarrow
+\right.
diff --git a/src/kile/complete/tex/latex-l2tabu.cwl b/src/kile/complete/tex/latex-l2tabu.cwl
new file mode 100644
index 0000000..a443eed
--- /dev/null
+++ b/src/kile/complete/tex/latex-l2tabu.cwl
@@ -0,0 +1,16 @@
+# latex mode: LaTeX commands (l2tabu level)
+# commands that shall not be used for reasons documented in l2tabu.pdf
+# dani/2006-02-18
+\begin{appendix}
+\begin{eqnarray}
+\begin{eqnarray*}
+\begin{fussypar}
+\begin{sloppypar}
+\end{appendix}
+\end{eqnarray}
+\end{eqnarray*}
+\end{fussypar}
+\end{sloppypar}
+\centerline{text}
+\fussy
+\sloppy
diff --git a/src/kile/complete/tex/latex-mathsymbols.cwl b/src/kile/complete/tex/latex-mathsymbols.cwl
new file mode 100644
index 0000000..2209ea0
--- /dev/null
+++ b/src/kile/complete/tex/latex-mathsymbols.cwl
@@ -0,0 +1,269 @@
+# tex/latex mode: MathSymbols
+# dani/8.1.2004
+\acute{a}
+\aleph
+\alpha
+\amalg
+\angle
+\approx
+\arccos
+\arcsin
+\arctan
+\arg
+\Arrowvert
+\arrowvert
+\ast
+\asymp
+\backslash
+\bar{a}
+\beta
+\Big
+\big
+\bigcap
+\bigcirc
+\bigcup
+\Bigg
+\bigg
+\Biggl
+\Biggl..\Biggr
+\biggl
+\biggl..\biggr
+\Biggm
+\biggm
+\Biggr
+\biggr
+\Bigl
+\Bigl..\Bigr
+\bigl
+\bigl..\bigr
+\Bigm
+\bigm
+\bigodot
+\bigoplus
+\bigotimes
+\Bigr
+\bigr
+\bigsqcup
+\bigtriangledown
+\bigtriangleup
+\biguplus
+\bigvee
+\bigwedge
+\bot
+\bracevert
+\breve{a}
+\bullet
+\cap
+\cdot
+\check{a}
+\chi
+\circ
+\clubsuit
+\cong
+\coprod
+\cos
+\cosh
+\cot
+\coth
+\csc
+\cup
+\dagger
+\dashv
+\ddagger
+\ddot{a}
+\deg
+\Delta
+\delta
+\det
+\diamond
+\diamondsuit
+\dim
+\div
+\doteq
+\dot{a}
+\dot{x}
+\Downarrow
+\Downarrow
+\downarrow
+\downarrow
+\ell
+\emptyset
+\epsilon
+\equiv
+\eta
+\exists
+\exp
+\flat
+\forall
+\frown
+\Gamma
+\gamma
+\gcd
+\ge
+\geq
+\gets
+\gg
+\grave{a}
+\hat{a}
+\hbar
+\heartsuit
+\hom
+\hookleftarrow
+\hookrightarrow
+\Im
+\imath
+\in
+\inf
+\infty
+\int
+\iota
+\jmath
+\kappa
+\ker
+\Lambda
+\lambda
+\langle
+\lbrace
+\lbrack
+\lceil
+\le
+\Leftarrow
+\leftarrow
+\leftharpoondown
+\leftharpoonup
+\Leftrightarrow
+\leftrightarrow
+\leq
+\lfloor
+\lg
+\lgroup
+\lim
+\liminf
+\limsup
+\ll
+\lmoustache
+\ln
+\log
+\Longleftarrow
+\longleftarrow
+\longleftrightarrow
+\Longleftrightarrow
+\longmapsto
+\Longrightarrow
+\longrightarrow
+\mapsto
+\max
+\mid
+\min
+\models
+\mp
+\mu
+\nabla
+\natural
+\nearrow
+\neg
+\neq
+\ni
+\not
+\notin
+\nu
+\nwarrow
+\odot
+\oint
+\Omega
+\omega
+\ominus
+\oplus
+\oslash
+\otimes
+\parallel
+\partial
+\perp
+\Phi
+\phi
+\Pi
+\pi
+\pm
+\Pr
+\prec
+\preceq
+\prime
+\prod
+\propto
+\Psi
+\psi
+\rangle
+\rbrace
+\rbrack
+\rceil
+\Re
+\rfloor
+\rgroup
+\rho
+\Rightarrow
+\rightarrow
+\rightharpoondown
+\rightharpoonup
+\rightleftharpoons
+\rmoustache
+\searrow
+\sec
+\setminus
+\sharp
+\Sigma
+\sigma
+\sim
+\simeq
+\sin
+\sinh
+\smile
+\spadesuit
+\sqcup
+\sqsupseteq
+\star
+\subset
+\subseteq
+\succ
+\succeq
+\sum
+\sup
+\supset
+\supseteq
+\surd
+\swarrow
+\tan
+\tanh
+\tau
+\Theta
+\theta
+\tilde{a}
+\times
+\to
+\top
+\triangle
+\triangleleft
+\triangleright
+\Uparrow
+\uparrow
+\Updownarrow
+\updownarrow
+\uplus
+\Upsilon
+\upsilon
+\varepsilon
+\varphi
+\varpi
+\varrho
+\varsigma
+\vartheta
+\vdash
+\vec{a}
+\vee
+\Vert
+\vert
+\wedge
+\wp
+\wr
+\Xi
+\xi
+\zeta
diff --git a/src/kile/complete/tex/layout.cwl b/src/kile/complete/tex/layout.cwl
new file mode 100644
index 0000000..6ba9ef9
--- /dev/null
+++ b/src/kile/complete/tex/layout.cwl
@@ -0,0 +1,3 @@
+# layout package
+# neeraavi 20 Mar 2007
+\layout
diff --git a/src/kile/complete/tex/listings.cwl b/src/kile/complete/tex/listings.cwl
new file mode 100644
index 0000000..1c03181
--- /dev/null
+++ b/src/kile/complete/tex/listings.cwl
@@ -0,0 +1,20 @@
+# mode: listings.sty
+# dani/2006-02-18
+\begin{lstlisting}
+\begin{lstlisting}[kv-list]
+\end{lstlisting}
+\lstalias{alias}{language}
+\lstdefinestyle{style name}{kv-list}
+\lstinline
+\lstinline[kv-list]
+\lstinputlisting{filename}
+\lstinputlisting[kv-list]{filename}
+\lstlistingname
+\lstlistlistingname
+\lstlistoflistings
+\lstname
+\lstnewenvironment{name}[params][default]{starting code}{ending code}
+\lstnewenvironment{name}[params]{starting code}{ending code}
+\lstnewenvironment{name}{starting code}{ending code}
+\lstset{kv-list}
+\thelstlisting
diff --git a/src/kile/complete/tex/logsys.cwl b/src/kile/complete/tex/logsys.cwl
new file mode 100644
index 0000000..e669051
--- /dev/null
+++ b/src/kile/complete/tex/logsys.cwl
@@ -0,0 +1,22 @@
+#logsys.cwl
+#for logsys package
+#neeraavi 26 Mar 2007
+\logline[spacing]{from}{to}
+\logline*[spacing]{from}{to}
+\vlogline[spacing]{from}{to}
+\vlogline*[spacing]{from}{to}
+\logsys[h-spacing][v-spacing](lower-left)(upper-right)
+\logsys*[h-spacing][v-spacing](lower-left)(upper-right)
+\semilogsys[h-spacing][v-spacing](lower-left)(upper-right)
+\semilogsys*[h-spacing][v-spacing](lower-left)(upper-right)
+\loglogsys[h-spacing][v-spacing](lower-left)(upper-right)
+\loglogsys*[h-spacing][v-spacing](lower-left)(upper-right)
+\loggrid[h-spacing][v-spacing](lower-left)(upper-right)
+\loggrid*[h-spacing][v-spacing](lower-left)(upper-right)
+\semiloggrid[h-spacing][v-spacing](lower-left)(upper-right)
+\semiloggrid*[h-spacing][v-spacing](lower-left)(upper-right)
+\logloggrid[h-spacing][v-spacing](lower-left)(upper-right)
+\logloggrid*[h-spacing][v-spacing](lower-left)(upper-right)
+\interval
+\intervalthickness
+\vinterval
diff --git a/src/kile/complete/tex/longtable.cwl b/src/kile/complete/tex/longtable.cwl
new file mode 100644
index 0000000..f7af464
--- /dev/null
+++ b/src/kile/complete/tex/longtable.cwl
@@ -0,0 +1,17 @@
+# mode: longtable.sty
+# dani/2006-02-18
+\begin{longtable}[alignment]{preamble}
+\begin{longtable}{preamble}
+\caption*{text}
+\endfirstfoot
+\endfirsthead
+\endfoot
+\endhead
+\end{longtable}
+\LTcapwidth
+\LTleft
+\LTpost
+\LTpre
+\LTright
+\setlongtables
+\tabularnewline
diff --git a/src/kile/complete/tex/lscape.cwl b/src/kile/complete/tex/lscape.cwl
new file mode 100644
index 0000000..982c336
--- /dev/null
+++ b/src/kile/complete/tex/lscape.cwl
@@ -0,0 +1,2 @@
+\begin{landscape}
+\end{landscape}
diff --git a/src/kile/complete/tex/manyfoot.cwl b/src/kile/complete/tex/manyfoot.cwl
new file mode 100644
index 0000000..6ee007d
--- /dev/null
+++ b/src/kile/complete/tex/manyfoot.cwl
@@ -0,0 +1,16 @@
+# manyfoot.cwl
+# manyfoot package
+# neeraavi 27 Mar 2007
+\extrafootnoterule
+\defaultfootnoterule
+\newfootnote
+\Footnotemark{marker}
+\Footnotetext{marker}{inserted text}
+\Footnote{marker}{inserted text}
+\DeclareNewFootnote[footnote-style]{suffix}[enumeration-style]
+\SelectFootnoteRule{default}
+\SelectFootnoteRule[priority]{rule-name}[action]
+\footnoterulepriority
+\SetFootnoteHook
+\SplitNote
+\ExtraParaSkip
diff --git a/src/kile/complete/tex/mdwlist.cwl b/src/kile/complete/tex/mdwlist.cwl
new file mode 100644
index 0000000..995b9aa
--- /dev/null
+++ b/src/kile/complete/tex/mdwlist.cwl
@@ -0,0 +1,17 @@
+# mode: mdwlist.sty
+# dani/2006-02-18
+\begin{description*}
+\begin{enumerate*}
+\begin{itemize*}
+\desclabelstyle{style}
+\desclabelwidth{length}
+\end{description*}
+\end{enumerate*}
+\end{itemize*}
+\multilinelabel
+\nextlinelabel
+\pushlabel
+\resume{envname}
+\resume[magicname]{envname}
+\suspend{envname}
+\suspend[magicname]{envname}
diff --git a/src/kile/complete/tex/multicol.cwl b/src/kile/complete/tex/multicol.cwl
new file mode 100644
index 0000000..e422be7
--- /dev/null
+++ b/src/kile/complete/tex/multicol.cwl
@@ -0,0 +1,15 @@
+# mode: multicol.sty
+# dani/2006-02-18
+\begin{multicols}{n}
+\begin{multicols*}{n}
+\begin{multicols}{n}[preface]
+\begin{multicols*}{n}[preface]
+\begin{multicols}{n}[preface][skip]
+\begin{multicols*}{n}[preface][skip]
+\columnbreak
+\end{multicols}
+\end{multicols*}
+\multicolsep
+\multicoltolerance
+\postmulticols
+\premulticols
diff --git a/src/kile/complete/tex/multido.cwl b/src/kile/complete/tex/multido.cwl
new file mode 100644
index 0000000..3dd3ebd
--- /dev/null
+++ b/src/kile/complete/tex/multido.cwl
@@ -0,0 +1,3 @@
+# mode: multido.sty
+# dani/2006-02-22
+\multido{variables}{repititions}{actions}
diff --git a/src/kile/complete/tex/pdfpages.cwl b/src/kile/complete/tex/pdfpages.cwl
new file mode 100644
index 0000000..2fc9d4a
--- /dev/null
+++ b/src/kile/complete/tex/pdfpages.cwl
@@ -0,0 +1,8 @@
+# pdfpages package
+# mario 09/06/2007
+# URL: http://tug.ctan.org/tex-archive/macros/latex/contrib/pdfpages/
+\includepdf[options]{filename}
+\includepdf{filename}
+\includepdfmerge[options]{file-list}
+\includepdfmerge{file-list}
+\includepdfset{global options}
diff --git a/src/kile/complete/tex/psfrag.cwl b/src/kile/complete/tex/psfrag.cwl
new file mode 100644
index 0000000..9916ff3
--- /dev/null
+++ b/src/kile/complete/tex/psfrag.cwl
@@ -0,0 +1,8 @@
+\psfrag{tag}{replacement}
+\psfrag{tag}[posn][psposn][scale][rot]{replacement}
+\psfrag*{tag}{replacement}
+\psfrag*{tag}[posn][psposn][scale][rot]{replacement}
+\begin{psfrags}
+\end{psfrags}
+\psfragscanon
+\psfragscanoff
diff --git a/src/kile/complete/tex/pst-3d.cwl b/src/kile/complete/tex/pst-3d.cwl
new file mode 100644
index 0000000..7b42aa9
--- /dev/null
+++ b/src/kile/complete/tex/pst-3d.cwl
@@ -0,0 +1,12 @@
+# mode: pst-3d.sty
+# dani/2006-02-22
+\psshadow[par]{stuff}
+\psshadow*[par]{stuff}
+\psshadow{stuff}
+\psshadow*{stuff}
+\pstilt{degrees}{stuff}
+\psTilt{degrees}{stuff}
+\pstilt[par]{degrees}{stuff}
+\psTilt[par]{degrees}{stuff}
+\ThreeDput[par](x0,y0,z0){object}
+\ThreeDput(x0,y0,z0){object}
diff --git a/src/kile/complete/tex/pst-blur.cwl b/src/kile/complete/tex/pst-blur.cwl
new file mode 100644
index 0000000..52ab63c
--- /dev/null
+++ b/src/kile/complete/tex/pst-blur.cwl
@@ -0,0 +1,4 @@
+# mode: pst-blur.sty
+# dani/2006-02-22
+\psblurbox{stuff}
+\psblurbox[par]{stuff}
diff --git a/src/kile/complete/tex/pst-char.cwl b/src/kile/complete/tex/pst-char.cwl
new file mode 100644
index 0000000..90ae569
--- /dev/null
+++ b/src/kile/complete/tex/pst-char.cwl
@@ -0,0 +1,17 @@
+# mode: pst-char.sty
+# dani/2006-02-22
+\begin{charclip}[par]{text}
+\begin{charclip*}[par]{text}
+\begin{charclip}{text}
+\begin{charclip*}{text}
+\end{charclip}
+\end{charclip*}
+\endpscharclip
+\pscharclip[par]{text}
+\pscharclip*[par]{text}
+\pscharclip{text}
+\pscharclip*{text}
+\pscharpath[par]{text}
+\pscharpath*[par]{text}
+\pscharpath{text}
+\pscharpath*{text}
diff --git a/src/kile/complete/tex/pst-coil.cwl b/src/kile/complete/tex/pst-coil.cwl
new file mode 100644
index 0000000..aec49b6
--- /dev/null
+++ b/src/kile/complete/tex/pst-coil.cwl
@@ -0,0 +1,22 @@
+# mode: pst-coil.sty
+# dani/2006-02-22
+\psCoil{angle1}{angle2}
+\psCoil*{angle1}{angle2}
+\pscoil{arrows}(x0,y0)(x1,y1)
+\pscoil*{arrows}(x0,y0)(x1,y1)
+\psCoil[par]{angle1}{angle2}
+\psCoil*[par]{angle1}{angle2}
+\pscoil[par]{arrows}(x0,y0)(x1,y1)
+\pscoil*[par]{arrows}(x0,y0)(x1,y1)
+\pscoil[par](x0,y0)(x1,y1)
+\pscoil*[par](x0,y0)(x1,y1)
+\pscoil(x0,y0)(x1,y1)
+\pscoil*(x0,y0)(x1,y1)
+\pszigzag{arrows}(x0,y0)(x1,y1)
+\pszigzag*{arrows}(x0,y0)(x1,y1)
+\pszigzag[par]{arrows}(x0,y0)(x1,y1)
+\pszigzag*[par]{arrows}(x0,y0)(x1,y1)
+\pszigzag[par](x0,y0)(x1,y1)
+\pszigzag*[par](x0,y0)(x1,y1)
+\pszigzag(x0,y0)(x1,y1)
+\pszigzag*(x0,y0)(x1,y1)
diff --git a/src/kile/complete/tex/pst-eps.cwl b/src/kile/complete/tex/pst-eps.cwl
new file mode 100644
index 0000000..fcb3443
--- /dev/null
+++ b/src/kile/complete/tex/pst-eps.cwl
@@ -0,0 +1,8 @@
+# mode: pst-eps.sty
+# dani/2006-02-22
+\begin{TeXtoEPS}
+\endTeXtoEPS
+\end{TeXtoEPS}
+\PSTtoEPS{file}{graphics objects}
+\PSTtoEPS[par]{file}{graphics objects}
+\TeXtoEPS
diff --git a/src/kile/complete/tex/pst-fill.cwl b/src/kile/complete/tex/pst-fill.cwl
new file mode 100644
index 0000000..1f3ed8b
--- /dev/null
+++ b/src/kile/complete/tex/pst-fill.cwl
@@ -0,0 +1,4 @@
+# mode: pst-fill.sty
+# dani/2006-02-22
+\psboxfill{stuff}
+\PstTiling
diff --git a/src/kile/complete/tex/pst-node.cwl b/src/kile/complete/tex/pst-node.cwl
new file mode 100644
index 0000000..38036bf
--- /dev/null
+++ b/src/kile/complete/tex/pst-node.cwl
@@ -0,0 +1,281 @@
+# mode: pst-node.sty
+# dani/2006-02-22
+\circlenode{name}{stuff}
+\circlenode*{name}{stuff}
+\circlenode[par]{name}{stuff}
+\circlenode*[par]{name}{stuff}
+\Cnode[par](x,y){name}
+\Cnode*[par](x,y){name}
+\cnode[par](x,y){radius}{name}
+\cnode*[par](x,y){radius}{name}
+\cnodeput{angle}(x,y){name}{stuff}
+\cnodeput*{angle}(x,y){name}{stuff}
+\cnodeput[par]{angle}(x,y){name}{stuff}
+\cnodeput*[par]{angle}(x,y){name}{stuff}
+\cnodeput[par](x,y){name}{stuff}
+\cnodeput*[par](x,y){name}{stuff}
+\cnodeput(x,y){name}{stuff}
+\cnodeput*(x,y){name}{stuff}
+\Cnode(x,y){name}
+\Cnode*(x,y){name}
+\cnode(x,y){radius}{name}
+\cnode*(x,y){radius}{name}
+\dianode{name}{stuff}
+\dianode*{name}{stuff}
+\dianode[par]{name}{stuff}
+\dianode*[par]{name}{stuff}
+\dotnode[par](x,y){name}{stuff}
+\dotnode*[par](x,y){name}{stuff}
+\dotnode(x,y){name}{stuff}
+\dotnode*(x,y){name}{stuff}
+\fnode[par](x,y){name}{stuff}
+\fnode*[par](x,y){name}{stuff}
+\fnode(x,y){name}{stuff}
+\fnode*(x,y){name}{stuff}
+\naput[par]{stuff}
+\naput*[par]{stuff}
+\naput{stuff}
+\naput*{stuff}
+\nbput[par]{stuff}
+\nbput*[par]{stuff}
+\nbput{stuff}
+\nbput*{stuff}
+\ncangle{arrows}{nodeA}{nodeB}
+\ncangle*{arrows}{nodeA}{nodeB}
+\ncangle{nodeA}{nodeB}
+\ncangle*{nodeA}{nodeB}
+\ncangle[par]{arrows}{nodeA}{nodeB}
+\ncangle*[par]{arrows}{nodeA}{nodeB}
+\ncangle[par]{nodeA}{nodeB}
+\ncangle*[par]{nodeA}{nodeB}
+\ncangles{arrows}{nodeA}{nodeB}
+\ncangles*{arrows}{nodeA}{nodeB}
+\ncangles{nodeA}{nodeB}
+\ncangles*{nodeA}{nodeB}
+\ncangles[par]{arrows}{nodeA}{nodeB}
+\ncangles*[par]{arrows}{nodeA}{nodeB}
+\ncangles[par]{nodeA}{nodeB}
+\ncangles*[par]{nodeA}{nodeB}
+\ncarc{arrows}{nodeA}{nodeB}
+\ncarc*{arrows}{nodeA}{nodeB}
+\ncarcbox{nodeA}{nodeB}
+\ncarcbox*{nodeA}{nodeB}
+\ncarcbox[par]{nodeA}{nodeB}
+\ncarcbox*[par]{nodeA}{nodeB}
+\ncarc{nodeA}{nodeB}
+\ncarc*{nodeA}{nodeB}
+\ncarc[par]{arrows}{nodeA}{nodeB}
+\ncarc*[par]{arrows}{nodeA}{nodeB}
+\ncarc[par]{nodeA}{nodeB}
+\ncarc*[par]{nodeA}{nodeB}
+\ncbar{arrows}{nodeA}{nodeB}
+\ncbar*{arrows}{nodeA}{nodeB}
+\ncbar{nodeA}{nodeB}
+\ncbar*{nodeA}{nodeB}
+\ncbar[par]{arrows}{nodeA}{nodeB}
+\ncbar*[par]{arrows}{nodeA}{nodeB}
+\ncbar[par]{nodeA}{nodeB}
+\ncbar*[par]{nodeA}{nodeB}
+\ncbox{nodeA}{nodeB}
+\ncbox*{nodeA}{nodeB}
+\ncbox[par]{nodeA}{nodeB}
+\ncbox*[par]{nodeA}{nodeB}
+\nccircle{arrows}{nodeA}{nodeB}
+\nccircle*{arrows}{nodeA}{nodeB}
+\nccircle{nodeA}{nodeB}
+\nccircle*{nodeA}{nodeB}
+\nccircle[par]{arrows}{nodeA}{nodeB}
+\nccircle*[par]{arrows}{nodeA}{nodeB}
+\nccircle[par]{nodeA}{nodeB}
+\nccircle*[par]{nodeA}{nodeB}
+\nccoil{arrows}{nodeA}{nodeB}
+\nccoil*{arrows}{nodeA}{nodeB}
+\nccoil{nodeA}{nodeB}
+\nccoil*{nodeA}{nodeB}
+\nccoil[par]{arrows}{nodeA}{nodeB}
+\nccoil*[par]{arrows}{nodeA}{nodeB}
+\nccoil[par]{nodeA}{nodeB}
+\nccoil*[par]{nodeA}{nodeB}
+\nccurve{arrows}{nodeA}{nodeB}
+\nccurve*{arrows}{nodeA}{nodeB}
+\nccurve{nodeA}{nodeB}
+\nccurve*{nodeA}{nodeB}
+\nccurve[par]{arrows}{nodeA}{nodeB}
+\nccurve*[par]{arrows}{nodeA}{nodeB}
+\nccurve[par]{nodeA}{nodeB}
+\nccurve*[par]{nodeA}{nodeB}
+\ncdiag{arrows}{nodeA}{nodeB}
+\ncdiag*{arrows}{nodeA}{nodeB}
+\ncdiagg{arrows}{nodeA}{nodeB}
+\ncdiagg*{arrows}{nodeA}{nodeB}
+\ncdiagg{nodeA}{nodeB}
+\ncdiagg*{nodeA}{nodeB}
+\ncdiagg[par]{arrows}{nodeA}{nodeB}
+\ncdiagg*[par]{arrows}{nodeA}{nodeB}
+\ncdiagg[par]{nodeA}{nodeB}
+\ncdiagg*[par]{nodeA}{nodeB}
+\ncdiag{nodeA}{nodeB}
+\ncdiag*{nodeA}{nodeB}
+\ncdiag[par]{arrows}{nodeA}{nodeB}
+\ncdiag*[par]{arrows}{nodeA}{nodeB}
+\ncdiag[par]{nodeA}{nodeB}
+\ncdiag*[par]{nodeA}{nodeB}
+\ncline{arrows}{nodeA}{nodeB}
+\ncline*{arrows}{nodeA}{nodeB}
+\ncLine{arrows}{nodeA}{nodeB}
+\ncLine*{arrows}{nodeA}{nodeB}
+\ncline{nodeA}{nodeB}
+\ncline*{nodeA}{nodeB}
+\ncLine{nodeA}{nodeB}
+\ncLine*{nodeA}{nodeB}
+\ncline[par]{arrows}{nodeA}{nodeB}
+\ncline*[par]{arrows}{nodeA}{nodeB}
+\ncLine[par]{arrows}{nodeA}{nodeB}
+\ncLine*[par]{arrows}{nodeA}{nodeB}
+\ncline[par]{nodeA}{nodeB}
+\ncline*[par]{nodeA}{nodeB}
+\ncLine[par]{nodeA}{nodeB}
+\ncLine*[par]{nodeA}{nodeB}
+\ncloop{arrows}{nodeA}{nodeB}
+\ncloop*{arrows}{nodeA}{nodeB}
+\ncloop{nodeA}{nodeB}
+\ncloop*{nodeA}{nodeB}
+\ncloop[par]{arrows}{nodeA}{nodeB}
+\ncloop*[par]{arrows}{nodeA}{nodeB}
+\ncloop[par]{nodeA}{nodeB}
+\ncloop*[par]{nodeA}{nodeB}
+\ncput[par]{stuff}
+\ncput*[par]{stuff}
+\ncput{stuff}
+\ncput*{stuff}
+\nczigzag{arrows}{nodeA}{nodeB}
+\nczigzag*{arrows}{nodeA}{nodeB}
+\nczigzag{nodeA}{nodeB}
+\nczigzag*{nodeA}{nodeB}
+\nczigzag[par]{arrows}{nodeA}{nodeB}
+\nczigzag*[par]{arrows}{nodeA}{nodeB}
+\nczigzag[par]{nodeA}{nodeB}
+\nczigzag*[par]{nodeA}{nodeB}
+\nput[par]{refangle}{name}{stuff}
+\nput*[par]{refangle}{name}{stuff}
+\nput{refangle}{name}{stuff}
+\nput*{refangle}{name}{stuff}
+\ovalnode{name}{stuff}
+\ovalnode*{name}{stuff}
+\ovalnode[par]{name}{stuff}
+\ovalnode*[par]{name}{stuff}
+\pcangle{arrows}(x1,y1)(x2,y2)
+\pcangle*{arrows}(x1,y1)(x2,y2)
+\pcangle[par]{arrows}(x1,y1)(x2,y2)
+\pcangle*[par]{arrows}(x1,y1)(x2,y2)
+\pcangle[par](x1,y1)(x2,y2)
+\pcangle*[par](x1,y1)(x2,y2)
+\pcangle(x1,y1)(x2,y2)
+\pcangle*(x1,y1)(x2,y2)
+\pcarc{arrows}(x1,y1)(x2,y2)
+\pcarc*{arrows}(x1,y1)(x2,y2)
+\pcarcbox[par](x1,y1)(x2,y2)
+\pcarcbox*[par](x1,y1)(x2,y2)
+\pcarcbox(x1,y1)(x2,y2)
+\pcarcbox*(x1,y1)(x2,y2)
+\pcarc[par]{arrows}(x1,y1)(x2,y2)
+\pcarc*[par]{arrows}(x1,y1)(x2,y2)
+\pcarc[par](x1,y1)(x2,y2)
+\pcarc*[par](x1,y1)(x2,y2)
+\pcarc(x1,y1)(x2,y2)
+\pcarc*(x1,y1)(x2,y2)
+\pcbar{arrows}(x1,y1)(x2,y2)
+\pcbar*{arrows}(x1,y1)(x2,y2)
+\pcbar[par]{arrows}(x1,y1)(x2,y2)
+\pcbar*[par]{arrows}(x1,y1)(x2,y2)
+\pcbar[par](x1,y1)(x2,y2)
+\pcbar*[par](x1,y1)(x2,y2)
+\pcbar(x1,y1)(x2,y2)
+\pcbar*(x1,y1)(x2,y2)
+\pcbox[par](x1,y1)(x2,y2)
+\pcbox*[par](x1,y1)(x2,y2)
+\pcbox(x1,y1)(x2,y2)
+\pcbox*(x1,y1)(x2,y2)
+\pccoil{arrows}(x1,y1)(x2,y2)
+\pccoil*{arrows}(x1,y1)(x2,y2)
+\pccoil[par]{arrows}(x1,y1)(x2,y2)
+\pccoil*[par]{arrows}(x1,y1)(x2,y2)
+\pccoil[par](x1,y1)(x2,y2)
+\pccoil*[par](x1,y1)(x2,y2)
+\pccoil(x1,y1)(x2,y2)
+\pccoil*(x1,y1)(x2,y2)
+\pccurve{arrows}(x1,y1)(x2,y2)
+\pccurve*{arrows}(x1,y1)(x2,y2)
+\pccurve[par]{arrows}(x1,y1)(x2,y2)
+\pccurve*[par]{arrows}(x1,y1)(x2,y2)
+\pccurve[par](x1,y1)(x2,y2)
+\pccurve*[par](x1,y1)(x2,y2)
+\pccurve(x1,y1)(x2,y2)
+\pccurve*(x1,y1)(x2,y2)
+\pcdiag{arrows}(x1,y1)(x2,y2)
+\pcdiag*{arrows}(x1,y1)(x2,y2)
+\pcdiag[par]{arrows}(x1,y1)(x2,y2)
+\pcdiag*[par]{arrows}(x1,y1)(x2,y2)
+\pcdiag[par](x1,y1)(x2,y2)
+\pcdiag*[par](x1,y1)(x2,y2)
+\pcdiag(x1,y1)(x2,y2)
+\pcdiag*(x1,y1)(x2,y2)
+\pcline{arrows}(x1,y1)(x2,y2)
+\pcline*{arrows}(x1,y1)(x2,y2)
+\pcline[par]{arrows}(x1,y1)(x2,y2)
+\pcline*[par]{arrows}(x1,y1)(x2,y2)
+\pcline[par](x1,y1)(x2,y2)
+\pcline*[par](x1,y1)(x2,y2)
+\pcline(x1,y1)(x2,y2)
+\pcline*(x1,y1)(x2,y2)
+\pcloop{arrows}(x1,y1)(x2,y2)
+\pcloop*{arrows}(x1,y1)(x2,y2)
+\pcloop[par]{arrows}(x1,y1)(x2,y2)
+\pcloop*[par]{arrows}(x1,y1)(x2,y2)
+\pcloop[par](x1,y1)(x2,y2)
+\pcloop*[par](x1,y1)(x2,y2)
+\pcloop(x1,y1)(x2,y2)
+\pcloop*(x1,y1)(x2,y2)
+\pczigzag{arrows}(x1,y1)(x2,y2)
+\pczigzag*{arrows}(x1,y1)(x2,y2)
+\pczigzag[par]{arrows}(x1,y1)(x2,y2)
+\pczigzag*[par]{arrows}(x1,y1)(x2,y2)
+\pczigzag[par](x1,y1)(x2,y2)
+\pczigzag*[par](x1,y1)(x2,y2)
+\pczigzag(x1,y1)(x2,y2)
+\pczigzag*(x1,y1)(x2,y2)
+\pnode(x,y){stuff}
+\rnode{name}{stuff}
+\Rnode[par](x,y){name}{stuff}
+\Rnode*[par](x,y){name}{stuff}
+\rnode[refpoint]{name}{stuff}
+\Rnode(x,y){name}{stuff}
+\Rnode*(x,y){name}{stuff}
+\taput[par]{stuff}
+\taput*[par]{stuff}
+\taput{stuff}
+\taput*{stuff}
+\tbput[par]{stuff}
+\tbput*[par]{stuff}
+\tbput{stuff}
+\tbput*{stuff}
+\thput[par]{stuff}
+\thput*[par]{stuff}
+\thput{stuff}
+\thput*{stuff}
+\tlput[par]{stuff}
+\tlput*[par]{stuff}
+\tlput{stuff}
+\tlput*{stuff}
+\trinode{name}{stuff}
+\trinode*{name}{stuff}
+\trinode[par]{name}{stuff}
+\trinode*[par]{name}{stuff}
+\trput[par]{stuff}
+\trput*[par]{stuff}
+\trput{stuff}
+\trput*{stuff}
+\tvput[par]{stuff}
+\tvput*[par]{stuff}
+\tvput{stuff}
+\tvput*{stuff}
diff --git a/src/kile/complete/tex/pst-plot.cwl b/src/kile/complete/tex/pst-plot.cwl
new file mode 100644
index 0000000..ba3f79b
--- /dev/null
+++ b/src/kile/complete/tex/pst-plot.cwl
@@ -0,0 +1,36 @@
+# mode: pst-plot.sty
+# dani/2006-02-22
+\dataplot{commands}
+\dataplot*{commands}
+\dataplot[par]{commands}
+\dataplot*[par]{commands}
+\fileplot{file}
+\fileplot*{file}
+\fileplot[par]{file}
+\fileplot*[par]{file}
+\listplot{list}
+\listplot*{list}
+\listplot[par]{list}
+\listplot*[par]{list}
+\parametricplot[par]{tmin}{tmax}{function}
+\parametricplot*[par]{tmin}{tmax}{function}
+\parametricplot{tmin}{tmax}{function}
+\parametricplot*{tmin}{tmax}{function}
+\psaxes{arrows}(x0,y0)(x1,y1)(x2,y2)
+\psaxes*{arrows}(x0,y0)(x1,y1)(x2,y2)
+\psaxes[par]{arrows}(x0,y0)(x1,y1)(x2,y2)
+\psaxes*[par]{arrows}(x0,y0)(x1,y1)(x2,y2)
+\psaxes[par](x0,y0)(x1,y1)(x2,y2)
+\psaxes*[par](x0,y0)(x1,y1)(x2,y2)
+\psaxes(x0,y0)(x1,y1)(x2,y2)
+\psaxes*(x0,y0)(x1,y1)(x2,y2)
+\pshlabel
+\psplot[par]{xmin}{xmax}{function}
+\psplot*[par]{xmin}{xmax}{function}
+\psplot{xmin}{xmax}{function}
+\psplot*{xmin}{xmax}{function}
+\psvlabel
+\psxlabel
+\psylabel
+\readdata{command}{file}
+\savedata{command}[data]
diff --git a/src/kile/complete/tex/pst-text.cwl b/src/kile/complete/tex/pst-text.cwl
new file mode 100644
index 0000000..ae5378c
--- /dev/null
+++ b/src/kile/complete/tex/pst-text.cwl
@@ -0,0 +1,4 @@
+# mode: pst-text.sty
+# dani/2006-02-22
+\pstextpath[pos](x,y){graphics object}{text}
+\pstextpath(x,y){graphics object}{text}
diff --git a/src/kile/complete/tex/pst-tree.cwl b/src/kile/complete/tex/pst-tree.cwl
new file mode 100644
index 0000000..65e094e
--- /dev/null
+++ b/src/kile/complete/tex/pst-tree.cwl
@@ -0,0 +1,66 @@
+# mode: pst-tree.sty
+# dani/2006-02-22
+\begin{psTree}{node}
+\end{psTree}
+\psedge
+\pspred
+\pssucc
+\pstree{node}{subtrees}
+\skiplevel[par]{subtrees}
+\skiplevel*[par]{subtrees}
+\skiplevels[par]{n}
+\skiplevels*[par]{n}
+\TC
+\TC*
+\Tc{dim}
+\Tc*{dim}
+\Tcircle[par]{stuff}
+\Tcircle*[par]{stuff}
+\TCircle[par]{stuff}
+\TCircle*[par]{stuff}
+\Tcircle{stuff}
+\Tcircle*{stuff}
+\TCircle{stuff}
+\TCircle*{stuff}
+\TC[par]
+\TC*[par]
+\Tc[par]{dim}
+\Tc*[par]{dim}
+\Tdia[par]{stuff}
+\Tdia*[par]{stuff}
+\Tdia{stuff}
+\Tdia*{stuff}
+\Tdot
+\Tdot*
+\Tdot[par]
+\Tdot*[par]
+\Tf
+\Tf*
+\Tfan
+\Tfan*
+\Tfan[par]
+\Tfan*[par]
+\Tf[par]
+\Tf*[par]
+\Tn
+\Toval[par]{stuff}
+\Toval*[par]{stuff}
+\Toval{stuff}
+\Toval*{stuff}
+\Tp
+\Tp*
+\Tp[par]
+\Tp*[par]
+\Tr[par]{stuff}
+\Tr*[par]{stuff}
+\TR[par]{stuff}
+\TR*[par]{stuff}
+\Tr{stuff}
+\Tr*{stuff}
+\TR{stuff}
+\TR*{stuff}
+\tspace{dim}
+\Ttri[par]{stuff}
+\Ttri*[par]{stuff}
+\Ttri{stuff}
+\Ttri*{stuff}
diff --git a/src/kile/complete/tex/pstricks.cwl b/src/kile/complete/tex/pstricks.cwl
new file mode 100644
index 0000000..c772385
--- /dev/null
+++ b/src/kile/complete/tex/pstricks.cwl
@@ -0,0 +1,242 @@
+# mode: pstricks.sty
+# dani/2006-02-22
+\arrows{arrows}
+\begin{pspicture}[par](x0,y0)(x1,y1)
+\begin{pspicture*}[par](x0,y0)(x1,y1)
+\begin{pspicture}(x0,y0)(x1,y1)
+\begin{pspicture*}(x0,y0)(x1,y1)
+\clipbox[dim]{stuff}
+\clipbox{stuff}
+\closedshadow
+\closedshadow[par]
+\closepath
+\code{code}
+\coor(x1,y1)(x2,y2)
+\cput{angle}(x,y){stuff}
+\cput*{angle}(x,y){stuff}
+\cput[par]{angle}(x,y){stuff}
+\cput*[par]{angle}(x,y){stuff}
+\curveto(x1,y1)(x2,y2)(x3,y3)
+\degrees
+\degrees[num]
+\dim{dim}
+\endoverlaybox
+\endpsclip
+\end{pspicture}
+\end{pspicture*}
+\everypsbox{commands}
+\file{file}
+\fill
+\fill[par]
+\grestore
+\gsave
+\lineto(coor)
+\movepath(coor)
+\moveto(coor)
+\mrestore
+\msave
+\multips{angle}(x0,y0)(x1,y1){int}{graphics}
+\multips(x0,y0)(x1,y1){int}{graphics}
+\multirput{angle}(x0,y0)(x1,y1){int}{stuff}
+\multirput*{angle}(x0,y0)(x1,y1){int}{stuff}
+\multirput[refpoint]{angle}(x0,y0)(x1,y1){int}{stuff}
+\multirput*[refpoint]{angle}(x0,y0)(x1,y1){int}{stuff}
+\multirput[refpoint](x0,y0)(x1,y1){int}{stuff}
+\multirput*[refpoint](x0,y0)(x1,y1){int}{stuff}
+\multirput(x0,y0)(x1,y1){int}{stuff}
+\multirput*(x0,y0)(x1,y1){int}{stuff}
+\newcmykcolor{color}{num1 num2 num3 num4}
+\newgray{color}{num}
+\newhsbcolor{color}{num1 num2 num3}
+\newpath
+\newpsobject{name}{object}{kv-list}
+\newpsstyle{name}{kv-list}
+\newrgbcolor{color}{num1 num2 num3}
+\NormalCoor
+\openshadow
+\openshadow[par]
+\overlaybox
+\parabola{arrows}(x0,y0)(x1,y1)
+\parabola*{arrows}(x0,y0)(x1,y1)
+\parabola[par]{arrows}(x0,y0)(x1,y1)
+\parabola*[par]{arrows}(x0,y0)(x1,y1)
+\parabola[par](x0,y0)(x1,y1)
+\parabola*[par](x0,y0)(x1,y1)
+\parabola(x0,y0)(x1,y1)
+\parabola*(x0,y0)(x1,y1)
+\psaddtolength{cmd}{dim}
+\psarc{arrows}(x,y){radius}{angleA}{angleB}
+\psarc*{arrows}(x,y){radius}{angleA}{angleB}
+\psarcn{arrows}(x,y){radius}{angleA}{angleB}
+\psarcn*{arrows}(x,y){radius}{angleA}{angleB}
+\psarcn[par]{arrows}(x,y){radius}{angleA}{angleB}
+\psarcn*[par]{arrows}(x,y){radius}{angleA}{angleB}
+\psarcn[par](x,y){radius}{angleA}{angleB}
+\psarcn*[par](x,y){radius}{angleA}{angleB}
+\psarcn(x,y){radius}{angleA}{angleB}
+\psarcn*(x,y){radius}{angleA}{angleB}
+\psarc[par]{arrows}(x,y){radius}{angleA}{angleB}
+\psarc*[par]{arrows}(x,y){radius}{angleA}{angleB}
+\psarc[par](x,y){radius}{angleA}{angleB}
+\psarc*[par](x,y){radius}{angleA}{angleB}
+\psarc(x,y){radius}{angleA}{angleB}
+\psarc*(x,y){radius}{angleA}{angleB}
+\psbezier{arrows}(x0,y0)(x1,y1)(x2,y2)(x3,y3)
+\psbezier*{arrows}(x0,y0)(x1,y1)(x2,y2)(x3,y3)
+\psbezier[par]{arrows}(x0,y0)(x1,y1)(x2,y2)(x3,y3)
+\psbezier*[par]{arrows}(x0,y0)(x1,y1)(x2,y2)(x3,y3)
+\psbezier[par](x0,y0)(x1,y1)(x2,y2)(x3,y3)
+\psbezier*[par](x0,y0)(x1,y1)(x2,y2)(x3,y3)
+\psbezier(x0,y0)(x1,y1)(x2,y2)(x3,y3)
+\psbezier*(x0,y0)(x1,y1)(x2,y2)(x3,y3)
+\psccurve{arrows}(x1,y1)(xn,yn)
+\psccurve*{arrows}(x1,y1)(xn,yn)
+\psccurve[par]{arrows}(x1,y1)(xn,yn)
+\psccurve*[par]{arrows}(x1,y1)(xn,yn)
+\psccurve[par](x1,y1)(xn,yn)
+\psccurve*[par](x1,y1)(xn,yn)
+\psccurve(x1,y1)(xn,yn)
+\psccurve*(x1,y1)(xn,yn)
+\pscirclebox[par]{stuff}
+\pscirclebox*[par]{stuff}
+\pscirclebox{stuff}
+\pscirclebox*{stuff}
+\pscircle[par](x0,y0){radius}
+\pscircle*[par](x0,y0){radius}
+\pscircle(x0,y0){radius}
+\pscircle*(x0,y0){radius}
+\psclip{graphics}
+\pscurve{arrows}(x1,y1)(xn,yn)
+\pscurve*{arrows}(x1,y1)(xn,yn)
+\pscurve[par]{arrows}(x1,y1)(xn,yn)
+\pscurve*[par]{arrows}(x1,y1)(xn,yn)
+\pscurve[par](x1,y1)(xn,yn)
+\pscurve*[par](x1,y1)(xn,yn)
+\pscurve(x1,y1)(xn,yn)
+\pscurve*(x1,y1)(xn,yn)
+\pscustom{commands}
+\pscustom*{commands}
+\pscustom[par]{commands}
+\pscustom*[par]{commands}
+\psdblframebox[par]{stuff}
+\psdblframebox*[par]{stuff}
+\psdblframebox{stuff}
+\psdblframebox*{stuff}
+\psdiabox[par]{stuff}
+\psdiabox*[par]{stuff}
+\psdiabox{stuff}
+\psdiabox*{stuff}
+\psdiamond[par](x0,y0)(x1,y1)
+\psdiamond*[par](x0,y0)(x1,y1)
+\psdiamond(x0,y0)(x1,y1)
+\psdiamond*(x0,y0)(x1,y1)
+\psdot[par](x1,y1)
+\psdot*[par](x1,y1)
+\psdots[par](x1,y1)(xn,yn)
+\psdots*[par](x1,y1)(xn,yn)
+\psdots(x1,y1)(xn,yn)
+\psdots*(x1,y1)(xn,yn)
+\psdot(x1,y1)
+\psdot*(x1,y1)
+\psecurve{arrows}(x1,y1)(xn,yn)
+\psecurve*{arrows}(x1,y1)(xn,yn)
+\psecurve[par]{arrows}(x1,y1)(xn,yn)
+\psecurve*[par]{arrows}(x1,y1)(xn,yn)
+\psecurve[par](x1,y1)(xn,yn)
+\psecurve*[par](x1,y1)(xn,yn)
+\psecurve(x1,y1)(xn,yn)
+\psecurve*(x1,y1)(xn,yn)
+\psellipse[par](x0,y0)(x1,y1)
+\psellipse*[par](x0,y0)(x1,y1)
+\psellipse(x0,y0)(x1,y1)
+\psellipse*(x0,y0)(x1,y1)
+\psframebox[par]{stuff}
+\psframebox*[par]{stuff}
+\psframebox{stuff}
+\psframebox*{stuff}
+\psframe[par](x0,y0)(x1,y1)
+\psframe*[par](x0,y0)(x1,y1)
+\psframe(x0,y0)(x1,y1)
+\psframe*(x0,y0)(x1,y1)
+\psgrid(x0,y0)(x1,y1)(x2,y2)
+\pslabelsep
+\pslbrace
+\psline{arrows}(x0,y0)(x1,y1)
+\psline*{arrows}(x0,y0)(x1,y1)
+\psline[par]{arrows}(x0,y0)(x1,y1)
+\psline*[par]{arrows}(x0,y0)(x1,y1)
+\psline[par](x0,y0)(x1,y1)
+\psline*[par](x0,y0)(x1,y1)
+\psline(x0,y0)(x1,y1)
+\psline*(x0,y0)(x1,y1)
+\pslongbox{name}{cmd}
+\psmathboxfalse
+\psmathboxtrue
+\psovalbox[par]{stuff}
+\psovalbox*[par]{stuff}
+\psovalbox{stuff}
+\psovalbox*{stuff}
+\psoverlay{string}
+\pspolygon[par](x0,y0)(x1,y1)(x2,y2)
+\pspolygon*[par](x0,y0)(x1,y1)(x2,y2)
+\pspolygon(x0,y0)(x1,y1)(x2,y2)
+\pspolygon*(x0,y0)(x1,y1)(x2,y2)
+\psrbrace
+\psset{kv-list}
+\pssetlength{cmd}{dim}
+\psshadowbox[par]{stuff}
+\psshadowbox*[par]{stuff}
+\psshadowbox{stuff}
+\psshadowbox*{stuff}
+\pstriangle[par](x0,y0)(x1,y1)
+\pstriangle*[par](x0,y0)(x1,y1)
+\pstriangle(x0,y0)(x1,y1)
+\pstriangle*(x0,y0)(x1,y1)
+\pstribox[par]{stuff}
+\pstribox*[par]{stuff}
+\pstribox{stuff}
+\pstribox*{stuff}
+\psverbboxfalse
+\psverbboxtrue
+\pswedge[par](x0,y0){radius}{angle1}{angle2}
+\pswedge*[par](x0,y0){radius}{angle1}{angle2}
+\pswedge(x0,y0){radius}{angle1}{angle2}
+\pswedge*(x0,y0){radius}{angle1}{angle2}
+\putoverlaybox{string}
+\qdisk(coor){radius}
+\qline(coor0)(coor1)
+\radians
+\rcoor(x1,y1)(x2,y2)
+\rcurveto(x1,y1)(x2,y2)(x3,y3)
+\rlineto(coor)
+\rotate{angle}
+\rotatedown{stuff}
+\rotateleft{stuff}
+\rotateright{stuff}
+\rput[refpoint]{rotation}(x,y){stuff}
+\rput*[refpoint]{rotation}(x,y){stuff}
+\rput[refpoint](x,y){stuff}
+\rput*[refpoint](x,y){stuff}
+\rput{rotation}(x,y){stuff}
+\rput*{rotation}(x,y){stuff}
+\rput(x,y){stuff}
+\rput*(x,y){stuff}
+\scalebox{num1 num2}{stuff}
+\scalebox{num}{stuff}
+\scaleboxto(x,y){stuff}
+\scale{num}
+\scale{num1 num2}
+\setcolor{color}
+\SpecialCoor
+\stroke
+\stroke[par]
+\swapaxes
+\translate(coor)
+\uput{labelsep}[refangle]{rotation}(x,y){stuff}
+\uput*{labelsep}[refangle]{rotation}(x,y){stuff}
+\uput{labelsep}[refangle](x,y){stuff}
+\uput*{labelsep}[refangle](x,y){stuff}
+\uput[refangle]{rotation}(x,y){stuff}
+\uput*[refangle]{rotation}(x,y){stuff}
+\uput[refangle](x,y){stuff}
+\uput*[refangle](x,y){stuff}
diff --git a/src/kile/complete/tex/rotating.cwl b/src/kile/complete/tex/rotating.cwl
new file mode 100644
index 0000000..703204b
--- /dev/null
+++ b/src/kile/complete/tex/rotating.cwl
@@ -0,0 +1,8 @@
+#rotating.cwl
+#for rotating package
+#neeraavi 12 Apr 2007
+
+\begin{sidewaystable}
+\end{sidewaystable}
+\begin{sidewaysfigure}
+\end{sidewaysfigure}
diff --git a/src/kile/complete/tex/scraddr.cwl b/src/kile/complete/tex/scraddr.cwl
new file mode 100644
index 0000000..15453fa
--- /dev/null
+++ b/src/kile/complete/tex/scraddr.cwl
@@ -0,0 +1,15 @@
+# mode: scraddr.sty
+# dani/2006-02-21
+\addrentry{last}{first}{address}{tel}{f1}{f2}{f3}{f4}{comment}{short}
+\Address
+\adrentry{last}{first}{address}{tel}{f1}{f2}{comment}{short}
+\Comment
+\FirstName
+\FreeI
+\FreeII
+\FreeIII
+\FreeIV
+\InputAddressFile{file}
+\LastName
+\Name
+\Telephone
diff --git a/src/kile/complete/tex/scrdate.cwl b/src/kile/complete/tex/scrdate.cwl
new file mode 100644
index 0000000..c4253c7
--- /dev/null
+++ b/src/kile/complete/tex/scrdate.cwl
@@ -0,0 +1,4 @@
+# mode: scrdate.sty
+# dani/2006-02-21
+\todaysname
+\nameday{name}
diff --git a/src/kile/complete/tex/scrlfile.cwl b/src/kile/complete/tex/scrlfile.cwl
new file mode 100644
index 0000000..8cb935e
--- /dev/null
+++ b/src/kile/complete/tex/scrlfile.cwl
@@ -0,0 +1,10 @@
+# mode: scrlfile.sty
+# dani/2006-02-21
+\AfterFile
+\BeforePackage
+\BeforeClass
+\BeforeFile
+\AfterClass
+\AfterClass*
+\AfterPackage
+\AfterPackage*
diff --git a/src/kile/complete/tex/scrpage2.cwl b/src/kile/complete/tex/scrpage2.cwl
new file mode 100644
index 0000000..633f3fe
--- /dev/null
+++ b/src/kile/complete/tex/scrpage2.cwl
@@ -0,0 +1,68 @@
+# mode: scrpage2.sty
+# dani/2006-02-21
+\automark{left}
+\automark[right]{left}
+\cefoot[plain]{text}
+\cefoot{text}
+\cehead[plain]{text}
+\cehead{text}
+\cfoot[plain]{text}
+\cfoot{text}
+\chead[plain]{text}
+\chead{text}
+\clearscrheadfoot
+\clearscrheadings
+\clearscrplain
+\cofoot[plain]{text}
+\cofoot{text}
+\cohead[plain]{text}
+\cohead{text}
+\headfont
+\headmark
+\ifoot[plain]{text}
+\ifoot{text}
+\ihead[plain]{text}
+\ihead{text}
+\lefoot[plain]{text}
+\lefoot{text}
+\lehead[plain]{text}
+\lehead{text}
+\lofoot[plain]{text}
+\lofoot{text}
+\lohead[plain]{text}
+\lohead{text}
+\manualmark
+\ofoot[plain]{text}
+\ofoot{text}
+\ohead[plain]{text}
+\ohead{text}
+\pagemark
+\pnumfont
+\refoot[plain]{text}
+\refoot{text}
+\rehead[plain]{text}
+\rehead{text}
+\rofoot[plain]{text}
+\rofoot{text}
+\rohead[plain]{text}
+\rohead{text}
+\setfootbotline{dimen}
+\setfootbotline{dimen}[commands]
+\setfootbotline[length]{dimen}
+\setfootbotline[length]{dimen}[commands]
+\setfootsepline{dimen}
+\setfootsepline{dimen}[commands]
+\setfootsepline[length]{dimen}
+\setfootsepline[length]{dimen}[commands]
+\setfootwidth[offset]{width}
+\setfootwidth{width}
+\setheadsepline{dimen}
+\setheadsepline{dimen}[commands]
+\setheadsepline[length]{dimen}
+\setheadsepline[length]{dimen}[commands]
+\setheadtopline{dimen}
+\setheadtopline{dimen}[commands]
+\setheadtopline[length]{dimen}
+\setheadtopline[length]{dimen}[commands]
+\setheadwidth[offset]{width}
+\setheadwidth{width}
diff --git a/src/kile/complete/tex/scrtime.cwl b/src/kile/complete/tex/scrtime.cwl
new file mode 100644
index 0000000..8151905
--- /dev/null
+++ b/src/kile/complete/tex/scrtime.cwl
@@ -0,0 +1,7 @@
+# mode: scrtime.sty
+# dani/2006-02-21
+\thistime
+\thistime[div]
+\thistime*
+\thistime*[div]
+\settime{value}
diff --git a/src/kile/complete/tex/setspace.cwl b/src/kile/complete/tex/setspace.cwl
new file mode 100644
index 0000000..ee11df0
--- /dev/null
+++ b/src/kile/complete/tex/setspace.cwl
@@ -0,0 +1,12 @@
+\singlespacing
+\onehalfspacing
+\doublespacing
+\SetSinglespace{factor}
+\begin{singlespace}
+\begin{doublespace}
+\begin{onehalfspace}
+\begin{spacing}{factor}
+\end{singlespace}
+\end{doublespace}
+\end{onehalfspace}
+\end{spacing}
diff --git a/src/kile/complete/tex/subfig.cwl b/src/kile/complete/tex/subfig.cwl
new file mode 100644
index 0000000..e7906ac
--- /dev/null
+++ b/src/kile/complete/tex/subfig.cwl
@@ -0,0 +1,14 @@
+# mode: subfig.sty
+# dani/2006-02-18
+\captionsetup{kv-list}
+\captionsetup[variable]{kv-list}
+\ContinuedFloat
+\DeclareCaptionListOfFormat{keyowrd}{code}
+\listsubcaptions
+\newsubfloat{floatname}
+\newsubfloat[kv-list]{floatname}
+\subfloat{body}
+\subfloat[listentry][subcaption]{body}
+\subfloat[subcaption]{body}
+\subref{label}
+\subref*{label}
diff --git a/src/kile/complete/tex/supertabular.cwl b/src/kile/complete/tex/supertabular.cwl
new file mode 100644
index 0000000..76530a7
--- /dev/null
+++ b/src/kile/complete/tex/supertabular.cwl
@@ -0,0 +1,23 @@
+# mode: supertabular.sty
+# dani/2006-02-18
+# small changes: tbraun/2006-03-08
+\begin{mpsupertabular}{preamble}
+\begin{mpsupertabular*}{preamble}
+\begin{supertabular}{preamble}
+\begin{supertabular*}{preamble}
+\bottomcaption[short]{text}
+\bottomcaption{text}
+\end{mpsupertabular}
+\end{mpsupertabular*}
+\end{supertabular}
+\end{supertabular*}
+\setSTheight{value}
+\shrinkheight{length}
+\tablecaption[short]{text}
+\tablecaption{text}
+\tablefirsthead{text}
+\tablehead{text}
+\tablelasttail{text}
+\tabletail{text}
+\topcaption[short]{text}
+\topcaption{text}
diff --git a/src/kile/complete/tex/svn-multi.cwl b/src/kile/complete/tex/svn-multi.cwl
new file mode 100644
index 0000000..5fee509
--- /dev/null
+++ b/src/kile/complete/tex/svn-multi.cwl
@@ -0,0 +1,41 @@
+#tbraun 9.02.2008
+# svn-multi aka svnkw ctan package
+
+\svnid
+\svnidlong
+\svn
+\svn*
+\svnkwsave
+\svnrev
+\svndate
+\svnauthor
+\svnfilerev
+\svnfiledate
+\svnfileauthor
+\svnmainurl
+\svnmainfilename
+\svnsetmainfile
+\svnkw
+\svnkwdef
+\svnfileyear
+\svnfilemonth
+\svnfileday
+\svnfilehour
+\svnfileminute
+\svnfilesecond
+\svnfiletimezone
+\svnyear
+\svnmonth
+\svnday
+\svnhour
+\svnminute
+\svnsecond
+\svntimezone
+\svnpdfdate
+\svnRegisterAuthor
+\svnFullAuthor
+\svnFullAuthor*
+\svnRegisterRevision
+\svnFullRevision
+\svnFullRevision*
+\svnnolinkurl
diff --git a/src/kile/complete/tex/svninfo.cwl b/src/kile/complete/tex/svninfo.cwl
new file mode 100644
index 0000000..53a1927
--- /dev/null
+++ b/src/kile/complete/tex/svninfo.cwl
@@ -0,0 +1,19 @@
+# tbraun 8.02.2008
+# ctan svninfo package
+
+\svnInfo
+\svnInfoFile
+\svnInfoRevision
+\svnInfoMinRevision
+\svnInfoMaxRevision
+\svnInfoDate
+\svnInfoTime
+\svnInfoOwner
+\svnInfoYear
+\svnInfoMonth
+\svnInfoDay
+\svnInfoLongDate
+\svnId
+\svnToday
+\svnInfoMaxToday
+# \svnKeyword $<Keyword>$ # not supported by kile
diff --git a/src/kile/complete/tex/tabularx.cwl b/src/kile/complete/tex/tabularx.cwl
new file mode 100644
index 0000000..992c6e6
--- /dev/null
+++ b/src/kile/complete/tex/tabularx.cwl
@@ -0,0 +1,7 @@
+# mode: tabularx.sty
+# dani/2006-02-18
+\arraybackslash
+\begin{tabularx}{width}{preamble}
+\end{tabularx}
+\tabularxcolumn
+\tracingtabularx
diff --git a/src/kile/complete/tex/tex.cwl b/src/kile/complete/tex/tex.cwl
new file mode 100644
index 0000000..042c3a6
--- /dev/null
+++ b/src/kile/complete/tex/tex.cwl
@@ -0,0 +1,439 @@
+# tex/latex mode: Tex commands
+# dani/8.1.2004
+\above
+\abovedisplayshortskip
+\abovedisplayskip
+\abovewithdelims
+\accent
+\active
+\adjdemerits
+\advance
+\advancepageno
+\afterassignment
+\aftergroup
+\allowbreak
+\allowhyphens
+\annotations
+\atop
+\atopwithdelims
+\baselineskip
+\batchmode
+\begingroup
+\begingroup..\endgroup
+\belowdisplayshortskip
+\belowdisplayskip
+\bgroup
+\bgroup..\egroup
+\bigskip
+\bigskipamount
+\bordermatrix
+\botmark
+\box
+\boxmaxdepth
+\brokenpenalty
+\buildrel
+\bye
+\cal
+\cases
+\catcode
+\centering
+\char
+\chardef
+\choose
+\cleaders
+\cleartabs
+\closein
+\closeout
+\closing
+\clubpenalty
+\columns
+\copy
+\copyright
+\count
+\countdef
+\crcr
+\csname
+\danger
+\dash
+\day
+\deadcycles
+\def
+\defaulthyphenchar
+\defaultskewchar
+\delcode
+\delimiter
+\delimiterfactor
+\delimitershortfall
+\dimen
+\dimendef
+\discretionary
+\displayindent
+\displaylimits
+\displaylines
+\displaywidowpenalty
+\displaywidth
+\divide
+\dotfill
+\dots
+\doublehyphendemerits
+\edef
+\egroup
+\eject
+\else
+\empty
+\end
+\endcsname
+\endgraf
+\endgroup
+\endinput
+\endlinechar
+\enskip
+\enspace
+\eqalign
+\eqalignno
+\eqno
+\errhelp
+\errmessage
+\errorstopmode
+\escapechar
+\everycr
+\everydisplay
+\everyhbox
+\everyjob
+\everymath
+\everypar
+\everyvbox
+\exhyphenpenalty
+\expandafter
+\fam
+\fill
+\finalhypendemerits
+\firstmark
+\floatingpenalty
+\folio
+\font
+\fontdimen
+\fontname
+\footins
+\footnote
+\footnoterule
+\frenchspacing
+\futurelet
+\gdef
+\global
+\globaldefs
+\halign
+\hangafter
+\hangindent
+\hbadness
+\hbox
+\hfil
+\hfill
+\hfilneg
+\hfuzz
+\hoffset
+\hrule
+\hrulefill
+\hsize
+\hskip
+\hyphenchar
+\hyphenpenalty
+\if
+\ifcase
+\ifcat
+\ifdim
+\ifeof
+\iffalse
+\ifhbox
+\ifhmode
+\ifinner
+\ifmmode
+\ifnum
+\ifodd
+\iftrue
+\ifundefined
+\ifvbox
+\ifvmode
+\ifvoid
+\ifx
+\if..\fi
+\ifcase..\fi
+\ifcat..\fi
+\ifdim..\fi
+\ifeof..\fi
+\iffalse..\fi
+\ifhbox..\fi
+\ifhmode..\fi
+\ifinner..\fi
+\ifmmode..\fi
+\ifnum..\fi
+\ifodd..\fi
+\iftrue..\fi
+\ifvbox..\fi
+\ifvmode..\fi
+\ifvoid..\fi
+\ifx..\fi
+\if..\else..\fi
+\ifcase..\else..\fi
+\ifcat..\else..\fi
+\ifdim..\else..\fi
+\ifeof..\else..\fi
+\iffalse..\else..\fi
+\ifhbox..\else..\fi
+\ifhmode..\else..\fi
+\ifinner..\else..\fi
+\ifmmode..\else..\fi
+\ifnum..\else..\fi
+\ifodd..\else..\fi
+\iftrue..\else..\fi
+\ifvbox..\else..\fi
+\ifvmode..\else..\fi
+\ifvoid..\else..\fi
+\ifx..\else..\fi
+\ignorespaces
+\immediate
+\indent
+\insert
+\insertpenalties
+\interdisplaylinepenalty
+\interfootnotelinepenalty
+\interlinepenalty
+\jobname
+\joinrel
+\kern
+\lastbox
+\lastkern
+\lastpenalty
+\lastskip
+\lccode
+\leaders
+\leavevmode
+\left
+\left..\right
+\leftskip
+\leqno
+\let
+\limits
+\line
+\linepenalty
+\lineskip
+\lineskiplimit
+\llap
+\long
+\looseness
+\lower
+\lowercase
+\mag
+\magnification
+\magstep
+\margin
+\mark
+\mathaccent
+\mathbin
+\mathchar
+\mathchardef
+\mathchoice
+\mathclose
+\mathcode
+\mathinner
+\mathop
+\mathopen
+\mathord
+\mathpunct
+\mathrel
+\mathstrut
+\mathsurround
+\matrix
+\maxdeadcycles
+\maxdepth
+\maxdimen
+\meaning
+\medmuskip
+\medskip
+\medskipamount
+\message
+\mkern
+\month
+\moveleft
+\moveright
+\mskip
+\multiply
+\multispan
+\muskip
+\muskipdef
+\negthinspace
+\newbox
+\newcount
+\newdimen
+\newhelp
+\newif
+\newlinechar
+\newmuskip
+\newread
+\newskip
+\newtoks
+\newwrite
+\noalign
+\noexpand
+\noindent
+\nointerlineskip
+\nolimits
+\nonfrenchspacing
+\nonscript
+\nonstopmode
+\nopagenumbers
+\nulldelimiterspace
+\nullfont
+\number
+\obeylines
+\obeyspaces
+\offinterlineskip
+\omit
+\openin
+\openout
+\outer
+\output
+\outputpenalty
+\over
+\overfullrule
+\overleftarrow
+\overrightarrow
+\overwithdelims
+\pagedepth
+\pagefilllstretch
+\pagefillstretch
+\pagefilstretch
+\pagegoal
+\pageinsert
+\pageno
+\pageshrink
+\pagestretch
+\par
+\parfillskip
+\parindent
+\parshape
+\parskip
+\patterns
+\pausing
+\penalty
+\phantom
+\pmatrix
+\postdisplaypenalty
+\predisplaypenalty
+\predisplaysize
+\pretolerance
+\prevdepth
+\prevgraf
+\proclaim
+\protect
+\qquad
+\quad
+\radical
+\raggedbottom
+\raggedcenter
+\raggedleft
+\raggedright
+\raise
+\read
+\relax
+\relpenalty
+\removelastskip
+\repeat
+\right
+\rightskip
+\rlap
+\romannumeral
+\scriptfont
+\scriptscriptfont
+\scriptscriptstyle
+\scriptspace
+\scriptstyle
+\scrollmode
+\setbox
+\sfcode
+\shipout
+\show
+\showbox
+\showboxbreadth
+\showboxdepth
+\showhyphens
+\showlists
+\showthe
+\skew
+\skewchar
+\skip
+\skipdef
+\slash
+\smallskip
+\smallskipamount
+\spacefactor
+\spaceskip
+\span
+\special
+\splitbotmark
+\splitfirstmark
+\splitmaxdepth
+\splittopskip
+\string
+\strut
+\tabskip
+\TeX
+\textfont
+\textindent
+\textstyle
+\the
+\thickmuskip
+\thinmuskip
+\thinspace
+\toks
+\toksdef
+\tolerance
+\topins
+\topmark
+\topskip
+\tracingcommands
+\tracingfonts
+\tracinglostchars
+\tracingmacros
+\tracingonline
+\tracingoutput
+\tracingpages
+\tracingparagraphs
+\tracingrestores
+\tracingstats
+\uccode
+\uchyph
+\underbar
+\unhbox
+\unhcopy
+\unitlength
+\unkern
+\unpenalty
+\unskip
+\unvbox
+\unvcopy
+\uppercase
+\vadjust
+\valign
+\vbadness
+\vbox
+\vcenter
+\vfil
+\vfill
+\vfilll
+\vfilneg
+\vfuzz
+\voffset
+\vphantom
+\vrule
+\vsize
+\vskip
+\vsplit
+\vss
+\vtop
+\widowpenalty
+\write
+\xdef
+\xleaders
+\xspaceskip
+\year
diff --git a/src/kile/complete/tex/textcomp.cwl b/src/kile/complete/tex/textcomp.cwl
new file mode 100644
index 0000000..76a60a2
--- /dev/null
+++ b/src/kile/complete/tex/textcomp.cwl
@@ -0,0 +1,129 @@
+# textcomp package
+# tbraun 04/27/2006
+
+\capitalgrave{text}
+\capitalacute{text}
+\capitalcircumflex{text}
+\capitaltilde{text}
+\capitaldieresis{text}
+\capitalhungarumlaut{text}
+\capitalring{text}
+\capitalcaron{text}
+\capitalbreve{text}
+\capitaldotaccent{text}
+\capitalcedilla{text}
+\capitalogonek{text}
+\t{text}
+\capitaltie{text}
+\newtie{text}
+\capitalnewtie{text}
+\textcapitalcompwordmark
+\textascendercompwordmark
+\oldstylenums{number}
+\textzerooldstyle
+\textoneoldstyle
+\texttwooldstyle
+\textthreeoldstyle
+\textfouroldstyle
+\textfiveoldstyle
+\textsixoldstyle
+\textsevenoldstyle
+\texteightoldstyle
+\textnineoldstyle
+\textquotestraightbase
+\textquotestraightdblbase
+\texttwelveudash
+\textthreequartersemdash
+\textleftarrow
+\textrightarrow
+\textblank
+\textdollar
+\textquotesingle
+\textasteriskcentered
+\textdblhyphen
+\textfractionsolidus
+\textlangle
+\textminus
+\textrangle
+\textmho
+\textbigcircle
+\textohm
+\textlbrackdbl
+\textrbrackdbl
+\textuparrow
+\textdownarrow
+\textasciigrave
+\textborn
+\textdivorced
+\textdied
+\textleaf
+\textmarried
+\textmusicalnote
+\texttildelow
+\textdblhyphenchar
+\textasciibreve
+\textasciicaron
+\textacutedbl
+\textgravedbl
+\textdagger
+\textdaggerdbl
+\textbardbl
+\textperthousand
+\textbullet
+\textcelsius
+\textdollaroldstyle
+\textcent
+\textflorin
+\textcolonmonetary
+\textwon
+\textnaira
+\textguarani
+\textpeso
+\textlira
+\textrecipe
+\textinterrobang
+\textinterrobangdown
+\textdong
+\texttrademark
+\textpertenthousand
+\textpilcrow
+\textbaht
+\textnumero
+\textdiscount
+\textestimated
+\textopenbullet
+\textservicemark
+\textlquill
+\textrquill
+\textcent
+\textsterling
+\textcurrency
+\textyen
+\textbrokenbar
+\textsection
+\textasciidieresis
+\textcopyright
+\textordfeminine
+\textcopyleft
+\textlnot
+\textcircled
+\textregistered
+\textasciimacron
+\textdegree
+\textpm
+\texttwosuperior
+\textthreesuperior
+\textasciiacute
+\textmu
+\textparagraph
+\textperiodcentered
+\textreferencemark
+\textonesuperior
+\textordmasculine
+\textsurd
+\textonequarter
+\textonehalf
+\textthreequarters
+\texteuro
+\texttimes
+\textdiv
diff --git a/src/kile/complete/tex/url.cwl b/src/kile/complete/tex/url.cwl
new file mode 100644
index 0000000..d08f84b
--- /dev/null
+++ b/src/kile/complete/tex/url.cwl
@@ -0,0 +1,19 @@
+# tbraun 5.01.2007
+# ctan url package
+
+\url{}
+# \url|| not supported by kile 2.0
+\urldef{\newurlcmd}\url{}
+\DeclareUrlCommand{}{}
+\urlstyle{}
+\UrlBreaks
+\UrlBigBreaks
+\UrlNoBreaks
+\UrlOrds
+\UrlSpecials
+\UrlTildeSpecial
+\UrlFont
+\UrlFont
+\UrlFont
+\UrlLeft
+\UrlRight
diff --git a/src/kile/complete/tex/varioref.cwl b/src/kile/complete/tex/varioref.cwl
new file mode 100644
index 0000000..df2335c
--- /dev/null
+++ b/src/kile/complete/tex/varioref.cwl
@@ -0,0 +1,30 @@
+# mode: varioref.sty
+# dani/2006-02-18
+\fullref{label}
+\labelformat{counter}{argument}
+\Ref{label}
+\reftextafter{text}
+\reftextbefore{text}
+\reftextcurrent{text}
+\reftextfaceafter{text}
+\reftextfacebefore{text}
+\reftextfaraway
+\reftextlabelrange
+\reftextpagerange
+\vpageref{label}
+\vpageref*{label}
+\vpagerefrange{fromlabel}{tolabel}
+\vpagerefrange*{fromlabel}{tolabel}
+\vpagerefrange[same page]{fromlabel}{tolabel}
+\vpagerefrange*[same page]{fromlabel}{tolabel}
+\vpageref[samepage]{label}
+\vpageref*[samepage]{label}
+\vpageref[samepage][otherpage]{label}
+\vpageref*[samepage][otherpage]{label}
+\vref{label}
+\vref*{label}
+\Vref{label}
+\Vref*{label}
+\vrefpagenum{cmd}{label}
+\vrefrange{fromlabel}{tolabel}
+\vreftextvario{text1}{text2}
diff --git a/src/kile/complete/tex/verse.cwl b/src/kile/complete/tex/verse.cwl
new file mode 100644
index 0000000..50a177f
--- /dev/null
+++ b/src/kile/complete/tex/verse.cwl
@@ -0,0 +1,45 @@
+# verse 2.3 package
+# nja 17 July 2007 not submitted
+
+\begin{verse}
+\begin{verse}[length of average line]
+\end{verse}
+
+\begin{altverse}
+\end{altverse}
+
+\begin{patverse}
+\end{patverse}
+\begin{patverse*}
+\end{patverse*}
+
+\indentpattern{digits}
+
+
+\versewidth
+
+\vin
+\vgap
+\vindent
+\leftmargini
+\stanzaskip
+
+\verselinebreak
+\verselinebreak[length]
+\flagverse{flag}
+\vleftskip
+\vrightskip
+\poemlines{nth}
+\thepoemline
+\verselinenumfont{font-spec}
+\verselinenumbersleft
+\verselinenumbersright
+
+\poemtitle{short}{long}
+\poemtitle*{short}{long}
+\poemtoc
+\poemtitlefont
+\beforepoemtitleskip
+\afterpoemtitleskip
+\poemtitlemark{title}
+
diff --git a/src/kile/complete/tex/virginialake.cwl b/src/kile/complete/tex/virginialake.cwl
new file mode 100644
index 0000000..1d77d22
--- /dev/null
+++ b/src/kile/complete/tex/virginialake.cwl
@@ -0,0 +1,171 @@
+# virginialake package
+# Tom Gundersen <teg@jklm.no> 24/2/08
+# http://alessio.guglielmi.name/res/vl/index.html
+
+# formulae/structures
+\vlor
+\vlan
+\vlim
+\vlne
+\vldi
+\vlmi
+\vls
+\vlsbr
+\vlscn
+\vlhole
+\vlsmallbrackets
+\vlnosmallbrackets
+\vlupdate
+\vlstore
+\vlread
+\vldot
+\vlsqbrl
+\vlsqbrr
+\vlrobrl
+\vlrobrr
+\vlnos
+\vlnostructuresyntax
+
+# derivations
+\vlnostructuresyntax
+\vlsmallleftlabels
+\vlnosmallleftlabels
+\vlderivation{derivation}
+\vlproof{left label}{right label}{conclusion}
+\vlder{left label}{right label}{conclusion}{premiss}
+\vltreeder{label}{conclusion}{left premiss}{middle premiss}{right premiss}
+\vlinf{left label}{right label}{conclusion}{premiss}
+\vliinf{left label}{right label}{conclusion}{left premiss}{right premiss}
+\vliiinf{left label}{right label}{conclusion}{left premiss}{middle premiss}{right premiss}
+\vlpr{left label}{right label}{conclusion}
+\vlde{left label}{right label}{conclusion}{premiss (derivation)}
+\vltr{label}{conclusion}{left premiss (derivation)}{middle premiss (derivation)}{right premiss (derivation)}
+\vltr{label}{conclusion}{left premiss (derivation)}{middle premiss (derivation)}{right premiss (derivation)}{scale}
+\vlin{left label}{right label}{conclusion}{premiss (derivation)}
+\vliin{left label}{right label}{conclusion}{left premiss (derivation)}{right premiss (derivation)}
+\vliiin{left label}{right label}{conclusion}{left premiss (derivation)}{middle premiss (derivation)}{right premiss (derivation)}
+\vlhy{premiss}
+
+# atomic flows
+\aftriangletrue
+\aftrianglefalse
+\afaid{label}{label}{label}{label}{label}{label}
+\afaidcol{label}{label}{label}{label}{label}{label}{colour}{colour}
+\afaidex{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}
+\afaidexcol{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}{colour}{colour}
+\afaidnw{label}{label}
+\afaidnwcol{label}{label}{colour}
+
+\afaiu{label}{label}{label}{label}{label}{label}
+\afaiucol{label}{label}{label}{label}{label}{label}{colour}{colour}
+\afaiuex{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}
+\afaiuexcol{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}{colour}{colour}
+\afaiunw{label}{label}
+\afaiunwcol{label}{label}{colour}
+
+\afnegspace
+\afraise
+\aflower
+
+\afacd{label}{label}{label}{label}{label}{label}
+\afacdcol{label}{label}{label}{label}{label}{label}{colour}{colour}{colour}
+\afacdex{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}
+\afacdexsq{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}
+\afacdexcol{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}{colour}{colour}{colour}
+\afacdexsqcol{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}{colour}{colour}{colour}
+\afacdnw{label}{label}{label}{label}
+\afacdnwcol{label}{label}{label}{label}{colour}{colour}
+\afacdnwex{label}{label}{label}{label}{scale numerator}{scale denominator}
+\afacdexsq{label}{label}{label}{label}{scale numerator}{scale denominator}
+\afacdnwexcol{label}{label}{label}{label}{scale numerator}{scale denominator}{colour}{colour}
+\afacdnwexsqcol{label}{label}{label}{label}{scale numerator}{scale denominator}{colour}{colour}
+
+\afacu{label}{label}{label}{label}{label}{label}
+\afacucol{label}{label}{label}{label}{label}{label}{colour}{colour}{colour}
+\afacuex{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}
+\afacuexsq{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}
+\afacuexcol{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}{colour}{colour}{colour}
+\afacuexsqcol{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}{colour}{colour}{colour}
+\afacunw{label}{label}{label}{label}
+\afacunwcol{label}{label}{label}{label}{colour}{colour}
+\afacunwex{label}{label}{label}{label}{scale numerator}{scale denominator}
+\afacuexsq{label}{label}{label}{label}{scale numerator}{scale denominator}
+\afacunwexcol{label}{label}{label}{label}{scale numerator}{scale denominator}{colour}{colour}
+\afacunwexsqcol{label}{label}{label}{label}{scale numerator}{scale denominator}{colour}{colour}
+
+\afaiu{label}{label}{label}{label}{label}{label}
+\afaiucol{label}{label}{label}{label}{label}{label}{colour}{colour}
+\afaiuex{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}
+\afaiuexcol{label}{label}{label}{label}{label}{label}{scale numerator}{scale denominator}{colour}{colour}
+\afaiunw{label}{label}
+\afaiunwcol{label}{label}{colour}
+
+\afawd{label}{label}{label}{label}
+\afawdcol{label}{label}{label}{label}{colour}{colour}
+\afawdnw{label}{label}
+
+\afawu{label}{label}{label}{label}
+\afawucol{label}{label}{label}{label}{colour}{colour}
+\afawunw{label}{label}
+
+\aff{scale}{label}{label}
+\affcol{scale}{label}{label}{colour}
+
+\aft{scale}{label}{label}
+\aftcol{scale}{label}{label}{colour}
+
+\afvdj
+\afvj{scale}
+\afvjcol{scale}{colour}
+\afvjd{label}{label}{scale}
+\afvjdcol{label}{label}{scale}{colour}
+\afvju{label}{label}{scale}
+\afvjucol{label}{label}{scale}{colour}
+\aftvj{scale}
+\aftvjcol{scale}{colour}
+\aftvjd{label}{label}{scale}
+\aftvjdcol{label}{label}{scale}{colour}
+\aftvju{label}{label}{scale}
+\aftvjucol{label}{label}{scale}{colour}
+
+\afex{scale}{scale}
+\afexcol{scale}{scale}{colour}{colour}
+
+\afcjl{scale}
+\afcjlcol{scale}{colour}
+\afcjld{label}{label}{scale}
+\afcjldcol{label}{label}{scale}{colour}
+\afcjlu{label}{label}{scale}
+\afcjlucol{label}{label}{scale}{colour}
+\aftcjl{scale}
+\aftcjlcol{scale}{colour}
+\aftcjld{label}{label}{scale}
+\aftcjldcol{label}{label}{scale}{colour}
+\aftcjlu{label}{label}{scale}
+\aftcjlucol{label}{label}{scale}{colour}
+
+\afcjr{scale}
+\afcjrcol{scale}{colour}
+\afcjrd{label}{label}{scale}
+\afcjrdcol{label}{label}{scale}{colour}
+\afcjru{label}{label}{scale}
+\afcjrucol{label}{label}{scale}{colour}
+\aftcjr{scale}
+\aftcjrcol{scale}{colour}
+\aftcjrd{label}{label}{scale}
+\aftcjrdcol{label}{label}{scale}{colour}
+\aftcjru{label}{label}{scale}
+\aftcjrucol{label}{label}{scale}{colour}
+
+# check this stuff if you want to use it...
+#\afexpu 542
+#\afexpd 825
+\affr{scale}{scale}
+
+\atomicflow{atomicflow}
+\atomicflowinv{atomicflow}
+
+# smash macros
+\vldownsmash
+\vlupsmash
+\vlsmash \ No newline at end of file
diff --git a/src/kile/complete/tex/xifthen.cwl b/src/kile/complete/tex/xifthen.cwl
new file mode 100644
index 0000000..5de80c0
--- /dev/null
+++ b/src/kile/complete/tex/xifthen.cwl
@@ -0,0 +1,27 @@
+# xifthen package
+# nja 17 July 2007
+# url: http://www.ctan.org/tex-archive/help/Catalogue/entries/xifthen.html
+
+# also in ifthen
+\ifthenelse{test}{then clause}{else clause}
+\boolean{name}
+\newboolean{name}
+\setboolean{name}{truth value}
+\isodd{number}
+\isundefined{command}
+\equal{string}{string}
+\AND
+\OR
+\NOT
+\lengthtest{dimen operator dimen}
+
+# in xifthen but not in ifthen
+\isnamedefined{command name}
+\isempty{content}
+\isequivalentto{command}{command}
+\isin{substring}{string}
+\endswith{string}{substring}
+\cnttest{counter expression}<comparison>{counter expression}
+\dimtest{dimen expression}<comparison>{dimen expression}
+\newtest{command}[n]{testexpression}
+
diff --git a/src/kile/complete/tex/xltxtra.cwl b/src/kile/complete/tex/xltxtra.cwl
new file mode 100644
index 0000000..4488eba
--- /dev/null
+++ b/src/kile/complete/tex/xltxtra.cwl
@@ -0,0 +1,20 @@
+# xltxtra v0.3a package
+# nja 17 July 2007
+# url: http://www.ctan.org/tex-archive/help/Catalogue/entries/xltxtra.html
+
+\textsuperscript*
+\textsubscript*
+\realsubscript
+\realsuperscript
+\fakesubscript
+\fakesuperscript
+
+\vfrac{numerator}{denominator}
+
+\namedglyph{glyphname}
+
+\showhyphens
+
+\XeTeX
+\XeLaTeX
+
diff --git a/src/kile/complete/tex/xtab.cwl b/src/kile/complete/tex/xtab.cwl
new file mode 100644
index 0000000..d8b536f
--- /dev/null
+++ b/src/kile/complete/tex/xtab.cwl
@@ -0,0 +1,24 @@
+# mode: xtab.sty
+# dani/2006-02-18
+\begin{mpxtabular}{preamble}
+\begin{mpxtabular*}{preamble}
+\begin{xtabular}{preamble}
+\begin{xtabular*}{preamble}
+\bottomcaption[short]{text}
+\bottomcaption{text}
+\end{mpxtabular}
+\end{mpxtabular*}
+\end{xtabular}
+\end{xtabular*}
+\notablelasthead
+\shrinkheight{length}
+\tablecaption[short]{text}
+\tablecaption{text}
+\tablefirsthead{text}
+\tablehead{text}
+\tablelasthead{text}
+\tablelasttail{text}
+\tabletail{text}
+\topcaption[short]{text}
+\topcaption{text}
+\xentryfraction{decimal-fraction}
diff --git a/src/kile/complete/tex/yfonts.cwl b/src/kile/complete/tex/yfonts.cwl
new file mode 100644
index 0000000..4086acf
--- /dev/null
+++ b/src/kile/complete/tex/yfonts.cwl
@@ -0,0 +1,19 @@
+# tbraun 16.02.2008
+# ctan yfonts package
+
+\gothfamily
+\swabfamily
+\frakfamily
+\initfamily
+\textgoth{text}
+\textswab{text}
+\textfrak{text}
+\textinit{text}
+\frakdefault
+\gothdefault
+\swabdefault
+\initdefault
+\etc
+\fraklines
+\yinipar
+\yinitpar
diff --git a/src/kile/configcheckerdlg.cpp b/src/kile/configcheckerdlg.cpp
new file mode 100644
index 0000000..aea6723
--- /dev/null
+++ b/src/kile/configcheckerdlg.cpp
@@ -0,0 +1,180 @@
+/***************************************************************************
+ begin : Fri Jun 4 2004
+ copyright : (C) 2004 by Jeroen Wijnout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "configcheckerdlg.h"
+
+#include <qfileinfo.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qpainter.h>
+
+#include <klocale.h>
+#include <kcursor.h>
+#include <kprogress.h>
+#include <kglobal.h>
+#include <kmessagebox.h>
+#include <kfiledialog.h>
+#include <klistbox.h>
+#include "kiledebug.h"
+
+#include "configcheckerwidget.h"
+
+namespace KileDialog
+{
+
+ResultItem::ResultItem(KListBox *lb, const QString &tool, int status, const QValueList<ConfigTest> &tests) : QListBoxItem(lb)
+{
+ QString rt = "<hr><b><font color=\"%1\">%2</font></b> (%3)<br><ul>";
+ for ( uint i = 0; i < tests.count(); ++i)
+ {
+ QString itemcolor = "black";
+ if ( tests[i].status() == ConfigTest::Failure ) itemcolor = "#FFA201";
+ else if ( tests[i].status() == ConfigTest::Critical ) itemcolor = "#AA0000";
+ rt += QString("<li><b><font color=\"%1\">%2</font></b>: &nbsp;%3</li>").arg(itemcolor).arg(tests[i].name()).arg(tests[i].resultText());
+ }
+ rt += "</ul>";
+
+ QString color = "#00AA00", statustr = i18n("Passed");
+ if ( status == ConfigTest::Failure )
+ {
+ color = "#FFA201";
+ statustr = i18n("Failed, but not critical");
+ }
+ else if ( status == ConfigTest::Critical )
+ {
+ color = "#AA0000";
+ statustr = i18n("Critical failure, Kile will not function properly");
+ }
+
+ m_richText = new QSimpleRichText(rt.arg(color).arg(tool).arg(statustr), listBox()->font());
+ m_richText->setWidth(listBox()->width());
+
+ //this is for sorting only
+ setText(QString::number(status) + ':' + tool);
+}
+
+void ResultItem::paint(QPainter *p)
+{
+ m_richText->draw(p, 0, 0, QRect(), listBox()->colorGroup());
+}
+
+ConfigChecker::ConfigChecker(QWidget* parent) :
+ KDialogBase( Plain, i18n("System Check"), Ok|Cancel|User1, Ok, parent, 0, true, true, KGuiItem("&Save Results...")),
+ m_tester(0L)
+{
+ QGridLayout *layout = new QGridLayout(plainPage(), 1, 1);
+ m_widget = new ConfigCheckerWidget(plainPage());
+ layout->addWidget(m_widget, 1, 1);
+
+ enableButton(Ok, false);
+ enableButton(User1, false);
+
+ run();
+}
+
+ConfigChecker::~ConfigChecker()
+{
+}
+
+KProgress* ConfigChecker::progressBar()
+{
+ return m_widget->progressBar();
+}
+
+QLabel* ConfigChecker::label()
+{
+ return m_widget->label();
+}
+
+KListBox* ConfigChecker::listBox()
+{
+ return m_widget->listBox();
+}
+
+void ConfigChecker::run()
+{
+ m_tester = new Tester(this, "configtester");
+
+ connect(m_tester, SIGNAL(started()), this, SLOT(started()));
+ connect(m_tester, SIGNAL(percentageDone(int)), this, SLOT(setPercentageDone(int)));
+ connect(m_tester, SIGNAL(finished(bool)), this, SLOT(finished(bool)));
+ connect(this, SIGNAL(user1Clicked()), this, SLOT(saveResults()));
+
+ m_tester->runTests();
+}
+
+void ConfigChecker::slotCancel()
+{
+ if (m_tester) m_tester->stop();
+ finished(false);
+ reject();
+}
+
+void ConfigChecker::saveResults()
+{
+ KURL url = KFileDialog::getSaveURL();
+ if ( !url.isEmpty() ) m_tester->saveResults(url);
+}
+
+void ConfigChecker::started()
+{
+ setCursor(KCursor::workingCursor());
+ setPercentageDone(0);
+}
+
+void ConfigChecker::finished(bool ok)
+{
+ setCursor(KCursor::arrowCursor());
+ enableButton(Cancel, false);
+
+ if (ok)
+ {
+ label()->setText(i18n("Finished testing your system..."));
+
+ QStringList tools = m_tester->testedTools();
+ QStringList critical, failure;
+ for ( uint i = 0; i < tools.count(); ++i )
+ {
+ int status = m_tester->statusForTool(tools[i]);
+ if ( status == ConfigTest::Critical ) critical.append(tools[i]);
+ else if ( status == ConfigTest::Failure ) failure.append(tools[i]);
+ new ResultItem(listBox(), tools[i], status, m_tester->resultForTool(tools[i]));
+ }
+
+ listBox()->sort();
+
+ QString cap = i18n("Test Results");
+ if ( critical.count() > 0 )
+ KMessageBox::error(this, i18n("<qt>The following tools did not pass all <b>critical</b> tests:<br>%1<br>Your system is not ready to use. Please consult the results to find out what to fix.</qt>").arg(critical.join(", ")), cap);
+ else if ( failure.count() > 0 )
+ KMessageBox::information(this, i18n("The following tools did not pass all tests:\n %1\nYou will still be able to use Kile; however, not all features are guaranteed to work.").arg(failure.join(", ")), cap);
+ else
+ KMessageBox::information(this, i18n("No problems detected, your system is ready to use."), cap);
+ }
+ else
+ label()->setText(i18n("Tests finished abruptly..."));
+
+ enableButton(Ok, true);
+ enableButton(User1, true);
+}
+
+void ConfigChecker::setPercentageDone(int p)
+{
+ progressBar()->setProgress(p);
+}
+
+}
+
+#include "configcheckerdlg.moc"
diff --git a/src/kile/configcheckerdlg.h b/src/kile/configcheckerdlg.h
new file mode 100644
index 0000000..74e8bf0
--- /dev/null
+++ b/src/kile/configcheckerdlg.h
@@ -0,0 +1,75 @@
+/***************************************************************************
+ begin : Fri Jun 4 2004
+ copyright : (C) 2004 by Jeroen Wijnout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEDIALOG_CONFIGCHECKER_H
+#define KILEDIALOG_CONFIGCHECKER_H
+
+#include <qsimplerichtext.h>
+
+#include <kdialogbase.h>
+
+#include "configtester.h"
+
+class QLabel;
+class QPainter;
+
+class KProgress;
+class KListBox;
+
+class ConfigCheckerWidget;
+
+namespace KileDialog
+{
+ class ResultItem : public QListBoxItem
+ {
+ public:
+ ResultItem(KListBox *lb, const QString &tool, int status, const QValueList<ConfigTest> &tests);
+ int width(const QListBox *) const { return m_richText->widthUsed(); }
+ int height(const QListBox *) const { return m_richText->height(); }
+
+ protected:
+ void paint(QPainter *);
+
+ private:
+ QSimpleRichText *m_richText;
+ };
+
+ class ConfigChecker : public KDialogBase
+ {
+ Q_OBJECT
+
+ public:
+ ConfigChecker(QWidget* parent = 0);
+ ~ConfigChecker();
+
+ public slots:
+ void run();
+ void started();
+ void finished(bool);
+ void setPercentageDone(int);
+ void saveResults();
+ void slotCancel();
+
+ private:
+ KProgress* progressBar();
+ QLabel* label();
+ KListBox* listBox();
+
+ private:
+ ConfigCheckerWidget *m_widget;
+ Tester *m_tester;
+ };
+}
+#endif
diff --git a/src/kile/configcheckerwidget.ui b/src/kile/configcheckerwidget.ui
new file mode 100644
index 0000000..921c056
--- /dev/null
+++ b/src/kile/configcheckerwidget.ui
@@ -0,0 +1,112 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ConfigCheckerWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ConfigCheckerWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>580</width>
+ <height>482</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>2</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>580</width>
+ <height>480</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>Performing System Check</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_lbChecking</cstring>
+ </property>
+ <property name="text">
+ <string>Checking if your TeX system is installed correctly...</string>
+ </property>
+ </widget>
+ <widget class="KProgress">
+ <property name="name">
+ <cstring>m_progress</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>m_grpResults</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>2</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Results</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListBox" row="0" column="0">
+ <property name="name">
+ <cstring>m_lstResults</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>2</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>480</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<includes>
+ <include location="local" impldecl="in implementation">configcheckerwidget.ui.h</include>
+</includes>
+<functions>
+ <function specifier="non virtual" returnType="KProgress *">progressBar()</function>
+ <function specifier="non virtual" returnType="QLabel *">label()</function>
+ <function specifier="non virtual" returnType="KListBox *">listBox()</function>
+</functions>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kprogress.h</includehint>
+ <includehint>klistbox.h</includehint>
+</includehints>
+</UI>
diff --git a/src/kile/configcheckerwidget.ui.h b/src/kile/configcheckerwidget.ui.h
new file mode 100644
index 0000000..e526b11
--- /dev/null
+++ b/src/kile/configcheckerwidget.ui.h
@@ -0,0 +1,27 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions or slots use
+** Qt Designer which will update this file, preserving your code. Create an
+** init() function in place of a constructor, and a destroy() function in
+** place of a destructor.
+*****************************************************************************/
+
+
+
+
+KProgress* ConfigCheckerWidget::progressBar()
+{
+ return m_progress;
+}
+
+
+QLabel* ConfigCheckerWidget::label()
+{
+ return m_lbChecking;
+}
+
+KListBox* ConfigCheckerWidget::listBox()
+{
+ return m_lstResults;
+}
diff --git a/src/kile/configcodecompletion.cpp b/src/kile/configcodecompletion.cpp
new file mode 100644
index 0000000..8cd952e
--- /dev/null
+++ b/src/kile/configcodecompletion.cpp
@@ -0,0 +1,521 @@
+/***************************************************************************
+ date : Mar 30 2007
+ version : 0.24
+ copyright : (C) 2004-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "configcodecompletion.h"
+
+#include <kdialog.h>
+#include <kstandarddirs.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+
+#include <qlayout.h>
+#include <qtabwidget.h>
+#include <qgroupbox.h>
+#include <qvgroupbox.h>
+#include <qbuttongroup.h>
+#include <qlabel.h>
+#include <qspinbox.h>
+#include <qframe.h>
+#include <qwhatsthis.h>
+#include <qstringlist.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+
+#include "kilelistselector.h"
+#include "kileconfig.h"
+#include "kilelogwidget.h"
+#include "kiletool_enums.h"
+
+ConfigCodeCompletion::ConfigCodeCompletion(KConfig *config, KileWidget::LogMsg *logwidget, QWidget *parent, const char *name )
+ : QWidget(parent,name), m_config(config), m_logwidget(logwidget)
+{
+ // Layout
+ QVBoxLayout *vbox = new QVBoxLayout(this, 5,KDialog::spacingHint() );
+
+ // Groupbox with TabDialog and two button
+ QGroupBox *gb_tab= new QGroupBox(i18n("Complete Modes"), this );
+ QGridLayout *grid_tab = new QGridLayout( gb_tab, 2,1, 12,8, "" );
+ grid_tab->addRowSpacing( 0, 12 );
+
+ // create TabWidget
+ tab = new QTabWidget(gb_tab);
+
+ // add three pages: Tex/Latex, Dictionary, Abbreviation
+ addPage(tab, TexPage, i18n("TeX/LaTeX"), "tex");
+ addPage(tab, DictionaryPage, i18n("Dictionary"), "dictionary");
+ addPage(tab, AbbreviationPage, i18n("Abbreviation"), "abbreviation");
+
+ // add two centered button
+ add = new KPushButton(i18n("Add..."),gb_tab);
+ remove = new KPushButton(i18n("Remove"),gb_tab);
+
+ grid_tab->addMultiCellWidget(tab,1,1,0,1);
+ grid_tab->addWidget(add,2,0,Qt::AlignRight);
+ grid_tab->addWidget(remove,2,1,Qt::AlignLeft);
+
+ // below: OptionBox
+ QButtonGroup *bg_options = new QButtonGroup( this, "bgOptions" );
+ bg_options->setColumnLayout(0, Qt::Vertical );
+ bg_options->layout()->setSpacing( 6 );
+ bg_options->layout()->setMargin( 11 );
+ QGridLayout *bg_optionsLayout = new QGridLayout( bg_options->layout() );
+ bg_optionsLayout->setAlignment( Qt::AlignTop );
+
+ cb_setcursor = new QCheckBox(i18n("Place cursor"),bg_options);
+ cb_setbullets = new QCheckBox(i18n("Insert bullets"),bg_options);
+ cb_closeenv = new QCheckBox(i18n("Close environments"),bg_options);
+ cb_usecomplete = new QCheckBox(i18n("Use complete"),bg_options);
+ cb_autocomplete = new QCheckBox(i18n("Auto completion (LaTeX)"),bg_options);
+ lb_latexthreshold = new QLabel(i18n("Threshold:"),bg_options);
+ sp_latexthreshold = new QSpinBox(1,9,1,bg_options);
+ QLabel *lb_latexletters = new QLabel(i18n("letters"),bg_options);
+ cb_autocompletetext = new QCheckBox(i18n("Auto completion (text)"),bg_options);
+ lb_textthreshold = new QLabel(i18n("Threshold:"),bg_options);
+ sp_textthreshold = new QSpinBox(1,9,1,bg_options);
+ QLabel *lb_textletters = new QLabel(i18n("letters"),bg_options);
+ cb_showabbrevview = new QCheckBox(i18n("Show abbreviations"),bg_options);
+ cb_autocompleteabbrev = new QCheckBox(i18n("Auto completion (abbrev.)"),bg_options);
+ cb_citeoutofbraces = new QCheckBox(i18n("Move out of braces (citation keylists)"),bg_options);
+
+ bg_optionsLayout->addWidget(cb_setcursor,0,0);
+ bg_optionsLayout->addWidget(cb_setbullets,1,0);
+ bg_optionsLayout->addWidget(cb_closeenv,2,0);
+ bg_optionsLayout->addWidget(cb_showabbrevview,3,0);
+ bg_optionsLayout->addWidget(cb_usecomplete,0,2);
+ bg_optionsLayout->addWidget(cb_autocomplete,1,2);
+ bg_optionsLayout->addWidget(lb_latexthreshold,1,4);
+ bg_optionsLayout->addWidget(sp_latexthreshold,1,6);
+ bg_optionsLayout->addWidget(lb_latexletters,1,7);
+ bg_optionsLayout->addWidget(cb_autocompletetext,2,2);
+ bg_optionsLayout->addWidget(lb_textthreshold,2,4);
+ bg_optionsLayout->addWidget(sp_textthreshold,2,6);
+ bg_optionsLayout->addWidget(lb_textletters,2,7);
+ bg_optionsLayout->addWidget(cb_autocompleteabbrev,3,2);
+ bg_optionsLayout->addMultiCellWidget(cb_citeoutofbraces,4,4,0,7);
+
+ // tune layout
+ bg_optionsLayout->setColSpacing(1,20);
+ bg_optionsLayout->setColSpacing(3,12);
+ bg_optionsLayout->setColSpacing(5,8);
+ bg_optionsLayout->setColStretch(7,1);
+
+ QWhatsThis::add(cb_setcursor,i18n("Try to place the cursor."));
+ QWhatsThis::add(cb_setbullets,i18n("Insert bullets, where the user must input data."));
+ QWhatsThis::add(cb_closeenv,i18n("Also close an environment, when an opening command is inserted."));
+ QWhatsThis::add(cb_usecomplete,i18n("Enable components of word completion."));
+ QWhatsThis::add(cb_autocomplete,i18n("Directional or popup-based completion with TeX/LaTeX commands, which are given in all selected word completion lists. This mode can only be selected, if no other plugin for autocompletion is active."));
+ QWhatsThis::add(cb_autocompletetext,i18n("Directional or popup-based completion from words in the current document. This mode can only be selected, if no other plugin for autocompletion is active."));
+ QWhatsThis::add(sp_latexthreshold,i18n("Automatically show a completion list of TeX/LaTeX commands, when the word has this length."));
+ QWhatsThis::add(sp_textthreshold,i18n("Automatically show a completion list, when the word has this length."));
+ QWhatsThis::add(cb_citeoutofbraces,i18n("Move cursor out of braces after selecting from a citation keylist."));
+
+ // bottom: warning
+ QLabel *lb_automodes = new QLabel(i18n("Warning: all autocompletion modes will be disabled, if you enable KTextEditor plugin word completion."),this);
+
+ // add OptionBox and TabDialog into the layout
+ vbox->addWidget(gb_tab);
+ vbox->addWidget(bg_options);
+ vbox->addWidget(lb_automodes);
+ vbox->addStretch();
+
+ connect(tab,SIGNAL(currentChanged(QWidget*)),this,SLOT(showPage(QWidget*)));
+ connect(add,SIGNAL(clicked()),this,SLOT(addClicked()));
+ connect(remove,SIGNAL(clicked()),this,SLOT(removeClicked()));
+
+ // justify height
+ QCheckListItem *item = new QCheckListItem(m_listview[AbbreviationPage], "Test", QCheckListItem::CheckBox);
+ int h = 6*(item->height()+1) + 1;
+ for ( uint i=TexPage; i<NumPages; ++i )
+ m_listview[i]->setFixedHeight(h);
+ delete item;
+
+ // find resource directories for cwl files
+ getCwlDirs();
+}
+
+ConfigCodeCompletion::~ConfigCodeCompletion()
+{
+}
+
+void ConfigCodeCompletion::addPage(QTabWidget *tab, CompletionPage page, const QString &title, const QString &dirname)
+{
+ m_page[page] = new QWidget(tab);
+
+ m_listview[page] = new KListView( m_page[page] );
+ m_listview[page]->addColumn(i18n("Complete Files"));
+ m_listview[page]->addColumn(i18n("Local File"));
+ m_listview[page]->setFullWidth(true);
+
+ QGridLayout *grid = new QGridLayout(m_page[page], 1,1, 10,10);
+ grid->addWidget(m_listview[page],0,0);
+
+ // add Tab
+ tab->addTab(m_page[page],title);
+
+ // remember directory name
+ m_dirname << dirname;
+
+ connect(m_listview[page], SIGNAL(clicked( QListViewItem *)), this, SLOT(slotListviewClicked(QListViewItem *)));
+}
+
+//////////////////// read/write configuration ////////////////////
+
+void ConfigCodeCompletion::readConfig(void)
+{
+ // read selected and deselected filenames with wordlists
+ m_wordlist[TexPage] = KileConfig::completeTex();
+ m_wordlist[DictionaryPage] = KileConfig::completeDict();
+ m_wordlist[AbbreviationPage] = KileConfig::completeAbbrev();
+
+ // set checkbox status
+ cb_usecomplete->setChecked( KileConfig::completeEnabled() );
+ cb_setcursor->setChecked( KileConfig::completeCursor() );
+ cb_setbullets->setChecked( KileConfig::completeBullets() );
+ cb_closeenv->setChecked( KileConfig::completeCloseEnv() );
+ cb_showabbrevview->setChecked( KileConfig::completeShowAbbrev() );
+ cb_citeoutofbraces->setChecked( KileConfig::completeCitationMove() );
+
+ // set checkboxes and thresholds for autocompletion modes
+ if ( kateCompletionPlugin() )
+ {
+ cb_autocomplete->setChecked( false );
+ cb_autocompletetext->setChecked( false );
+ cb_autocompleteabbrev->setChecked( false );
+ }
+ else
+ {
+ cb_autocomplete->setChecked( KileConfig::completeAuto() );
+ cb_autocompletetext->setChecked( KileConfig::completeAutoText() );
+ cb_autocompleteabbrev->setChecked( KileConfig::completeAutoAbbrev() );
+ }
+ sp_latexthreshold->setValue( KileConfig::completeAutoThreshold() );
+ sp_textthreshold->setValue( KileConfig::completeAutoTextThreshold() );
+
+ // insert filenames into listview
+ for ( uint i=TexPage; i<NumPages; ++i )
+ setListviewEntries( CompletionPage(i) );
+}
+
+void ConfigCodeCompletion::writeConfig(void)
+{
+ // default: no changes in configuration
+ bool changed = false;
+
+ // get listview entries
+ for ( uint i=TexPage; i<NumPages; ++i )
+ changed |= getListviewEntries( CompletionPage(i) );
+
+ // Konfigurationslisten abspeichern
+ KileConfig::setCompleteTex( m_wordlist[TexPage] );
+ KileConfig::setCompleteDict( m_wordlist[DictionaryPage] );
+ KileConfig::setCompleteAbbrev( m_wordlist[AbbreviationPage] );
+
+ // save checkbox status
+ KileConfig::setCompleteEnabled(cb_usecomplete->isChecked());
+ KileConfig::setCompleteCursor(cb_setcursor->isChecked());
+ KileConfig::setCompleteBullets(cb_setbullets->isChecked());
+ KileConfig::setCompleteCloseEnv(cb_closeenv->isChecked());
+ KileConfig::setCompleteShowAbbrev( cb_showabbrevview->isChecked() );
+ KileConfig::setCompleteCitationMove( cb_citeoutofbraces->isChecked() );
+
+ // read autocompletion settings
+ bool autoModeLatex = cb_autocomplete->isChecked();
+ bool autoModeText = cb_autocompletetext->isChecked();
+ bool autoModeAbbrev = cb_autocompleteabbrev->isChecked();
+ if ( kateCompletionPlugin() )
+ {
+ if ( autoModeLatex || autoModeText || autoModeAbbrev)
+ {
+ QString msg = i18n("You enabled the KTextEditor-Plugin for word completion, "
+ "but this conflicts with the auto completion modes of Kile. "
+ "As only one of these completion modes can be used, the "
+ "autocompletion modes of Kile will be disabled.");
+ KMessageBox::information( 0L,"<center>" + msg + "</center>",i18n("Autocomplete warning") );
+
+ // disable Kile autocomplete modes
+ autoModeLatex = false;
+ autoModeText = false;
+ autoModeAbbrev = false;
+ }
+ }
+
+ // save settings for Kile autocompletion modes
+ KileConfig::setCompleteAuto( autoModeLatex );
+ KileConfig::setCompleteAutoText( autoModeText );
+ KileConfig::setCompleteAutoAbbrev( autoModeAbbrev );
+ KileConfig::setCompleteAutoThreshold( sp_latexthreshold->value() );
+ KileConfig::setCompleteAutoTextThreshold( sp_textthreshold->value() );
+
+ // save changed wordlists?
+ KileConfig::setCompleteChangedLists(changed);
+}
+
+// read kate plugin configuration
+bool ConfigCodeCompletion::kateCompletionPlugin()
+{
+ m_config->setGroup("Kate Document Defaults");
+ return m_config->readBoolEntry("KTextEditor Plugin ktexteditor_docwordcompletion",false);
+}
+
+//////////////////// listview ////////////////////
+
+// ListView fr den Konfigurationsdialog einstellen
+
+void ConfigCodeCompletion::setListviewEntries(CompletionPage page)
+{
+ QString listname = m_dirname[page];
+ QString localdir = m_localCwlDir + listname + '/';
+ QString globaldir = m_globalCwlDir + listname + '/';
+
+ // Daten aus der Konfigurationsliste in das ListView-Widget eintragen
+ m_listview[page]->setUpdatesEnabled(false);
+ m_listview[page]->clear();
+ QStringList::ConstIterator it;
+ for ( it=m_wordlist[page].begin(); it!=m_wordlist[page].end(); ++it )
+ {
+ QString basename = (*it).right( (*it).length()-2 );
+ bool localExists = QFileInfo(localdir+basename+".cwl").exists();
+
+ QCheckListItem *item = new QCheckListItem(m_listview[page],basename,QCheckListItem::CheckBox);
+ if ( localExists )
+ {
+ item->setOn( (*it).at(0) == '1' ? true : false );
+ item->setText(1,"+");
+ }
+ else if ( QFileInfo(globaldir+basename+".cwl").exists() )
+ {
+ item->setOn( (*it).at(0) == '1' ? true : false );
+ }
+ else
+ {
+ item->setOn(false);
+ item->setText(1,i18n("File not found"));
+ }
+ m_listview[page]->insertItem(item);
+ }
+
+ updateColumnWidth(m_listview[page]);
+ m_listview[page]->setUpdatesEnabled(true);
+}
+
+void ConfigCodeCompletion::updateColumnWidth(KListView *listview)
+{
+ listview->setColumnWidth(0,listview->columnWidth(0)+60);
+}
+
+bool ConfigCodeCompletion::getListviewEntries(CompletionPage page)
+{
+ bool changed = false;
+
+ // count number of entries
+ uint n = m_listview[page]->childCount();
+
+ // there are changes if this number has changed
+ if ( n != m_wordlist[page].count() )
+ changed = true;
+
+ // clear all stringlist with files, if there are no entries
+ if ( n == 0 ) {
+ m_wordlist[page].clear();
+ return changed;
+ }
+
+ // now check all entries if they have changed
+ QStringList newfiles;
+ int index = 0;
+ QCheckListItem *item = (QCheckListItem *)m_listview[page]->firstChild();
+ while ( item ) {
+ QString s = ( item->isOn() ) ? "1-" : "0-";
+ s += item->text(0);
+ newfiles.append(s);
+
+ // check for a change
+ if ( m_wordlist[page][index] != s )
+ changed = true;
+
+ // go on
+ item = (QCheckListItem *)item->nextSibling();
+ ++index;
+ }
+
+ // only update if there are changes
+ if ( changed )
+ m_wordlist[page] = newfiles;
+
+ return changed;
+}
+
+bool ConfigCodeCompletion::isListviewEntry(KListView *listview, const QString &filename)
+{
+ QCheckListItem *item = (QCheckListItem *)listview->firstChild();
+ while ( item )
+ {
+ if ( item->text() == filename )
+ return true;
+ item = (QCheckListItem *)item->nextSibling();
+ }
+ return false;
+}
+
+//////////////////// tabpages parameter ////////////////////
+
+KListView *ConfigCodeCompletion::getListview(QWidget *page)
+{
+ for ( uint i=TexPage; i<NumPages; ++i )
+ {
+ if ( page == m_page[i] )
+ return m_listview[i];
+ }
+ return 0;
+}
+
+QString ConfigCodeCompletion::getListname(QWidget *page)
+{
+ for ( uint i=TexPage; i<NumPages; ++i )
+ {
+ if ( page == m_page[i] )
+ return m_dirname[i];
+ }
+ return QString::null;
+}
+
+//////////////////// shwo tabpages ////////////////////
+
+void ConfigCodeCompletion::showPage(QWidget *page)
+{
+ KListView *listview = getListview(page);
+ if ( listview )
+ remove->setEnabled( listview->selectedItems().count() > 0 );
+}
+
+//////////////////// add/remove new wordlists ////////////////////
+
+// find local and global resource directories
+
+void ConfigCodeCompletion::getCwlDirs()
+{
+ m_localCwlDir = locateLocal("appdata","complete/");
+ m_globalCwlDir = QString::null;
+
+ QStringList dirs = KGlobal::dirs()->findDirs("appdata","complete/");
+ for ( QStringList::ConstIterator it=dirs.begin(); it!=dirs.end(); ++it )
+ {
+ if ( (*it) != m_localCwlDir )
+ {
+ m_globalCwlDir = (*it);
+ break;
+ }
+ }
+}
+
+// find local and global cwl files: global files are not added,
+// if there is already a local file with this name. We fill a map
+// with filename as key and filepath as value. Additionally all
+// filenames are added to a stringlist.
+
+void ConfigCodeCompletion::getCwlFiles(QMap<QString,QString> &map, QStringList &list, const QString &dir)
+{
+ QStringList files = QDir(dir,"*.cwl").entryList();
+ for ( QStringList::ConstIterator it=files.begin(); it!=files.end(); ++it )
+ {
+ QString filename = QFileInfo(*it).fileName();
+ if ( ! map.contains(filename) )
+ {
+ map[filename] = dir + '/' + (*it);
+ list << filename;
+ }
+ }
+}
+
+void ConfigCodeCompletion::addClicked()
+{
+ // determine current subdirectory for current tab page
+ QString listname = getListname(tab->currentPage());
+
+
+ // get a sorted list of all cwl files from both directories
+ QMap<QString,QString> filemap;
+ QStringList filelist;
+ getCwlFiles(filemap,filelist,m_localCwlDir+listname);
+ getCwlFiles(filemap,filelist,m_globalCwlDir+listname);
+ filelist.sort();
+
+ // dialog to add cwl files
+ KileListSelectorMultiple *dlg = new KileListSelectorMultiple(filelist,i18n("Complete Files"),i18n("Select Files"), this);
+ if ( dlg->exec() )
+ {
+ if ( dlg->currentItem() >= 0 )
+ {
+ KListView *listview = getListview(tab->currentPage()); // get current page
+ QStringList filenames = dlg->selected(); // get selected files
+ for ( QStringList::ConstIterator it=filenames.begin(); it!=filenames.end(); ++it )
+ {
+ QString filename = *it;
+ // could we accept the wordlist?
+ QFileInfo fi( filemap[filename] );
+ if ( !filename.isEmpty() && fi.exists() && fi.isReadable() )
+ {
+ QString basename = filename.left(filename.length()-4);
+
+ // check if this entry already exists
+ if ( isListviewEntry(listview,basename) )
+ {
+ m_logwidget->printMsg(KileTool::Info,i18n("Wordlist '%1' is already used.").arg(basename),i18n("Complete"));
+ continue;
+ }
+
+ // add new entry
+ QCheckListItem *item = new QCheckListItem(listview,basename,QCheckListItem::CheckBox);
+ item->setOn(true);
+ item->setSelected(true);
+ if ( filemap[filename].left(m_localCwlDir.length()) == m_localCwlDir )
+ item->setText(1,"+");
+
+ listview->insertItem(item);
+ }
+ }
+ updateColumnWidth(listview);
+ }
+ }
+ delete dlg;
+
+}
+
+// delete a selected entry
+
+void ConfigCodeCompletion::removeClicked()
+{
+ QWidget *page = tab->currentPage();
+ KListView *list = getListview(page); // determine page
+ QCheckListItem *item = (QCheckListItem *)list->selectedItem(); // determine entry
+
+ if ( item )
+ {
+ list->takeItem(item);
+ delete item;
+ // Button enabled/disabled?
+ showPage(page);
+ }
+}
+
+void ConfigCodeCompletion::slotListviewClicked(QListViewItem *)
+{
+ KListView *listview = getListview(tab->currentPage()); // get current page
+ remove->setEnabled( listview->selectedItems().count() > 0 );
+}
+
+#include "configcodecompletion.moc"
diff --git a/src/kile/configcodecompletion.h b/src/kile/configcodecompletion.h
new file mode 100644
index 0000000..2c24feb
--- /dev/null
+++ b/src/kile/configcodecompletion.h
@@ -0,0 +1,99 @@
+/***************************************************************************
+ date : Mar 30 2007
+ version : 0.24
+ copyright : (C) 2004-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CONFIGCODECOMPLETION_H
+#define CONFIGCODECOMPLETION_H
+
+#include <qwidget.h>
+#include <qtabwidget.h>
+#include <qcheckbox.h>
+#include <qlabel.h>
+#include <qspinbox.h>
+#include <qstring.h>
+
+#include <kdeversion.h>
+#include <klistview.h>
+#include <kpushbutton.h>
+#include <kconfig.h>
+
+/**
+ *@author Holger Danielsson
+ */
+
+namespace KileWidget { class LogMsg; }
+
+class ConfigCodeCompletion : public QWidget
+{
+ Q_OBJECT
+public:
+ ConfigCodeCompletion(KConfig *config, KileWidget::LogMsg *logwidget, QWidget *parent=0, const char *name=0);
+ ~ConfigCodeCompletion();
+
+ void readConfig(void);
+ void writeConfig(void);
+
+private:
+ enum CompletionPage { TexPage=0, DictionaryPage=1, AbbreviationPage=2, NumPages=3 };
+
+ KConfig *m_config;
+ KileWidget::LogMsg *m_logwidget;
+
+ // tabs, views, pages, wordlists
+ QTabWidget *tab;
+ KListView *m_listview[NumPages];
+ QWidget *m_page[NumPages];
+ QStringList m_wordlist[NumPages];
+ QStringList m_dirname;
+
+ // button
+ KPushButton *add,*remove;
+
+ // Checkboxes/Spinboxes
+ QCheckBox *cb_usecomplete, *cb_autocomplete;
+ QCheckBox *cb_setcursor, *cb_setbullets;
+ QCheckBox *cb_closeenv;
+ QSpinBox *sp_latexthreshold;
+ QLabel *lb_latexthreshold;
+ QCheckBox *cb_autocompletetext;
+ QSpinBox *sp_textthreshold;
+ QLabel *lb_textthreshold;
+ QCheckBox *cb_autocompleteabbrev;
+ QCheckBox *cb_showabbrevview;
+ QCheckBox *cb_citeoutofbraces;
+
+ bool kateCompletionPlugin();
+
+ KListView *getListview(QWidget *page);
+ QString getListname(QWidget *page);
+ void addPage(QTabWidget *tab, CompletionPage page, const QString &title, const QString &dirname);
+
+ void setListviewEntries(CompletionPage page);
+ bool getListviewEntries(CompletionPage page);
+ bool isListviewEntry(KListView *listview, const QString &filename);
+ void updateColumnWidth(KListView *listview);
+
+ QString m_localCwlDir, m_globalCwlDir;
+ void getCwlFiles(QMap<QString,QString> &map, QStringList &list, const QString &dir);
+ void getCwlDirs();
+
+private slots:
+ void showPage(QWidget *page);
+ void addClicked();
+ void removeClicked();
+ void slotListviewClicked(QListViewItem *);
+};
+
+#endif
diff --git a/src/kile/configstructure.cpp b/src/kile/configstructure.cpp
new file mode 100644
index 0000000..15bd3d7
--- /dev/null
+++ b/src/kile/configstructure.cpp
@@ -0,0 +1,353 @@
+/***************************************************************************
+ date : Feb 09 2004
+ version : 0.10.0
+ copyright : (C) 2004 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "configstructure.h"
+
+#include <kdialog.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <kiconloader.h>
+
+#include <qlayout.h>
+#include <qtabwidget.h>
+#include <qgroupbox.h>
+#include <qvgroupbox.h>
+#include <qframe.h>
+#include <qstringlist.h>
+#include <qpushbutton.h>
+#include <qcombobox.h>
+#include <qspinbox.h>
+#include <qpainter.h>
+#include <qrect.h>
+#include <qlabel.h>
+
+namespace KileStructure
+{
+
+//////////////////// KileCenteredTableItem ////////////////////
+
+void KileCenteredTableItem::paint(QPainter* p,const QColorGroup& cg,const QRect& cr,bool selected)
+{
+ int w = cr.width();
+ int h = cr.height();
+
+ if (selected && colSpan()==1 ) {
+ p->fillRect( 0,0,w,h, cg.brush( QColorGroup::Highlight ) );
+ p->setPen( cg.highlightedText() );
+ } else {
+ p->fillRect( 0,0,w,h, Qt::white );
+ p->setPen( Qt::black );
+ /*
+ QFont f( p->font() );
+ f.setBold(true);
+ p->setFont(f);
+ */
+ }
+
+ p->drawText( 2,0,w-4,h, Qt::AlignHCenter|AlignVCenter, text() );
+}
+
+//////////////////// KileTable ////////////////////
+
+KileTable::KileTable(QWidget *dialog, QWidget *parent, const char *name) : QTable(parent,name)
+{
+ setShowGrid(false);
+ setSelectionMode(QTable::NoSelection);
+ setFocusStyle(QTable::FollowStyle);
+
+ verticalHeader()->hide();
+ setLeftMargin(0);
+ setVScrollBarMode(QScrollView::AlwaysOff);
+ setHScrollBarMode(QScrollView::AlwaysOff);
+ setFocusPolicy(QWidget::NoFocus);
+
+ horizontalHeader()->setResizeEnabled(false);
+ horizontalHeader()->setClickEnabled(false);
+
+ connect(this,SIGNAL(clickedCell(KileTable *,int,int)),dialog,SLOT(clickedTable(KileTable *,int,int)));
+}
+
+void KileTable::contentsMousePressEvent(QMouseEvent *ev)
+{
+ ev->accept();
+ emit( clickedCell( this,rowAt(ev->y()), columnAt(ev->x()) ));
+}
+
+//////////////////// ConfigStructure ////////////////////
+
+ConfigStructure::ConfigStructure(QWidget *parent, const char *name )
+ : QWidget(parent,name)
+{
+ m_entries << i18n( "Files" ) << i18n( "Labels" ) << i18n( "References" )
+ << i18n( "Index" ) << i18n( "Graphics" ) << i18n( "Sectioning" );
+
+ QHBoxLayout *hbox = new QHBoxLayout(this, 5,KDialog::spacingHint() );
+
+ // Groupbox with entries
+ QVGroupBox *gb_entries= new QVGroupBox(i18n("Entries"), this );
+ QWidget *widget1 = new QWidget(gb_entries);
+ QVBoxLayout *vbox1 = new QVBoxLayout(widget1, 5,KDialog::spacingHint() );
+
+ // table with entries
+ m_entriestable = new KileTable(this,widget1);
+ m_entriestable->setNumCols(3);
+ m_entriestable->setNumRows(6);
+ m_entriestable->setColumnReadOnly(0,true);
+
+ QStringList list1;
+ list1 << i18n( "Title" ) << i18n( "Visible" ) << i18n( "Open" );
+ m_entriestable->setColumnLabels(list1);
+ m_entriestable->horizontalHeader()->setLabel(1,SmallIcon("structure"), i18n( "Visible" ));
+ m_entriestable->horizontalHeader()->setLabel(2,SmallIcon("structure"), i18n( "Node" ));
+
+ for ( uint i=0; i<m_entries.count(); ++i ) {
+ QTableItem *item = new QTableItem(m_entriestable,QTableItem::Never, m_entries[i]);
+ m_entriestable->setItem( i,0,item );
+ m_visible[i] = new QCheckTableItem(m_entriestable,"");
+ m_entriestable->setItem( i,1, m_visible[i] );
+ m_defaultopen[i] = new QCheckTableItem(m_entriestable,"close");
+ m_entriestable->setItem( i,2, m_defaultopen[i] );
+ }
+
+ // groupbox with sectioning
+ QVGroupBox *gb_sectioning= new QVGroupBox(i18n("Sectioning"), this );
+ QWidget *widget2 = new QWidget(gb_sectioning);
+ QVBoxLayout *vbox2 = new QVBoxLayout(widget2, 5,KDialog::spacingHint() );
+
+ // document class
+ QWidget *widget3 = new QWidget(widget2);
+ QHBoxLayout *hbox3 = new QHBoxLayout(widget3, 5,KDialog::spacingHint() );
+ QLabel *label7 = new QLabel(i18n("Document class:"), widget3);
+ comboclasses = new QComboBox(widget3);
+ hbox3->addWidget(label7);
+ hbox3->addSpacing(10);
+ hbox3->addWidget(comboclasses);
+ hbox3->setStretchFactor(comboclasses,1);
+
+ // table with sectioning commands
+ m_sectioningtable = new KileTable(this,widget2);
+ m_sectioningtable->setNumCols(3);
+ m_sectioningtable->setNumRows(5);
+ m_sectioningtable->setColumnReadOnly(0,true);
+ m_sectioningtable->setColumnReadOnly(1,true);
+
+ QStringList list2;
+ list2 << i18n( "Level" ) << i18n( "LaTeX Command" ) << i18n( "Structure Node" );
+ m_sectioningtable->setColumnLabels(list2);
+ m_sectioningtable->horizontalHeader()->setLabel(2,SmallIcon("structure"),"Structure Node");
+
+ // default structure level
+ QGroupBox *structGroup = new QGroupBox(2, Qt::Horizontal, i18n("Structure View"), widget2);
+ QLabel *label9 = new QLabel(i18n("Default expansion &level: "),structGroup);
+ m_structurelevel = new QSpinBox(1,5, 1, structGroup);
+ label9->setBuddy(m_structurelevel);
+
+ QGroupBox *classGroup = new QGroupBox(1,Qt::Horizontal,i18n("Document Classes"), widget2);
+ QWidget *widget4 = new QWidget(classGroup);
+ QHBoxLayout *hbox4 = new QHBoxLayout(widget4, 5,KDialog::spacingHint() );
+ QLabel *label10 = new QLabel("Manage classes:",widget4);
+ add = new QPushButton(i18n("Add"), widget4);
+ remove = new QPushButton(i18n("Remove"), widget4);
+ hbox4->addWidget(label10);
+ hbox4->addStretch();
+ hbox4->addWidget(add);
+ hbox4->addWidget(remove);
+
+ // add widgets to the left vertical layout
+ vbox1->addWidget(m_entriestable);
+ vbox1->addStretch();
+
+ // add widgets to the right vertical layout
+ vbox2->addWidget(widget3);
+ vbox2->addSpacing(10);
+ vbox2->addWidget(m_sectioningtable);
+ vbox2->addSpacing(10);
+ vbox2->addWidget(structGroup);
+ vbox2->addWidget(classGroup);
+ vbox2->addStretch();
+
+ // add both groupboxes to horizontal layout
+ hbox->addWidget(gb_entries);
+ hbox->addWidget(gb_sectioning);
+ hbox->setStretchFactor(gb_entries,3);
+ hbox->setStretchFactor(gb_sectioning,4);
+
+ // set default sectioning commands
+ comboclasses->insertItem("latex");
+ QStringList *sectcommands = new QStringList;
+ *sectcommands << "part" << "chapter" << "section" << "subsection" << "subsubsection";
+ m_docclasses["latex"] = sectcommands;
+ showSectioning(m_docclasses["latex"]);
+ remove->setEnabled(false);
+
+ connect(m_structurelevel,SIGNAL(valueChanged(int)),this,SLOT(spinboxChanged(int)));
+ connect(comboclasses,SIGNAL(activated(const QString &)),this,SLOT(comboboxChanged(const QString &)));
+ connect(add,SIGNAL(clicked()),this,SLOT(clickedAdd()));
+
+ add->setEnabled(false);
+}
+
+ConfigStructure::~ConfigStructure()
+{
+ QMap<QString, const QStringList*>::Iterator it, end = m_docclasses.end();
+ for(it = m_docclasses.begin() ; it != end ; ++it)
+ delete *it;
+}
+
+void ConfigStructure::polish()
+{
+ // QWidget::polish();
+
+ uint w = m_entriestable->sizeHint().width();
+ m_entriestable->setColumnWidth(0,3*w/7);
+ m_entriestable->setColumnWidth(1,2*w/7);
+ m_entriestable->setColumnWidth(2,2*w/7+1);
+ m_entriestable->setColumnStretchable(2,true);
+
+ w = m_sectioningtable->sizeHint().width();
+ m_sectioningtable->setColumnWidth(0,w/6);
+ m_sectioningtable->setColumnWidth(1,3*w/6);
+ m_sectioningtable->setColumnWidth(2,2*w/6+1);
+ m_sectioningtable->setColumnStretchable(2,true);
+
+}
+
+void ConfigStructure::clickedTable(KileTable *table,int row, int col)
+{
+ if ( table==m_entriestable && row>=0 && row<6 ) {
+ if ( col==1 )
+ m_visible[row]->setChecked( !m_visible[row]->isChecked() );
+ else if ( col == 2 ) {
+ if ( m_defaultopen[row]->isChecked() ) {
+ m_defaultopen[row]->setChecked(false);
+ m_defaultopen[row]->setText("close");
+ } else {
+ m_defaultopen[row]->setChecked(true);
+ m_defaultopen[row]->setText("open");
+ }
+ }
+ }
+}
+
+void ConfigStructure::spinboxChanged(int)
+{
+ if ( m_docclasses.contains( comboclasses->currentText() ) ) {
+ changeSectioning(m_docclasses[comboclasses->currentText()]);
+ }
+}
+
+void ConfigStructure::comboboxChanged(const QString &name)
+{
+ if ( m_docclasses.contains(name) ) {
+ showSectioning(m_docclasses[name]);
+ remove->setEnabled( name != "latex" );
+ }
+}
+
+void ConfigStructure::changeSectioning(const QStringList *list)
+{
+ for (uint i=0; i<list->count(); ++i) {
+ QString label = ( i < (uint)m_structurelevel->value() ) ? "open" : "close";
+ m_sectioningtable->setText(i,2,label);
+ }
+}
+
+void ConfigStructure::showSectioning(const QStringList *list)
+{
+ QString label1,label2,label3;
+ for (uint i=0; i<5; ++i) {
+ if ( i < list->count() ) {
+ label1 = QString("%1").arg(i+1);
+ label2 = (*list)[i];
+ label3 = ( i < (uint)m_structurelevel->value() ) ? "open" : "close";
+ } else {
+ label1 = label2 = label3 = QString::null;
+ }
+ KileCenteredTableItem *item1 = new KileCenteredTableItem(m_sectioningtable,
+ QTableItem::Never,label1);
+ m_sectioningtable->setItem( i,0,item1 );
+ m_sectioningtable->setText( i,1,label2 );
+ KileCenteredTableItem *item3 = new KileCenteredTableItem(m_sectioningtable,
+ QTableItem::Never,label3);
+ m_sectioningtable->setItem( i,2,item3 );
+ }
+}
+
+void ConfigStructure::clickedAdd()
+{
+}
+
+//////////////////// read/write configuration ////////////////////
+
+void ConfigStructure::readConfig(KConfig *config)
+{
+ // config section
+ config->setGroup( "Structure Entries" );
+ for ( uint i=0; i<m_entries.count(); ++i ) {
+ int defaultvalue = ( m_entries[i] == i18n( "Sectioning" ) ) ? KileStructure::Visible | KileStructure::Opened
+ : KileStructure::Visible;
+ int num = config->readNumEntry(m_entries[i],defaultvalue);
+ m_visible[i]->setChecked( (num & KileStructure::Visible) ? true : false );
+ if ( num & KileStructure::Opened ) {
+ m_defaultopen[i]->setChecked(true);
+ m_defaultopen[i]->setText("open");
+ }
+ }
+
+ config->setGroup( "Structure Sectioning" );
+ QStringList classlist = config->readListEntry("classes");
+ classlist.sort();
+ for ( uint i=0; i<classlist.count(); ++i ) {
+ QStringList list = config->readListEntry(classlist[i]);
+ if ( list.count() > 0 ) {
+ comboclasses->insertItem(classlist[i]);
+ QStringList *sectioningcommands = new QStringList(list);
+ m_docclasses[classlist[i]] = sectioningcommands;
+ }
+ }
+
+ m_structurelevel->setValue(config->readNumEntry("DefaultLevel",3));
+}
+
+void ConfigStructure::writeConfig(KConfig *config)
+{
+ // config section
+ config->setGroup( "Structure Entries" );
+ for ( uint i=0; i<m_entries.count(); ++i ) {
+ int num = ( m_visible[i]->isChecked() ) ? KileStructure::Visible : KileStructure::None;
+ if ( m_defaultopen[i]->isChecked() )
+ num += KileStructure::Opened;
+ config->writeEntry(m_entries[i],num);
+ }
+
+ config->setGroup( "Structure Sectioning" );
+ QStringList classlist;
+ for ( int i=0; i<comboclasses->count(); ++i ) {
+ QString entry = comboclasses->text(i);
+ if ( entry != "latex" ) {
+ classlist << entry;
+ QString entrylist = m_docclasses[entry]->join(",");
+ config->writeEntry( entry, entrylist );
+ }
+ }
+ config->writeEntry( "classes", classlist );
+
+ config->writeEntry("DefaultLevel",m_structurelevel->value());
+}
+
+}
+#include "configstructure.moc"
diff --git a/src/kile/configstructure.h b/src/kile/configstructure.h
new file mode 100644
index 0000000..9041642
--- /dev/null
+++ b/src/kile/configstructure.h
@@ -0,0 +1,98 @@
+/***************************************************************************
+ date : Feb 09 2004
+ version : 0.10.0
+ copyright : (C) 2004 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CONFIGSTRUCTURE_H
+#define CONFIGSTRUCTURE_H
+
+#include <qwidget.h>
+#include <qtable.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qmap.h>
+
+class KConfig;
+
+class QRect;
+class QPainter;
+class QSpinBox;
+class QComboBox;
+class QPushButton;
+
+/**
+ *@author Holger Danielsson
+ */
+
+namespace KileStructure
+{
+
+ enum { None=0x0, Visible=0x1, Opened=0x2 };
+
+class KileCenteredTableItem : public QTableItem
+{
+public:
+ KileCenteredTableItem(QTable *table,EditType et,const QString& text) : QTableItem(table,et,text) {}
+ void paint(QPainter* p,const QColorGroup& cg,const QRect& cr,bool selected);
+ int alignment() const { return Qt::AlignHCenter; }
+};
+
+class KileTable : public QTable
+{
+ Q_OBJECT
+public:
+ KileTable(QWidget *dialog, QWidget *parent=0, const char *name=0);
+ void paintFocus(QPainter *, const QRect &) {}
+protected:
+ void contentsMousePressEvent(QMouseEvent *ev);
+signals:
+ void clickedCell(KileTable *,int row,int cell);
+};
+
+
+class ConfigStructure : public QWidget
+{
+ Q_OBJECT
+public:
+ ConfigStructure(QWidget *parent=0, const char *name=0);
+ ~ConfigStructure();
+
+ void readConfig(KConfig *config);
+ void writeConfig(KConfig *config);
+
+private:
+ QStringList m_entries;
+ QComboBox *comboclasses;
+ QSpinBox *m_structurelevel;
+ QPushButton *add, *remove;
+
+ KileTable *m_entriestable,*m_sectioningtable;
+ QCheckTableItem *m_visible[6], *m_defaultopen[6];
+ QMap<QString,const QStringList *> m_docclasses;
+
+ void showSectioning(const QStringList *list);
+ void changeSectioning(const QStringList *list);
+
+public slots:
+ void polish();
+
+private slots:
+ void clickedTable(KileTable *table,int row,int col);
+ void clickedAdd();
+ void spinboxChanged(int);
+ void comboboxChanged(const QString &name);
+};
+
+}
+#endif
diff --git a/src/kile/configtester.cpp b/src/kile/configtester.cpp
new file mode 100644
index 0000000..eeaf5cb
--- /dev/null
+++ b/src/kile/configtester.cpp
@@ -0,0 +1,270 @@
+/***************************************************************************
+ begin : Fri Jun 4 2004
+ copyright : (C) 2004 by Jeroen Wijnout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "configtester.h"
+
+#include <qfile.h>
+
+#include <kio/netaccess.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
+#include <ktempdir.h>
+#include <ksimpleconfig.h>
+#include <kglobal.h>
+#include "kiledebug.h"
+
+#include "kiletoolmanager.h"
+#include "kileinfo.h"
+#include "kileconfig.h"
+#include "kiletool.h"
+
+ConfigTest::ConfigTest() :
+ m_name(QString::null),
+ m_arg(QString::null),
+ m_altArg(QString::null),
+ m_mustPass(false)
+{
+}
+
+ConfigTest::ConfigTest(const QString &name, bool mustpass, const QString &arg, const QString &altarg /*= QString::null*/) :
+ m_name(name),
+ m_arg(arg),
+ m_altArg(altarg),
+ m_mustPass(mustpass)
+{
+}
+
+int ConfigTest::status() const
+{
+ bool passed = false;
+ if ( m_name == "binary" )
+ passed = m_arg.endsWith(m_altArg);
+ else if ( m_name == "version" )
+ passed = true;
+ else
+ passed = (m_arg == "0");
+
+ if ( passed ) return Success;
+ else if ( m_mustPass ) return Critical;
+ else return Failure;
+}
+
+QString ConfigTest::name() const
+{
+ return prettyName(m_name);
+}
+
+QString ConfigTest::resultText() const
+{
+ QString str = successMessage(m_name);
+ if ( status() == Failure ) str = failureMessage(m_name);
+ else if ( status() == Critical ) str = criticalMessage(m_name);
+
+ if ( m_name == "binary" )
+ {
+ str += " (" + m_altArg + " => " + m_arg + ')';
+ if ( status()==Failure && s_msgFailure.contains(m_altArg) )
+ str += QString("<br>(%1)").arg( s_msgFailure[m_altArg] );
+ return str;
+ }
+ else if ( m_name == "version" )
+ return m_arg;
+ else
+ return str;
+}
+
+QMap<QString,QString> ConfigTest::s_prettyName;
+QMap<QString,QString> ConfigTest::s_msgSuccess;
+QMap<QString,QString> ConfigTest::s_msgFailure;
+QMap<QString,QString> ConfigTest::s_msgCritical;
+
+void ConfigTest::addPrettyName(const QString &test, const QString &prettyName) { s_prettyName [test] = prettyName;}
+void ConfigTest::addSuccessMessage(const QString &test, const QString &msg) { s_msgSuccess [test] = msg; }
+void ConfigTest::addFailureMessage(const QString &test, const QString &msg) { s_msgFailure [test] = msg; }
+void ConfigTest::addCriticalMessage(const QString &test, const QString &msg) { s_msgCritical [test] = msg; }
+
+QString ConfigTest::prettyName(const QString &test)
+{
+ if ( s_prettyName.contains(test) ) return s_prettyName[test];
+ else return test;
+}
+
+QString ConfigTest::successMessage(const QString &test)
+{
+ if ( s_msgSuccess.contains(test) ) return s_msgSuccess[test];
+ else return i18n("Passed");
+}
+
+QString ConfigTest::failureMessage(const QString &test)
+{
+ if ( s_msgFailure.contains(test) ) return s_msgFailure[test];
+ else return i18n("Failed");
+}
+
+QString ConfigTest::criticalMessage(const QString &test)
+{
+ if ( s_msgCritical.contains(test) ) return s_msgCritical[test];
+ else return i18n("Critical failure");
+}
+
+Tester::Tester(QObject *parent, const char *name) : QObject(parent, name), m_process(0L)
+{
+ ConfigTest::addPrettyName("binary", i18n("Binary"));
+ ConfigTest::addCriticalMessage("binary", i18n("Could not find the binary for this essential tool."));
+
+ ConfigTest::addPrettyName("basic", i18n("Simple Test"));
+ ConfigTest::addCriticalMessage("basic", i18n("This essential tool does not work at all, check your installation."));
+
+ ConfigTest::addPrettyName("version", i18n("Version"));
+
+ ConfigTest::addPrettyName("kile", i18n("Running in Kile"));
+ QString str = i18n("Kile is not configured correctly. Go to Settings->Configure Kile->Tools and either fix the problem or change to the default settings.");
+ ConfigTest::addCriticalMessage("kile", str);
+ ConfigTest::addFailureMessage("kile", str);
+
+ ConfigTest::addPrettyName("src", i18n("Source Specials Switch"));
+ ConfigTest::addSuccessMessage("src", i18n("Supported, use the 'Modern' configuration for (La)TeX and PDF(La)TeX to auto-enable inverse and forward search capabilities."));
+ ConfigTest::addFailureMessage("src", i18n("Not supported, use the srcltx package to enable the inverse and forward search capabilities."));
+
+ // add some special messages, when programs are not installed,
+ // which are not needed, but probably useful for the work with kile
+ ConfigTest::addFailureMessage("dvipng", i18n("You can't use the png preview for mathgroups in the bottom bar."));
+ ConfigTest::addFailureMessage("convert", i18n("You can't use the png previews with conversions 'dvi->ps->png' and 'pdf->png'."));
+ ConfigTest::addFailureMessage("acroread", i18n("You can't open pdf documents with Acrobat Reader. But you could use KPDF or KGhostView."));
+}
+
+
+Tester::~Tester()
+{
+ if (m_tempDir) m_tempDir->unlink();
+ delete m_tempDir;
+ delete m_process;
+}
+
+void Tester::saveResults(const KURL & dest)
+{
+ KIO::NetAccess::file_copy(KURL::fromPathOrURL(m_resultsFile), dest, -1, true);
+}
+
+void Tester::runTests()
+{
+ QString srcdir = KGlobal::dirs()->findResourceDir("appdata","test/runTests.sh") + "test";
+ KILE_DEBUG() << "Tester::runTests: srcdir = " << srcdir << endl;
+ m_tempDir = new KTempDir();
+ QString destdir = m_tempDir->name();
+ KILE_DEBUG() << "Tester::runTests: destdir = " << destdir << endl;
+ m_resultsFile = destdir + "results.rc";
+
+ QString shellname = KGlobal::dirs()->findExe("sh");
+ KILE_DEBUG() << "Tester::runTests: shellname = " << shellname << endl;
+ m_process = new KShellProcess(QFile::encodeName( shellname ));
+ if (! KileConfig::teXPaths().isEmpty())
+ {
+ m_process->setEnvironment("TEXINPUTS", KileInfo::expandEnvironmentVars( KileConfig::teXPaths() + ":$TEXINPUTS"));
+ }
+ *m_process << "cd " + KShellProcess::quote(destdir) + " && ";
+ *m_process << "cp " + KShellProcess::quote(srcdir) +"/* " + KShellProcess::quote(destdir) + " && ";
+ *m_process << "source runTests.sh " + KShellProcess::quote(m_resultsFile) + " " + KShellProcess::quote(destdir);
+ connect(m_process, SIGNAL(receivedStdout(KProcess *, char *, int)), this, SLOT(determineProgress(KProcess *, char *, int)));
+ connect(m_process, SIGNAL(processExited(KProcess *)), this, SLOT(processTestResults(KProcess *)));
+ if (m_process->start(KProcess::NotifyOnExit, KProcess::AllOutput)) emit(started());
+}
+
+void Tester::stop()
+{
+ if (m_process) m_process->kill();
+}
+
+void Tester::determineProgress(KProcess */*proc*/, char *buf, int len)
+{
+ static QString s = QString::null;
+
+ s += QString::fromLocal8Bit(buf, len);
+ if ( s.endsWith("\n") )
+ {
+ bool ok = false;
+ int number = s.toInt(&ok);
+ if (ok) emit(percentageDone(number));
+ s = QString::null;
+ }
+}
+
+void Tester::processTestResults (KProcess *proc)
+{
+ if (proc->normalExit())
+ {
+ emit(percentageDone(100));
+
+ KSimpleConfig config(m_resultsFile, true);
+ QStringList groups = config.groupList();
+ QStringList::Iterator itend = groups.end();
+ for ( QStringList::Iterator it = groups.begin(); it != itend; ++it )
+ processTool(&config, *it);
+
+ emit(finished(true));
+ }
+ else
+ {
+ emit(percentageDone(0));
+ emit(finished(false));
+ }
+}
+
+void Tester::processTool(KConfig *config, const QString &tool)
+{
+ config->setGroup(tool);
+
+ QStringList criticaltests = QStringList::split(",", config->readEntry("mustpass", ""));
+
+ //Did we find the executable?
+ QValueList<ConfigTest> tests;
+ tests << ConfigTest("binary", criticaltests.contains("where"), config->readEntry("where"), config->readEntry("executable"));
+ if (config->hasKey("version") ) tests << ConfigTest("version", criticaltests.contains("version"), config->readEntry("version"));
+ if (config->hasKey("basic") ) tests << ConfigTest("basic", criticaltests.contains("basic"), config->readEntry("basic"));
+ if (config->hasKey("src") ) tests << ConfigTest("src", criticaltests.contains("src"), config->readEntry("src"));
+ if (config->hasKey("kile") ) tests << ConfigTest("kile", criticaltests.contains("kile"), config->readEntry("kile"));
+
+ addResult(tool, tests);
+}
+
+void Tester::addResult(const QString &tool, const QValueList<ConfigTest> &tests)
+{
+ m_results [tool] = tests;
+}
+
+QStringList Tester::testedTools()
+{
+ return m_results.keys();
+}
+
+QValueList<ConfigTest> Tester::resultForTool(const QString & tool)
+{
+ return m_results[tool];
+}
+
+int Tester::statusForTool(const QString & tool)
+{
+ QValueList<ConfigTest> tests = m_results[tool];
+ int status = ConfigTest::Success;
+ for ( uint i = 0; i < tests.count(); ++i)
+ {
+ if ( (tests[i].status() == ConfigTest::Failure) && (status == ConfigTest::Success)) status = ConfigTest::Failure;
+ if (tests[i].status() == ConfigTest::Critical) status = ConfigTest::Critical;
+ }
+ return status;
+}
+
+#include "configtester.moc"
diff --git a/src/kile/configtester.h b/src/kile/configtester.h
new file mode 100644
index 0000000..c330a25
--- /dev/null
+++ b/src/kile/configtester.h
@@ -0,0 +1,98 @@
+/***************************************************************************
+ begin : Fri Jun 4 2004
+ copyright : (C) 2004 by Jeroen Wijnout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CONFIGCHECKER_H
+#define CONFIGCHECKER_H
+
+#include <qobject.h>
+
+class KTempDir;
+class KConfig;
+class KProcess;
+class KURL;
+
+/**
+@author Jeroen Wijnhout
+*/
+
+class ConfigTest
+{
+ public:
+ enum Status { Success = 3, Failure = 2, Critical = 1 };
+
+ ConfigTest();
+ ConfigTest(const QString &name, bool mustpass, const QString &arg, const QString &altarg = QString::null);
+
+ int status() const;
+
+ QString resultText() const;
+ QString name() const;
+
+ private:
+ QString m_name, m_arg, m_altArg;
+ bool m_mustPass;
+
+ public:
+ static void addPrettyName(const QString &test, const QString &prettyName);
+ static void addSuccessMessage(const QString &test, const QString &msg);
+ static void addFailureMessage(const QString &test, const QString &msg);
+ static void addCriticalMessage(const QString &test, const QString &msg);
+
+ static QString prettyName(const QString &test);
+ static QString successMessage(const QString &test);
+ static QString failureMessage(const QString &test);
+ static QString criticalMessage(const QString &test);
+
+ private:
+ static QMap<QString,QString> s_prettyName, s_msgSuccess, s_msgFailure, s_msgCritical;
+};
+
+class Tester : public QObject
+{
+ Q_OBJECT
+
+public:
+ Tester(QObject *parent = 0, const char *name = 0);
+ ~Tester();
+
+ QStringList testedTools();
+ QValueList<ConfigTest> resultForTool(const QString &);
+ int statusForTool(const QString &);
+
+public slots:
+ void runTests();
+ void saveResults(const KURL &);
+ void stop();
+
+signals:
+ void started();
+ void percentageDone(int);
+ void finished(bool);
+
+private slots:
+ void determineProgress(KProcess *, char *, int);
+ void processTestResults (KProcess *);
+ void processTool(KConfig *, const QString &);
+
+ void addResult(const QString &tool, const QValueList<ConfigTest> &tests);
+
+private:
+ QMap<QString,QValueList<ConfigTest> > m_results;
+ QString m_resultsFile;
+ KTempDir *m_tempDir;
+ KProcess *m_process;
+};
+
+#endif
diff --git a/src/kile/convert.cpp b/src/kile/convert.cpp
new file mode 100644
index 0000000..e5c1f5d
--- /dev/null
+++ b/src/kile/convert.cpp
@@ -0,0 +1,326 @@
+/***************************************************************************
+ begin : Sun Feb 29 2004
+ copyright : (C) 2004 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "convert.h"
+
+#include <qregexp.h>
+#include <qtextcodec.h>
+#include <qfile.h>
+
+#include <kmessagebox.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include "kiledebug.h"
+#include <kate/document.h>
+
+QMap<QString, ConvertMap*> ConvertMap::g_maps;
+
+bool ConvertMap::create(const QString & encoding)
+{
+ KILE_DEBUG() << "\tlooking for map for " << encoding << endl;
+ ConvertMap * map = g_maps[encoding];
+
+ if ( map == 0 )
+ {
+ KILE_DEBUG() << "\tcreating a map for " << encoding << endl;
+ map = new ConvertMap(encoding); // FIXME This will never be deleted if load() succeeds...
+ if ( map->load() )
+ g_maps[encoding] = map;
+ else {
+ delete map;
+ map = 0L;
+ }
+
+ map = g_maps[encoding];
+ }
+
+ return ( map != 0L );
+}
+
+QString ConvertMap::encodingNameFor(const QString & name)
+{
+ QString std;
+ for ( uint i = 0; i < name.length(); ++i )
+ if ( !name[i].isSpace() )
+ std += name[i];
+
+ std = std.lower();
+
+ if ( std.startsWith("iso8859-") )
+ return "latin" + std.right(1);
+
+ if ( std.startsWith("cp") )
+ return "cp" + std.right(4);
+
+ return name;
+}
+
+QString ConvertMap::isoNameFor(const QString & name)
+{
+ QString std;
+ for ( uint i = 0; i < name.length(); ++i )
+ if ( !name[i].isSpace() )
+ std += name[i];
+
+ std = std.lower();
+
+ if ( std.startsWith("latin") )
+ return "ISO 8859-" + std.right(1);
+
+ if ( std.startsWith("cp" ) )
+ return "cp " + std.right(4);
+
+ return name;
+}
+
+ConvertMap::ConvertMap(const QString & enc )
+{
+ m_aliases.append(encodingNameFor(enc));
+ m_aliases.append(isoNameFor(enc));
+}
+
+void ConvertMap::addPair(QChar c, const QString & enc)
+{
+ m_toASCII[c] = commandIsTerminated(enc) ? enc : enc + "{}" ;
+ m_toEncoding[enc] = c;
+}
+
+bool ConvertMap::commandIsTerminated(const QString & command)
+{
+ static QRegExp reCommandSequences("\\\\([a-zA-Z]+|\\\"|\\')$");
+
+ return (reCommandSequences.search(command) == -1);
+}
+
+bool ConvertMap::load()
+{
+ static QRegExp reMap("^(.*):(.*)");
+
+ //makeMap(encoding());
+
+ //if map already exists, replace it
+ QFile qf(KGlobal::dirs()->findResource("appdata","encodings/" + encoding() + ".enc"));
+
+ if ( qf.open(IO_ReadOnly) )
+ {
+ QTextStream stream( &qf );
+ QTextCodec *codec = QTextCodec::codecForName(isoName().ascii());
+ if ( codec ) stream.setCodec(codec);
+
+ while ( !stream.atEnd() )
+ {
+ //parse the line
+ if ( stream.readLine().find(reMap) != -1)
+ addPair(reMap.cap(1)[0], reMap.cap(2));
+ }
+ qf.close();
+
+ return true;
+ }
+
+ return false;
+}
+
+//BEGIN ConvertIO classes
+ConvertIO::ConvertIO(Kate::Document *doc) :
+ m_doc(doc),
+ m_text(QString::null),
+ m_line(QString::null),
+ m_nLine(0)
+{
+}
+
+QString & ConvertIO::currentLine()
+{
+ return m_line;
+}
+
+void ConvertIO::nextLine()
+{
+ m_line = m_doc->textLine(m_nLine++);
+}
+
+void ConvertIO::writeText()
+{
+ m_doc->setText(m_text);
+}
+
+uint ConvertIO::current()
+{
+ return m_nLine;
+}
+
+bool ConvertIO::done()
+{
+ return current() == m_doc->numLines();
+}
+
+ConvertIOFile::ConvertIOFile(Kate::Document *doc, const KURL & url) : ConvertIO(doc), m_url(url)
+{
+}
+
+void ConvertIOFile::writeText()
+{
+ QFile qf(m_url.path());
+ if ( qf.open(IO_WriteOnly) )
+ {
+ //read the file
+ QTextStream stream( &qf );
+ stream << m_text;
+ qf.close();
+ }
+ else
+ kdWarning() << "Could not open " << m_url.path() << endl;
+}
+
+ConvertBase::ConvertBase(const QString & encoding, ConvertIO * io) :
+ m_io(io),
+ m_encoding(encoding),
+ m_map(0L)
+{
+}
+
+//END ConvertIO classes
+
+//BEGIN ConvertBase
+QString ConvertBase::mapNext(uint &i)
+{
+ return (QString)m_io->currentLine()[i++];
+}
+
+bool ConvertBase::convert()
+{
+ if ( ! setMap() ) return false;
+
+ m_io->text() = QString::null;
+ do
+ {
+ m_io->nextLine();
+ uint i = 0;
+ while ( i < m_io->currentLine().length() )
+ {
+ m_io->text() += mapNext(i);
+ }
+ if ( ! m_io->done() ) m_io->text() += '\n';
+ }
+ while ( ! m_io->done() );
+
+ m_io->writeText();
+ return true;
+}
+
+bool ConvertBase::setMap()
+{
+ //create map (or use existing)
+ if (ConvertMap::create(m_encoding))
+ m_map = ConvertMap::mapFor(m_encoding);
+ else
+ m_map = 0L;
+
+ return ( m_map != 0L );
+}
+//END ConvertBase
+
+//BEGIN ConvertEncToASCII
+QString ConvertEncToASCII::mapNext(uint &i)
+{
+ return m_map->canDecode(m_io->currentLine()[i]) ? m_map->toASCII(m_io->currentLine()[i++]) : (QString)m_io->currentLine()[i++];
+}
+//END ConvertEncToASCII
+
+//BEGIN ConvertASCIIToEnc
+
+//i is the position of the '\'
+QString ConvertASCIIToEnc::nextSequence(uint &i)
+{
+ //get first two characters
+ QString seq = (QString)m_io->currentLine()[i++];
+
+ if ( m_io->currentLine()[i].isLetter() )
+ {
+ while ( m_io->currentLine()[i].isLetter() )
+ seq += (QString)m_io->currentLine()[i++];
+ }
+ else
+ return seq + (QString)m_io->currentLine()[i++];
+
+ return seq;
+}
+
+bool ConvertASCIIToEnc::isModifier(const QString & seq)
+{
+ static QRegExp reModifier("\\\\([cHkruv]|\"|\'|\\^|`|~|=|\\.)");
+ return reModifier.exactMatch(seq);
+}
+
+QString ConvertASCIIToEnc::getSequence(uint &i)
+{
+ QString seq = nextSequence(i);
+ static QRegExp reBraces("\\{([a-zA-Z]?)\\}");
+
+ if ( isModifier(seq) )
+ {
+ KILE_DEBUG() << "\tisModifier true : " << seq << endl;
+ if ( seq[seq.length() - 1].isLetter() ) seq += ' ';
+
+ while ( m_io->currentLine()[i].isSpace() ) i++;
+
+ if ( m_io->currentLine().mid(i,2) == "{}" ) i = i + 2;
+
+ if ( m_io->currentLine()[i] == '\\' )
+ seq += nextSequence(i);
+ else
+ {
+ if ( reBraces.exactMatch(m_io->currentLine().mid(i,3)) )
+ {
+ KILE_DEBUG() << "\tbraces detected" << endl;
+ i = i + 3;
+ seq += reBraces.cap(1);
+ }
+ else
+ {
+ QChar nextChar = m_io->currentLine()[i++];
+ if ( !nextChar.isSpace() ) seq += (QString)nextChar;
+ }
+ }
+ }
+ else if ( m_map->canEncode(seq) )
+ {
+ if ( m_io->currentLine().mid(i,2) == "{}" ) i = i + 2;
+ else if ( m_io->currentLine()[i].isSpace() ) ++i;
+ }
+
+ return seq;
+}
+
+QString ConvertASCIIToEnc::mapNext(uint &i)
+{
+ if ( m_io->currentLine()[i] == '\\' )
+ {
+ QString seq = getSequence(i);
+ KILE_DEBUG() << "'\tsequence: " << seq << endl;
+ if ( m_map->canEncode(seq) )
+ {
+ KILE_DEBUG() << "\tcan encode this" << endl;
+ //if ( m_io->currentLine().mid(i, 2) == "{}" ) i = i + 2;
+ return m_map->toEncoding(seq);
+ }
+ else
+ return seq;
+ }
+
+ return ConvertBase::mapNext(i);
+}
+//END ConvertASCIIToEnc
diff --git a/src/kile/convert.h b/src/kile/convert.h
new file mode 100644
index 0000000..651d330
--- /dev/null
+++ b/src/kile/convert.h
@@ -0,0 +1,135 @@
+/***************************************************************************
+ begin : Sun Feb 29 2004
+ copyright : (C) 2004 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CONVERT_H
+#define CONVERT_H
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qmap.h>
+
+#include <kurl.h>
+
+namespace Kate { class Document; }
+
+class ConvertMap
+{
+protected:
+ ConvertMap(const QString & encoding);
+
+public:
+ const QString & encoding() const { return m_aliases[0]; }
+ const QString & isoName() const { return m_aliases[1]; }
+
+ QChar toEncoding(const QString & enc) { return m_toEncoding[enc]; }
+ QString toASCII(const QChar & c) { return m_toASCII[c]; }
+
+ void addPair(QChar c, const QString & enc);
+
+ bool canDecode(const QChar & c) { return ( m_toASCII.contains(c) > 0 ); }
+ bool canEncode(const QString & enc) { return ( m_toEncoding.contains(enc) > 0 ); }
+
+ bool load();
+
+private:
+ bool commandIsTerminated(const QString &);
+
+private:
+ QStringList m_aliases;
+ QMap<QChar, QString> m_toASCII;
+ QMap<QString, QChar> m_toEncoding;
+
+//static members
+public:
+ static bool create(const QString & encoding);
+ static QString encodingNameFor(const QString &);
+ static QString isoNameFor(const QString &);
+ static ConvertMap * mapFor(const QString & enc) { return g_maps[enc]; }
+
+private:
+ static QMap<QString, ConvertMap*> g_maps;
+};
+
+class ConvertIO
+{
+public:
+ ConvertIO(Kate::Document *doc);
+ virtual ~ConvertIO() {}
+
+ virtual void nextLine(); //read next line
+ virtual QString & currentLine();
+ virtual QString & text() { return m_text; }
+ virtual void writeText();
+ virtual uint current(); //current line number
+ virtual bool done();
+
+protected:
+ Kate::Document *m_doc;
+ QString m_text, m_line;
+ uint m_nLine;
+};
+
+class ConvertIOFile : public ConvertIO
+{
+public:
+ ConvertIOFile(Kate::Document *doc, const KURL & url);
+
+ void writeText();
+
+private:
+ KURL m_url;
+};
+
+class ConvertBase
+{
+public:
+ ConvertBase(const QString & encoding, ConvertIO * io);
+ virtual ~ConvertBase() {};
+
+public:
+ virtual bool convert();
+
+protected:
+ virtual bool setMap();
+
+ virtual QString mapNext(uint &);
+
+ ConvertIO *m_io;
+ QString m_encoding;
+ ConvertMap *m_map;
+};
+
+class ConvertEncToASCII : public ConvertBase
+{
+public:
+ ConvertEncToASCII(const QString & encoding, ConvertIO * io) : ConvertBase(encoding, io) {}
+
+protected:
+ QString mapNext(uint &);
+};
+
+class ConvertASCIIToEnc : public ConvertBase
+{
+public:
+ ConvertASCIIToEnc(const QString & encoding, ConvertIO * io) : ConvertBase(encoding, io) {}
+
+protected:
+ QString getSequence(uint &);
+ QString nextSequence(uint &);
+ bool isModifier(const QString &);
+ QString mapNext(uint &);
+};
+
+#endif
diff --git a/src/kile/create_hash_table b/src/kile/create_hash_table
new file mode 100644
index 0000000..a7df5ed
--- /dev/null
+++ b/src/kile/create_hash_table
@@ -0,0 +1,203 @@
+#! /usr/bin/perl -w
+#
+# Static Hashtable Generator
+#
+# (c) 2000-2002 by Harri Porten <porten@kde.org> and
+# David Faure <faure@kde.org>
+
+$file = $ARGV[0];
+shift;
+my $findSize = 0;
+my $includelookup = 0;
+# Use -s as second argument to make it try many hash sizes
+$findSize = 1 if (defined($ARGV[0]) && $ARGV[0] eq "-s");
+# Use -i as second argument to make it include "lookup.h"
+$includelookup = 1 if (defined($ARGV[0]) && $ARGV[0] eq "-i");
+print STDERR "Creating hashtable for $file\n";
+open(IN, $file) or die "No such file $file";
+
+@keys = ();
+@values = ();
+@attrs = ();
+@params = ();
+
+my $inside = 0;
+my $name;
+my $size;
+my $hashsize;
+my $banner = 0;
+my $namespace = "KJS";
+
+sub calcTable();
+sub output();
+sub hashValue($);
+
+while (<IN>) {
+ chop;
+ s/^\s*//g;
+ if (/^\#|^$/) {
+ # comment. do nothing
+ } elsif (/^\@namespace\s+(\w+)/ && !$inside) {
+ $namespace = $1;
+ } elsif (/^\@begin/ && !$inside) {
+ if (/^\@begin\s*([:_\w]+)\s*(\d+)\s*$/) {
+ $inside = 1;
+ $name = $1;
+ $hashsize = $2;
+ } else {
+ printf STDERR "WARNING: \@begin without table name and hashsize, skipping $_\n";
+ }
+ } elsif (/^\@end\s*$/ && $inside) {
+
+ if($findSize) {
+ my $entriesnum=@keys;
+ print STDERR "Table: $name $entriesnum entries\n";
+ for( $i=3 ; $i<79 ; ++$i) { $hashsize=$i ; calcTable(); }
+ } else {
+ calcTable();
+ }
+
+ output();
+ @keys = ();
+ @values = ();
+ @attrs = ();
+ @params = ();
+ $inside = 0;
+ } elsif (/^([-:\@\w\[\=\]]+)\s*([\w\:-]+)\s*([\w\|]*)\s*(\w*)\s*$/ && $inside) {
+ my $key = $1;
+ my $val = $2;
+ my $att = $3;
+ my $param = $4;
+ push(@keys, $key);
+ push(@values, $val);
+ printf STDERR "WARNING: Number of arguments missing for $key/$val\n"
+ if ( $att =~ m/Function/ && length($param) == 0);
+ push(@attrs, length($att) > 0 ? $att : "0");
+ push(@params, length($param) > 0 ? $param : "0");
+ } elsif ($inside) {
+ die "invalid data";
+ }
+}
+
+die "missing closing \@end" if ($inside);
+
+sub calcTable() {
+ @table = ();
+ @links = ();
+ $size = $hashsize;
+ my $collisions = 0;
+ my $maxdepth = 0;
+ my $i = 0;
+ foreach $key (@keys) {
+ my $depth = 0;
+ my $h = hashValue($key) % $hashsize;
+ while (defined($table[$h])) {
+ if (defined($links[$h])) {
+ $h = $links[$h];
+ $depth++;
+ } else {
+ $collisions++;
+ $links[$h] = $size;
+ $h = $size;
+ $size++;
+ }
+ }
+ #print STDERR "table[$h] = $i\n";
+ $table[$h] = $i;
+ $i++;
+ $maxdepth = $depth if ( $depth > $maxdepth);
+ }
+
+ # Ensure table is big enough (in case of undef entries at the end)
+ if ( $#table+1 < $size ) {
+ $#table = $size-1;
+ }
+ #print STDERR "After loop: size=$size table=".($#table+1)."\n";
+
+ if ($findSize) {
+ my $emptycount = 0;
+ foreach $entry (@table) {
+ $emptycount++ if (!defined($entry));
+ }
+ print STDERR "Hashsize: $hashsize Total Size: $size Empty: $emptycount MaxDepth: $maxdepth Collisions: $collisions\n";
+ }
+# my $debugtable = 0;
+# foreach $entry (@table) {
+# print STDERR "$debugtable " . (defined $entry ? $entry : '<undefined>');
+# print STDERR " -> " . $links[$debugtable] if (defined($links[$debugtable]));
+# print STDERR "\n";
+# $debugtable++;
+# }
+}
+
+sub hashValue($) {
+ @chars = split(/ */, $_[0]);
+ my $val = 0;
+ foreach $c (@chars) {
+ $val += ord($c);
+ }
+ return $val;
+}
+
+sub output() {
+ if (!$banner) {
+ $banner = 1;
+ print "/* Automatically generated from $file using $0. DO NOT EDIT ! */\n";
+ }
+
+ my $nameEntries = "${name}Entries";
+ $nameEntries =~ s/:/_/g;
+ my $nameStringTable = "${name}Strings";
+ $nameStringTable =~ y/:/_/;
+
+ print "\n#include \"lookup.h\"\n" if ($includelookup);
+ print "\nusing namespace KJS;\n"; # because of DontDelete etc.
+ print "\nnamespace $namespace {\n";
+
+ # first, build the string table
+ my %soffset = ();
+ print "\nstatic const char $nameStringTable\[\] = {\n";
+ my $s = "\0";
+ print " \"\\0\"\n";
+ for my $k (sort { length $b <=> length $a || $a cmp $b } @keys) {
+ if ($s =~ /^(.*)\Q$k\E\0/) {
+ $soffset{$k} = length $1;
+ } else {
+ $soffset{$k} = length $s;
+ print " \"$k\\0\"\n";
+ $s .= $k;
+ $s .= "\0";
+ }
+ }
+ print "};\n\n";
+
+ # now, dump the hash table
+
+ print "\nstatic const struct HashEntry ".$nameEntries."[] = {\n";
+ my $i = 0;
+ #print STDERR "writing out table with ".($#table+1)." entries\n";
+ foreach $entry (@table) {
+ if (defined($entry)) {
+ my $key = $keys[$entry];
+ print " \{ " . $soffset{$key};
+ print ", " . $values[$entry];
+ print ", " . $attrs[$entry];
+ print ", " . $params[$entry];
+ print ", ";
+ if (defined($links[$i])) {
+ print $links[$i] . " \}";
+ } else {
+ print "-1 \}"
+ }
+ } else {
+ print " \{ 0, 0, 0, 0, -1 \}";
+ }
+ print "," unless ($i == $size - 1);
+ print "\n";
+ $i++;
+ }
+ print "};\n\n";
+ print "const struct HashTable $name = ";
+ print "\{ 2, $size, ".$nameEntries.", $hashsize, ".$nameStringTable."\};\n\n";
+ print "} // namespace\n";
+}
diff --git a/src/kile/docpart.cpp b/src/kile/docpart.cpp
new file mode 100644
index 0000000..c11b5d2
--- /dev/null
+++ b/src/kile/docpart.cpp
@@ -0,0 +1,124 @@
+/***************************************************************************
+ begin : Sun Jul 29 2001
+ copyright : (C) 2001 - 2003 by Brachet Pascal, (C) 2004 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "docpart.h"
+
+#include <kconfig.h>
+#include <kstdaction.h>
+#include <kglobal.h>
+#include "kiledebug.h"
+#include <kstandarddirs.h>
+#include <kmimemagic.h>
+#include <kmimetype.h>
+#include <ktrader.h>
+#include <krun.h>
+#include <khtml_part.h>
+#include <khtml_settings.h>
+
+DocumentationViewer::DocumentationViewer(QWidget *parent, const char *name ) : KHTMLPart(parent,name, 0, 0, BrowserViewGUI)
+{
+ m_hpos = 0;
+ KConfig konqConfig("konquerorrc");
+ konqConfig.setGroup("HTML Settings");
+ //const KHTMLSettings * set = settings();
+ //( const_cast<KHTMLSettings *>(set) )->init( &konqConfig, false );
+ QString rc = KGlobal::dirs()->findResource("appdata", "docpartui.rc");
+ setXMLFile(rc);
+ (void) KStdAction::back(this, SLOT(back()), actionCollection(),"Back" );
+ (void) KStdAction::forward(this, SLOT(forward()), actionCollection(),"Forward" );
+ (void) KStdAction::home(this, SLOT(home()), actionCollection(),"Home" );
+}
+
+DocumentationViewer::~DocumentationViewer() {}
+
+void DocumentationViewer::urlSelected(const QString &url, int button, int state,const QString & target, KParts::URLArgs args)
+{
+ KURL cURL = completeURL(url);
+ QString mime = KMimeType::findByURL(cURL).data()->name();
+
+ //load this URL in the embedded viewer if KHTML can handle it, or when mimetype detection failed
+ KService::Ptr service = KService::serviceByDesktopName("khtml");
+ if ( ( mime == KMimeType::defaultMimeType() ) || (service && service->hasServiceType(mime)) )
+ {
+ KHTMLPart::urlSelected(url, button, state, target, args);
+ openURL(cURL) ;
+ addToHistory(cURL.url());
+ }
+ //KHTML can't handle it, look for an appropriate application
+ else
+ {
+ KTrader::OfferList offers = KTrader::self()->query(mime, "Type == 'Application'");
+ KService::Ptr ptr = offers.first();
+ KURL::List lst;
+ lst.append(cURL);
+ if (ptr) KRun::run(*ptr, lst);
+ }
+}
+
+void DocumentationViewer::home()
+{
+ if ( !m_history.isEmpty() ) openURL( KURL(m_history.first()) );
+}
+
+void DocumentationViewer::forward()
+{
+ if ( forwardEnable() )
+ {
+ ++m_hpos;
+ openURL( KURL( m_history[m_hpos]) );
+ emit updateStatus( backEnable() , forwardEnable() );
+ }
+}
+
+
+void DocumentationViewer::back()
+{
+ if ( backEnable() ) {
+ --m_hpos;
+ openURL( KURL(m_history[m_hpos]) );
+ emit updateStatus( backEnable() , forwardEnable() );
+ }
+}
+
+
+void DocumentationViewer::addToHistory( const QString & url )
+{
+ if ( m_history.count() > 0 )
+ {
+ while ( m_hpos < m_history.count()-1 )
+ m_history.pop_back();
+ }
+
+ if ( !m_history.isEmpty() ) ++m_hpos;
+
+ m_history.append(url);
+
+ m_hpos = m_history.count()-1;
+ emit updateStatus( backEnable() , forwardEnable() );
+}
+
+
+bool DocumentationViewer::backEnable()
+{
+ return m_hpos > 0;
+}
+
+
+bool DocumentationViewer::forwardEnable()
+{
+ return m_hpos < m_history.count()-1;
+}
+
+#include "docpart.moc"
diff --git a/src/kile/docpart.h b/src/kile/docpart.h
new file mode 100644
index 0000000..b031934
--- /dev/null
+++ b/src/kile/docpart.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ begin : Sun Jul 29 2001
+ copyright : (C) 2001 - 2003 by Brachet Pascal, 2003 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef DOCPART_H
+#define DOCPART_H
+
+#include <khtml_part.h>
+#include <qstringlist.h>
+
+class DocumentationViewer : public KHTMLPart
+{
+ Q_OBJECT
+
+public:
+ DocumentationViewer(QWidget *parent=0, const char *name=0);
+ ~DocumentationViewer();
+ bool backEnable();
+ bool forwardEnable();
+
+public slots:
+ void home();
+ void forward();
+ void back();
+ void addToHistory( const QString & url );
+
+signals:
+ void updateStatus( bool back, bool forward );
+
+protected:
+ virtual void urlSelected( const QString &url, int button=0, int state=0,const QString &_target= QString::null, KParts::URLArgs args = KParts::URLArgs());
+
+private:
+ QStringList m_history;
+ unsigned int m_hpos;
+
+};
+
+#endif
diff --git a/src/kile/docpartui.rc b/src/kile/docpartui.rc
new file mode 100644
index 0000000..d440645
--- /dev/null
+++ b/src/kile/docpartui.rc
@@ -0,0 +1,14 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="docpart" version="1">
+ <ToolBar name="extraToolBar"><text>Extra</text>
+ <Action name="Back"/>
+ <Action name="Forward"/>
+ <Action name="Home"/>
+ <Separator lineSeparator="true"/>
+ <Action name="find" />
+ <Separator lineSeparator="true"/>
+ <Action name="incFontSizes" />
+ <Action name="decFontSizes" />
+ </ToolBar>
+</kpartgui>
+
diff --git a/src/kile/editorkeysequencemanager.cpp b/src/kile/editorkeysequencemanager.cpp
new file mode 100644
index 0000000..9d6ab40
--- /dev/null
+++ b/src/kile/editorkeysequencemanager.cpp
@@ -0,0 +1,231 @@
+/**************************************************************************
+* Copyright (C) 2006 by Michel Ludwig (michel.ludwig@kdemail.net) *
+***************************************************************************/
+
+/**************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "editorkeysequencemanager.h"
+
+#include "kileinfo.h"
+#include "kilejscript.h"
+
+#include <kate/document.h>
+#include <klocale.h>
+
+#define MAX(a,b) (a >= b ? a : b)
+
+namespace KileEditorKeySequence {
+
+ Manager::Manager(KileInfo* kileInfo, QObject *parent, const char *name) : QObject(parent, name), m_kileInfo(kileInfo) {
+ }
+
+ Manager::~Manager() {
+ }
+
+ void Manager::addAction(const QString& seq, Action *action) {
+ if(seq.isEmpty()) {
+ return;
+ }
+ if(m_actionMap.find(seq) == m_actionMap.end()) {
+ m_actionMap[seq] = action;
+ m_watchedKeySequencesList.push_back(seq);
+ emit watchedKeySequencesChanged();
+ }
+ }
+
+
+ void Manager::removeKeySequence(const QString& seq) {
+ if(seq.isEmpty()) {
+ return;
+ }
+ QMap<QString, Action*>::iterator it = m_actionMap.find(seq);
+ if(it != m_actionMap.end()) {
+ delete (it.data());
+ m_actionMap.remove(it);
+ m_watchedKeySequencesList.remove(seq);
+ emit watchedKeySequencesChanged();
+ }
+ }
+
+ void Manager::removeKeySequence(const QStringList& l) {
+ bool changed = false;
+ for(QStringList::const_iterator i = l.begin(); i != l.end(); ++i) {
+ if((*i).isEmpty()) {
+ continue;
+ }
+ QMap<QString, Action*>::iterator it = m_actionMap.find(*i);
+ if(it != m_actionMap.end()) {
+ delete (it.data());
+ m_actionMap.remove(it);
+ m_watchedKeySequencesList.remove(*i);
+ changed = true;
+ }
+ }
+ if(changed) {
+ emit watchedKeySequencesChanged();
+ }
+ }
+
+ void Manager::addActionMap(const QMap<QString, Action*>& map) {
+ bool changed = false;
+ for(QMap<QString, Action*>::const_iterator i = map.begin(); i != map.end(); ++i) {
+ if(i.key().isEmpty()) {
+ continue;
+ }
+ if(m_actionMap[i.key()] != i.data()) {
+ m_actionMap[i.key()] = i.data();
+ changed = true;
+ }
+ }
+ if(changed) {
+ emit watchedKeySequencesChanged();
+ }
+ }
+
+ QString Manager::getKeySequence(const Action* a) {
+ for(QMap<QString, Action*>::const_iterator i = m_actionMap.begin(); i != m_actionMap.end(); ++i) {
+ if(i.data() == a) {
+ return i.key();
+ }
+ }
+ return QString();
+ }
+
+ Action* Manager::getAction(const QString& seq) {
+ QMap<QString, Action*>::iterator i = m_actionMap.find(seq);
+ return (i == m_actionMap.end()) ? 0L : (*i);
+ }
+
+ void Manager::setEditorKeySequence(const QString& /* seq */, Action* /* action */) {
+ }
+
+ void Manager::keySequenceTyped(const QString& seq) {
+ m_actionMap[seq]->execute();
+ }
+
+ void Manager::clear() {
+ m_watchedKeySequencesList.clear();
+ m_actionMap.clear();
+ emit watchedKeySequencesChanged();
+ }
+
+
+ const QStringList& Manager::getWatchedKeySequences() {
+ return m_watchedKeySequencesList;
+ }
+
+ bool Manager::isSequenceAssigned(const QString& seq) const {
+ for(QValueList<QString>::const_iterator i = m_watchedKeySequencesList.begin(); i != m_watchedKeySequencesList.end(); ++i) {
+ if((*i).startsWith(seq)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ QPair<int, QString> Manager::checkSequence(const QString& seq, const QString& skip) {
+ for(QValueList<QString>::iterator i = m_watchedKeySequencesList.begin(); i != m_watchedKeySequencesList.end(); ++i) {
+ if((*i) == skip) {
+ continue;
+ }
+ if((*i).startsWith(seq)) {
+ return (*i == seq) ? qMakePair<int, QString>(1, seq) : qMakePair<int, QString>(2, *i);
+ }
+ if(!(*i).isEmpty() && seq.startsWith(*i)) {
+ return qMakePair<int, QString>(3, *i);
+ }
+ }
+ return qMakePair<int, QString>(0, QString());
+ }
+
+Recorder::Recorder(Kate::View *view, Manager *manager) : QObject(view), m_manager(manager), m_view(view) {
+ connect(m_manager, SIGNAL(watchedKeySequencesChanged()), this, SLOT(reloadWatchedKeySequences()));
+ connect(this, SIGNAL(detectedTypedKeySequence(const QString&)), m_manager, SLOT(keySequenceTyped(const QString&)));
+ m_view->cursorPositionReal(&m_oldLine, &m_oldCol);
+ reloadWatchedKeySequences();
+}
+
+Recorder::~Recorder() {
+}
+
+bool Recorder::eventFilter(QObject* /* o */, QEvent *e) {
+ if (e->type() == QEvent::KeyPress) {
+ QKeyEvent *keyEvent = (QKeyEvent*)(e);
+ uint curLine, curCol;
+ m_view->cursorPositionReal(&curLine, &curCol);
+ if(curLine != m_oldLine || m_oldCol+1 != curCol) {
+ m_typedSequence = QString();
+ m_oldLine = curLine;
+ m_oldCol = curCol;
+ }
+ else {
+ ++m_oldCol;
+ }
+ m_typedSequence += keyEvent->text();
+ if(m_typedSequence.length() == m_maxSequenceLength+1) {
+ m_typedSequence = m_typedSequence.mid(1, m_typedSequence.length() - 1);
+ }
+ return seekForKeySequence(m_typedSequence);
+ }
+ return false;
+}
+
+ bool Recorder::seekForKeySequence(const QString& s) {
+ for(uint i = 0; i < s.length(); ++i) {
+ QString toCheck = s.right(s.length() - i);
+ if(m_watchedKeySequencesList.contains(toCheck) > 0) {
+ m_view->getDoc()->removeText(m_oldLine, m_oldCol-(s.length() - i - 1), m_oldLine, m_oldCol);
+ m_typedSequence = QString::null; // clean m_typedSequence to avoid wrong action triggering if one presses keys without printable character
+ emit detectedTypedKeySequence(toCheck);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ void Recorder::reloadWatchedKeySequences() {
+ m_watchedKeySequencesList = m_manager->getWatchedKeySequences();
+ m_maxSequenceLength = 0;
+ for(QStringList::iterator i = m_watchedKeySequencesList.begin(); i != m_watchedKeySequencesList.end(); ++i) {
+ m_maxSequenceLength = MAX(m_maxSequenceLength, (*i).length());
+ }
+ if(m_maxSequenceLength < m_typedSequence.length()) {
+ m_typedSequence = m_typedSequence.right(m_maxSequenceLength);
+ }
+ }
+
+ Action::Action() {
+ }
+
+ Action::~Action() {
+ }
+
+ QString Action::getDescription() const {
+ return QString();
+ }
+
+ ExecuteJScriptAction::ExecuteJScriptAction(KileJScript::JScript *jScript, KileJScript::Manager *jScriptManager) : m_jScript(jScript), m_jScriptManager(jScriptManager){
+ }
+
+ ExecuteJScriptAction::~ExecuteJScriptAction() {
+ }
+
+ void ExecuteJScriptAction::execute() {
+ m_jScriptManager->executeJScript(m_jScript);
+ }
+
+ QString ExecuteJScriptAction::getDescription() const {
+ return i18n("Script execution of %1").arg(m_jScript->getFileName());
+ }
+
+
+}
+
+#include "editorkeysequencemanager.moc"
diff --git a/src/kile/editorkeysequencemanager.h b/src/kile/editorkeysequencemanager.h
new file mode 100644
index 0000000..51461cb
--- /dev/null
+++ b/src/kile/editorkeysequencemanager.h
@@ -0,0 +1,230 @@
+/**************************************************************************
+* Copyright (C) 2006 by Michel Ludwig (michel.ludwig@kdemail.net) *
+***************************************************************************/
+
+/**************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef EDITORKEYSEQUENCEMANAGER_H
+#define EDITORKEYSEQUENCEMANAGER_H
+
+#include <qevent.h>
+#include <qmap.h>
+#include <qobject.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+// include <kaction.h>
+#include <kate/view.h>
+
+namespace KileJScript {
+ class JScript;
+ class Manager;
+}
+
+class KileInfo;
+
+namespace KileEditorKeySequence {
+ /**
+ * This class represents an action that can be assigned to an editor key sequence.
+ **/
+ class Action {
+ public:
+ Action();
+ virtual ~Action();
+
+ /**
+ * The main method, which implements the "action" itself.
+ **/
+ virtual void execute() = 0;
+
+ /**
+ * Returns a textual representation of the action.
+ **/
+ virtual QString getDescription() const;
+ };
+
+ /**
+ * This class represents the execution of a JavaScript in Kile.
+ **/
+ class ExecuteJScriptAction : public Action {
+ public:
+ ExecuteJScriptAction(KileJScript::JScript *jScript, KileJScript::Manager *jScriptManager);
+ virtual ~ExecuteJScriptAction();
+
+ virtual void execute();
+ virtual QString getDescription() const;
+
+ protected:
+ KileJScript::JScript *m_jScript;
+ KileJScript::Manager *m_jScriptManager;
+ };
+
+ // forward declaration
+ class Recorder;
+
+ /**
+ * This manager class is responsible for handling the key sequences that get assigned
+ * to actions. Currently, every key sequence can only trigger one single action.
+ *
+ * Whenever a watched key sequence is typed, the manager triggers the corresponding
+ * action. The only characters that are allowed in key sequences are those that make
+ * the cursor advance by one position, i.e. for example tabs are not allowed in key
+ * sequences.
+ **/
+ class Manager : public QObject {
+ Q_OBJECT
+
+ friend class Recorder;
+
+ public:
+ /**
+ * Constructs a new manager object.
+ **/
+ Manager(KileInfo* kileInfo, QObject *parent = 0, const char *name = 0);
+ virtual ~Manager();
+
+ /**
+ * Adds a new consequence and the corresponding action.
+ * @param seq the key sequence
+ * @param action the action for the sequence
+ **/
+ void addAction(const QString& seq, Action *action);
+
+ /**
+ * Convenience method. Adds a key sequence-to-action map to this
+ * manager, removing any existing mappings.
+ * @warning This method overrides any exising mappings !
+ **/
+ void addActionMap(const QMap<QString, Action*>& map);
+
+ /**
+ * Removes all the mappings.
+ **/
+ void clear();
+
+ /**
+ * Returns a list of all the key sequences that are currently being
+ * watched.
+ **/
+ const QStringList& getWatchedKeySequences();
+
+ /**
+ * Returns the key sequence that corresponds to an action.
+ * @param a the action that is considered
+ **/
+ QString getKeySequence(const Action* a);
+
+ /**
+ * Returns the action that corresponds to a key sequence.
+ **/
+ Action* getAction(const QString& seq);
+
+ /**
+ * Remove a key sequence, i.e. the key sequence is no longer watched.
+ * @param seq the key sequence that should be removed
+ **/
+ void removeKeySequence(const QString& seq);
+
+ /**
+ * Convenience method. Removes every key sequence contained in the list.
+ * @see removeKeySequence(const QString& seq)
+ **/
+ void removeKeySequence(const QStringList& l);
+
+ /**
+ * @warning not implemented yet !
+ **/
+ void setEditorKeySequence(const QString& seq, Action *action);
+
+ /**
+ * Checks whether the sequence "seq" is already assigned to an action.
+ * This method also checks whether a longer sequence that starts with
+ * "seq" is assigned to an action.
+ * @param seq the sequence that should be checked
+ * @return "true" if and only the sequence "seq" or another sequence
+ * that starts with "seq" is assigned to an action
+ **/
+ bool isSequenceAssigned(const QString& seq) const;
+
+ /**
+ * Performs a few checks on a key sequence.
+ * @returns in the first component: 0 if the sequence is free; 1
+ * if the sequence is assigned; 2 if there is a longer,
+ * currently stored sequence that starts with "seq"; 3
+ * if "seq" starts with a shorter sequence that is currently
+ * stored
+ *
+ * in the second component: a string that corresponds to one
+ * of the previous cases (in the case 0: QString())
+ **/
+ QPair<int, QString> checkSequence(const QString& seq, const QString& skip = QString());
+
+ signals:
+ /**
+ * Emitted whenever the set of watched key sequences changes.
+ **/
+ void watchedKeySequencesChanged();
+
+ protected slots:
+ /**
+ * Signalises to the manager that a (watched) sequence has been typed.
+ * @param seq the sequence that has been typed
+ **/
+ void keySequenceTyped(const QString& seq);
+
+ protected:
+ KileInfo *m_kileInfo;
+ QMap<QString, Action*> m_actionMap;
+ QStringList m_watchedKeySequencesList;
+ };
+
+ /**
+ * This class keeps track of the characters that are typed. It is used in
+ * conjunction with a Kate view and a KileEditorKeySequence::Manager.
+ **/
+ class Recorder : public QObject {
+ Q_OBJECT
+ public:
+ Recorder(Kate::View *view, Manager *manager);
+ virtual ~Recorder();
+
+ signals:
+ /**
+ * Emitted whenever a key sequence that is currently watched has
+ * been typed.
+ **/
+ void detectedTypedKeySequence(const QString& seq);
+
+
+ public slots:
+ /**
+ * Reloads the key sequences that this recorders watches.
+ **/
+ void reloadWatchedKeySequences();
+
+ protected:
+ Manager *m_manager;
+ QString m_typedSequence;
+ uint m_maxSequenceLength;
+ uint m_oldCol, m_oldLine;
+ Kate::View* m_view;
+ QStringList m_watchedKeySequencesList;
+
+ virtual bool eventFilter(QObject *o, QEvent *e);
+
+ /**
+ * Checks whether a key sequence is currently watched.
+ * @param s the key sequence that should be checked
+ **/
+ bool seekForKeySequence(const QString& s);
+ };
+}
+
+#endif
diff --git a/src/kile/encodings/CMakeLists.txt b/src/kile/encodings/CMakeLists.txt
new file mode 100644
index 0000000..eab0cc2
--- /dev/null
+++ b/src/kile/encodings/CMakeLists.txt
@@ -0,0 +1,4 @@
+
+########### install files ###############
+
+INSTALL( FILES latin1.enc latin2.enc latin3.enc latin4.enc latin5.enc latin9.enc cp1250.enc cp1252.enc DESTINATION share/apps/kile/encodings )
diff --git a/src/kile/encodings/Makefile.am b/src/kile/encodings/Makefile.am
new file mode 100644
index 0000000..0e74dc2
--- /dev/null
+++ b/src/kile/encodings/Makefile.am
@@ -0,0 +1,3 @@
+encodingsdir = $(kde_datadir)/kile/encodings
+encodings_DATA = latin1.enc latin2.enc latin3.enc latin4.enc latin5.enc latin9.enc cp1250.enc cp1252.enc
+
diff --git a/src/kile/encodings/cp1250.enc b/src/kile/encodings/cp1250.enc
new file mode 100644
index 0000000..6da4f75
--- /dev/null
+++ b/src/kile/encodings/cp1250.enc
@@ -0,0 +1,119 @@
+:\quotesinglbase
+:\quotedblbase
+:\dots
+:\dag
+:\ddag
+:\v S
+:\guilsinglleft
+:\'S
+:\v T
+:\v Z
+:\'Z
+:\textquoteleft
+:\textquoteright
+:\textquotedblleft
+:\textquotedblright
+:\textbullet
+:\textendash
+:\textemdash
+:\texttrademark
+:\v s
+:\guilsinglright
+:\'s
+:\v t
+:\v z
+:\'z
+:\nobreakspace
+:\v{}
+:\u{}
+:\L
+:\k A
+:\S
+:\"{}
+:\copyright
+:\c S
+:\guillemotleft
+:\lnot
+:\-
+:\textregistered
+:\.Z
+:\ensuremath{{^\circ}}
+:\pm
+:\k\
+:\l
+:\'{}
+:\mu
+:\P
+:\textperiodcentered
+:\c\
+:\k a
+:\c s
+:\guillemotright
+:\v L
+:\H{}
+:\v l
+:\. z
+:\'R
+:\'A
+:\^A
+:\u A
+:\"A
+:\'L
+:\'C
+:\c C
+:\v C
+:\'E
+:\k E
+:\"E
+:\v E
+:\'I
+:\^I
+:\v D
+:\DJ
+:\'N
+:\v N
+:\'O
+:\^O
+:\H O
+:\"O
+:\times
+:\v R
+:\r U
+:\'U
+:\H U
+:\" U
+:\'Y
+:\c T
+:\ss
+:\'r
+:\'a
+:\^a
+:\u a
+:\" a
+:\'l
+:\'c
+:\c c
+:\v c
+:\'e
+:\k e
+:\"e
+:\v e
+:\'\i
+:\^\i
+:\v d
+:\dj
+:\'n
+:\v n
+:\'o
+:\^o
+:\H o
+:\"o
+:\div
+:\v r
+:\r u
+:\'u
+:\H u
+:\"u
+:\'y
+:\c t
+:\.{}
diff --git a/src/kile/encodings/cp1252.enc b/src/kile/encodings/cp1252.enc
new file mode 100644
index 0000000..a584d98
--- /dev/null
+++ b/src/kile/encodings/cp1252.enc
@@ -0,0 +1,115 @@
+:\quotesinglbase
+:\textit{f}
+:\quotedblbase
+:\dots
+:\dag
+:\ddag
+:\^{}
+:\v S
+:\guilsinglleft
+:\OE
+:\textquoteleft
+:\textquoteright
+:\textquotedblleft
+:\textquotedblright
+:\textbullet
+:\textendash
+:\textemdash
+:\~{}
+:\texttrademark
+:\v s
+:\guilsinglright
+:\oe
+:\"Y
+:\"{}
+:\'{}
+:\c\
+:\ensuremath{\frac14}
+:\ensuremath{\frac12}
+:\ensuremath{\frac34}
+:\nobreakspace
+:\ensuremath{{^\circ}}
+:\textexclamdown
+:\pm
+:{^2}
+:\pounds
+:{^3}
+:\mu
+:\P
+:\S
+:\textperiodcentered
+:\copyright
+:{^1}
+:\textordfeminine
+:\textordmasculine
+:\guillemotleft
+:\guillemotright
+:\lnot
+:\-
+:\textregistered
+:\={}
+:\textquestiondown
+:\`A
+:\DH
+:\'A
+:\~N
+:\^A
+:\`O
+:\~A
+:\'O
+:\"A
+:\^O
+:\r A
+:\~O
+:\AE
+:\"O
+:\c C
+:\times
+:\`E
+:\O
+:\'E
+:\`U
+:\^E
+:\'U
+:\"E
+:\^U
+:\`I
+:\"U
+:\'I
+:\'Y
+:\^I
+:\TH
+:\"I
+:\ss
+:\`a
+:\dh
+:\'a
+:\~n
+:\^a
+:\`o
+:\~a
+:\'o
+:\"a
+:\^o
+:\r a
+:\~o
+:\ae
+:\"o
+:\c c
+:\div
+:\`e
+:\o
+:\'e
+:\`u
+:\^e
+:\'u
+:\"e
+:\^u
+:\`\i
+:\"u
+:\'\i
+:\'y
+:\^\i
+:\th
+:\"\i
+:\"y
diff --git a/src/kile/encodings/latin1.enc b/src/kile/encodings/latin1.enc
new file mode 100644
index 0000000..76cd5b5
--- /dev/null
+++ b/src/kile/encodings/latin1.enc
@@ -0,0 +1,96 @@
+:\TextSymbolUnavailable\textcurrency
+:\TextSymbolUnavailable\textbrokenbar
+:\"
+:\'
+:\c
+:\ensuremath{\frac14}
+:\ensuremath{\frac12}
+:\ensuremath{\frac34}
+:\nobreakspace
+:\ensuremath{^\circ}
+:\textexclamdown
+:\pm
+:\TextSymbolUnavailable\textcent
+:{^2}
+:\pounds
+:{^3}
+:\TextSymbolUnavailable\textyen
+:\mu
+:\P
+:\S
+:\textperiodcentered
+:\copyright
+:\mathonesuperior
+:\textordfeminine
+:\textordmasculine
+:\guillemotleft
+:\guillemotright
+:\lnot
+:\-
+:\textregistered
+:\=
+:\textquestiondown
+:\`A
+:\DH
+:\'A
+:\~N
+:\^A
+:\`O
+:\~A
+:\'O
+:\"A
+:\^O
+:\r A
+:\~O
+:\AE
+:\"O
+:\c C
+:\times
+:\`E
+:\O
+:\'E
+:\`U
+:\^E
+:\'U
+:\"E
+:\^U
+:\`I
+:\"U
+:\'I
+:\'Y
+:\^I
+:\TH
+:\"I
+:\ss
+:\`a
+:\dh
+:\'a
+:\~n
+:\^a
+:\`o
+:\~a
+:\'o
+:\"a
+:\^o
+:\r a
+:\~o
+:\ae
+:\"o
+:\c c
+:\div
+:\`e
+:\o
+:\'e
+:\`u
+:\^e
+:\'u
+:\"e
+:\^u
+:\`\i
+:\"u
+:\'\i
+:\'y
+:\^\i
+:\th
+:\"\i
+:\"y \ No newline at end of file
diff --git a/src/kile/encodings/latin2.enc b/src/kile/encodings/latin2.enc
new file mode 100644
index 0000000..c7ce81c
--- /dev/null
+++ b/src/kile/encodings/latin2.enc
@@ -0,0 +1,96 @@
+:\nobreakspace
+:\ensuremath{{^\circ}}
+:\k A
+:\k a
+:\u
+:\k\
+:\L
+:\l
+:\TextSymbolUnavailable\textcurrency
+:\'{}
+:\v L
+:\v l
+:\'S
+:\'s
+:\S
+:\v
+:\"
+:\c\
+:\v S
+:\v s
+:\c S
+:\c s
+:\v T
+:\v t
+:\'Z
+:\'z
+:\-
+:\H
+:\v Z
+:\v z
+:\.Z
+:\.z
+:\'R
+:\DJ
+:\'A
+:\'N
+:\^A
+:\v N
+:\u A
+:\'O
+:\"A
+:\^O
+:\'L
+:\H O
+:\'C
+:\"O
+:\c C
+:\times
+:\v C
+:\v R
+:\'E
+:\r U
+:\k E
+:\'U
+:\"E
+:\H U
+:\v E
+:\"U
+:\'I
+:\'Y
+:\^I
+:\c T
+:\v D
+:\ss
+:\'r
+:\dj
+:\'a
+:\'n
+:\^a
+:\v n
+:\u a
+:\'o
+:\"a
+:\^o
+:\'l
+:\H o
+:\'c
+:\"o
+:\c c
+:\div
+:\v c
+:\v r
+:\'e
+:\r u
+:\k e
+:\'u
+:\"e
+:\H u
+:\v e
+:\"u
+:\'\i
+:\'y
+:\^\i
+:\c t
+:\v d
+:\.{} \ No newline at end of file
diff --git a/src/kile/encodings/latin3.enc b/src/kile/encodings/latin3.enc
new file mode 100644
index 0000000..eedb13a
--- /dev/null
+++ b/src/kile/encodings/latin3.enc
@@ -0,0 +1,86 @@
+:\nobreakspace
+:\ensuremath{{^\circ}}
+:\u{}
+:{^2}
+:\pounds
+:{^3}
+:'{}
+:\mu
+:\^H
+:\^h
+:\S
+:\textperiodcentered
+:\"{}
+:\c\
+:\.I
+:\i
+:\c S
+:\c s
+:\u G
+:\u g
+:\^J
+:\^\j
+:\-
+:\ensuremath{\frac12}
+:\.Z
+:\.z
+:`A
+:'A
+:\~N
+:\^A
+:`O
+:'O
+:\"A
+:\^O
+:\.C
+:\.G
+:\^C
+:\"O
+:\c C
+:\times
+:`E
+:\^G
+:'E
+:`U
+:\^E
+:'U
+:\"E
+:\^U
+:`I
+:\"U
+:'I
+:\u U
+:\^I
+:\^S
+:\"I
+:\ss
+:`a
+:'a
+:\~n
+:\^a
+:`o
+:'o
+:\"a
+:\^o
+:\.c
+:\.g
+:\^c
+:\"o
+:\c c
+:\div
+:`e
+:\^g
+:'e
+:`u
+:\^e
+:'u
+:\"e
+:\^u
+:`\i
+:\"u
+:'\i
+:\u u
+:\^\i
+:\^s
+:\"\i
+:\.{} \ No newline at end of file
diff --git a/src/kile/encodings/latin4.enc b/src/kile/encodings/latin4.enc
new file mode 100644
index 0000000..40fde79
--- /dev/null
+++ b/src/kile/encodings/latin4.enc
@@ -0,0 +1,92 @@
+:\nobreakspace
+:\k A
+:\c R
+:\~I
+:\c L
+:\S
+:\"\
+:\v S
+:\=E
+:\c G
+:\-
+:\v Z
+:\={}
+:\ensuremath{{^\circ}}
+:\k a
+:\k\
+:\c r
+:\'{}
+:\~\i
+:\c l
+:\v\
+:\c\
+:\v s
+:\=e
+:\c g
+:\NG
+:\v z
+:\ng
+:\=A
+:\'A
+:\^A
+:\~A
+:\"A
+:\r A
+:\AE
+:\k I
+:\v C
+:\'E
+:\k E
+:\"E
+:\.{E}
+:\'I
+:\^I
+:\=I
+:\DJ
+:\c N
+:\=O
+:\c K
+:\^O
+:\~O
+:\"O
+:\times
+:\O
+:\k U
+:\'U
+:\^U
+:\"U
+:\~U
+:\=U
+:\ss
+:\=a
+:\'a
+:\^a
+:\~a
+:\"a
+:\r a
+:\ae
+:\k i
+:\v c
+:\'e
+:\k e
+:\"e
+:\.{e}
+:\'\i
+:\^\i
+:\=\i
+:\dj
+:\c n
+:\=o
+:\c k
+:\^o
+:\~o
+:\"o
+:\div
+:\o
+:\k u
+:\'u
+:\^u
+:\"u
+:\~u
+:\=u
+:\.\ \ No newline at end of file
diff --git a/src/kile/encodings/latin5.enc b/src/kile/encodings/latin5.enc
new file mode 100644
index 0000000..8a89379
--- /dev/null
+++ b/src/kile/encodings/latin5.enc
@@ -0,0 +1,92 @@
+:\nobreakspace
+:\ensuremath{{^\circ}}
+:\textexclamdown
+:\pm
+:{^2}
+:\pounds
+:{^3}
+:\'{}
+:\mu
+:\P
+:\S
+:\textperiodcentered
+:\"{}
+:\c\
+:\copyright
+:{^1}
+:\textordfeminine
+:\textordmasculine
+:\guillemotleft
+:\guillemotright
+:\lnot
+:\ensuremath{\frac14}
+:\-
+:\ensuremath{\frac12}
+:\textregistered
+:\ensuremath{\frac34}
+:\={}
+:\textquestiondown
+:\`A
+:\u G
+:\'A
+:\~N
+:\^A
+:\`O
+:\~A
+:\'O
+:\"A
+:\^O
+:\r A
+:\~O
+:\AE
+:\"O
+:\c C
+:\times
+:\`E
+:\O
+:\'E
+:\`U
+:\^E
+:\'U
+:\"E
+:\^U
+:\`I
+:\"U
+:\'I
+:\.I
+:\^I
+:\c S
+:\"I
+:\ss
+:\`a
+:\u g
+:\'a
+:\~n
+:\^a
+:\`o
+:\~a
+:\'o
+:\"a
+:\^o
+:\r a
+:\~o
+:\ae
+:\"o
+:\c c
+:\div
+:\`e
+:\o
+:\'e
+:\`u
+:\^e
+:\'u
+:\"e
+:\^u
+:\`\i
+:\"u
+:\'\i
+:\i
+:\^\i
+:\c s
+:\"\i
+:\"y \ No newline at end of file
diff --git a/src/kile/encodings/latin9.enc b/src/kile/encodings/latin9.enc
new file mode 100644
index 0000000..8c922c4
--- /dev/null
+++ b/src/kile/encodings/latin9.enc
@@ -0,0 +1,93 @@
+:\v S
+:\v s
+:\v Z
+:\v z
+:\OE
+:\oe
+:\"Y
+:\nobreakspace
+:\ensuremath{{^\circ}}
+:\textexclamdown
+:\pm
+:{^2}
+:\pounds
+:{^3}
+:\mu
+:\P
+:\S
+:\textperiodcentered
+:\copyright
+:{^1}
+:\textordfeminine
+:\textordmasculine
+:\guillemotleft
+:\guillemotright
+:\lnot
+:\-
+:\textregistered
+:\={}
+:\textquestiondown
+:\`A
+:\DH
+:\'A
+:\~N
+:\^A
+:\`O
+:\~A
+:\'O
+:\"A
+:\^O
+:\r A
+:\~O
+:\AE
+:\"O
+:\c C
+:\times
+:\`E
+:\O
+:\'E
+:\`U
+:\^E
+:\'U
+:\"E
+:\^U
+:\`I
+:\"U
+:\'I
+:\'Y
+:\^I
+:\TH
+:\"I
+:\ss
+:\`a
+:\dh
+:\'a
+:\~n
+:\^a
+:\`o
+:\~a
+:\'o
+:\"a
+:\^o
+:\r a
+:\~o
+:\ae
+:\"o
+:\c c
+:\div
+:\`e
+:\o
+:\'e
+:\`u
+:\^e
+:\'u
+:\"e
+:\^u
+:\`\i
+:\"u
+:\'\i
+:\'y
+:\^\i
+:\th
+:\"\i
+:\"y
diff --git a/src/kile/envconfigwidget.ui b/src/kile/envconfigwidget.ui
new file mode 100644
index 0000000..792fb33
--- /dev/null
+++ b/src/kile/envconfigwidget.ui
@@ -0,0 +1,172 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KileWidgetEnvironmentConfig</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KileWidgetEnvironmentConfig</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>586</width>
+ <height>200</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>LaTeX</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>m_bgEnv</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Complete Environments</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_CompleteEnvironment</cstring>
+ </property>
+ <property name="text">
+ <string>Automatically complete \begin{env} with \end{env}</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>m_bgGraphics</cstring>
+ </property>
+ <property name="title">
+ <string>Automatic Indentation Inside Environments</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_envIndentation</cstring>
+ </property>
+ <property name="text">
+ <string>Activated</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enable auto indentation of environments.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_envIndentSpaces</cstring>
+ </property>
+ <property name="text">
+ <string>Use spaces instead of tabs to indent</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Use spaces instead of a tabulator to autoindent environments.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_lbNumSpaces</cstring>
+ </property>
+ <property name="text">
+ <string>Number of spaces:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_envIndentNumSpaces</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>kcfg_envIndentNumSpaces</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maxValue">
+ <number>9</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Use this number of spaces to autoindent environments.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>300</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/kile/floatdialog.cpp b/src/kile/floatdialog.cpp
new file mode 100644
index 0000000..e515d70
--- /dev/null
+++ b/src/kile/floatdialog.cpp
@@ -0,0 +1,194 @@
+/***************************************************************************
+ date : Dec 06 2005
+ version : 0.12
+ copyright : (C) 2005 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "floatdialog.h"
+
+#include <qlayout.h>
+#include <qbuttongroup.h>
+#include <qregexp.h>
+
+#include <klocale.h>
+#include "kiledebug.h"
+
+#include "kileedit.h"
+
+namespace KileDialog
+{
+
+FloatEnvironmentDialog::FloatEnvironmentDialog(KConfig *config, KileInfo *ki, QWidget *parent)
+ : Wizard(config,parent), m_ki(ki)
+{
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+
+ QGridLayout *grid = new QGridLayout(page, 6,2, 8,8);
+
+ // environment groupbox
+ QButtonGroup *egroup = new QButtonGroup( i18n("Environment"),page);
+ egroup->setColumnLayout(0, Qt::Vertical );
+ egroup->layout()->setSpacing( 6 );
+ egroup->layout()->setMargin( 11 );
+ QGridLayout *egrouplayout = new QGridLayout( egroup->layout() );
+ egrouplayout->setAlignment( Qt::AlignTop );
+
+ m_rbFigure = new QRadioButton(i18n("&Figure"), egroup);
+ m_rbTable = new QRadioButton(i18n("T&able"), egroup);
+
+ egrouplayout->addWidget( m_rbFigure, 0,0 );
+ egrouplayout->addWidget( m_rbTable, 0,1 );
+
+ // position groupbox
+ QButtonGroup *pgroup = new QButtonGroup( i18n("Position"),page);
+ pgroup->setColumnLayout(0, Qt::Vertical );
+ pgroup->layout()->setSpacing( 6 );
+ pgroup->layout()->setMargin( 11 );
+ QGridLayout *pgrouplayout = new QGridLayout( pgroup->layout() );
+ pgrouplayout->setAlignment( Qt::AlignTop );
+
+ QLabel *label1 = new QLabel(i18n("Here exact:"), pgroup);
+ QLabel *label2 = new QLabel(i18n("Top of page:"), pgroup);
+ QLabel *label3 = new QLabel(i18n("Bottom of page:"), pgroup);
+ QLabel *label4 = new QLabel(i18n("Extra page:"), pgroup);
+ m_cbHere = new QCheckBox(pgroup);
+ m_cbTop = new QCheckBox(pgroup);
+ m_cbBottom = new QCheckBox(pgroup);
+ m_cbPage = new QCheckBox(pgroup);
+
+ pgrouplayout->addWidget( label1, 0,0 );
+ pgrouplayout->addWidget( label2, 1,0 );
+ pgrouplayout->addWidget( label3, 0,2 );
+ pgrouplayout->addWidget( label4, 1,2 );
+ pgrouplayout->addWidget( m_cbHere, 0,1 );
+ pgrouplayout->addWidget( m_cbTop, 1,1 );
+ pgrouplayout->addWidget( m_cbBottom, 0,3 );
+ pgrouplayout->addWidget( m_cbPage, 1,3 );
+
+ // center environment
+ QLabel *label5 = new QLabel(i18n("Center:"),page);
+ m_cbCenter = new QCheckBox(page);
+
+ // Caption
+ QLabel *label6 = new QLabel(i18n("Ca&ption:"),page);
+ m_edCaption = new KLineEdit("",page);
+ m_edCaption->setMinimumWidth(300);
+ label6->setBuddy(m_edCaption);
+
+ // Label
+ QLabel *label7 = new QLabel(i18n("&Label:"),page);
+ m_edLabel = new KLineEdit("",page);
+ m_edLabel->setMinimumWidth(300);
+ label7->setBuddy(m_edLabel);
+
+
+ // add widgets
+ grid->addMultiCellWidget( egroup, 0,0,0,1 );
+ grid->addMultiCellWidget( pgroup, 1,1,0,1 );
+ grid->addWidget(label5,2,0);
+ grid->addWidget(label6,3,0);
+ grid->addWidget(label7,4,0);
+ grid->addWidget(m_cbCenter,2,1);
+ grid->addWidget(m_edCaption,3,1);
+ grid->addWidget(m_edLabel,4,1);
+
+ // default values
+ m_cbCenter->setChecked(true);
+ m_cbHere->setChecked(true);
+ m_cbTop->setChecked(true);
+ m_cbPage->setChecked(true);
+ m_rbFigure->setChecked(true);
+ m_prefix = "fig:";
+ m_edLabel->setText(m_prefix);
+ slotEnvironmentClicked();
+
+ grid->setRowStretch(5,1);
+ setFocusProxy( m_edCaption );
+
+ // signals and slots
+ connect(m_rbFigure, SIGNAL(clicked()), this, SLOT(slotEnvironmentClicked()));
+ connect(m_rbTable, SIGNAL(clicked()), this, SLOT(slotEnvironmentClicked()));
+
+}
+
+////////////////////////////// determine the whole tag //////////////////////////////
+
+void FloatEnvironmentDialog::slotOk()
+{
+ QString envname = ( m_rbFigure->isChecked() ) ? "figure" : "table";
+ QString indent = m_ki->editorExtension()->autoIndentEnvironment();
+
+ QString position;
+ if ( m_cbHere->isChecked() )
+ position += 'h';
+ if ( m_cbTop->isChecked() )
+ position += 't';
+ if ( m_cbBottom->isChecked() )
+ position += 'b';
+ if ( m_cbPage->isChecked() )
+ position += 'p';
+
+ m_td.tagBegin = "\\begin{" + envname + '}';
+ if ( !position.isEmpty() )
+ m_td.tagBegin += '[' + position + ']';
+ m_td.tagBegin += '\n';
+
+ int row = 1;
+ if ( m_cbCenter->isChecked() ) {
+ m_td.tagBegin += indent + "\\centering\n";
+ row = 2;
+ }
+
+ m_td.tagEnd = indent + '\n';
+
+ QString caption = m_edCaption->text();
+ if ( ! caption.isEmpty() )
+ m_td.tagEnd += indent + "\\caption{" + caption + "}\n";
+
+ QString label = m_edLabel->text();
+ if ( !label.isEmpty() && label!=m_prefix )
+ m_td.tagEnd += indent + "\\label{" + label + "}\n";
+
+ m_td.tagEnd += "\\end{" + envname + "}\n";
+
+ m_td.dy=row;
+ m_td.dx=indent.length();
+
+ accept();
+}
+
+void FloatEnvironmentDialog::slotEnvironmentClicked()
+{
+ QString caption,oldprefix;
+
+ if ( m_rbFigure->isChecked() ) {
+ caption = i18n("Figure Environment");
+ oldprefix = "^tab:";
+ m_prefix = "fig:";
+ } else {
+ caption = i18n("Table Environment");
+ oldprefix = "^fig:";
+ m_prefix = "tab:";
+ }
+
+ setCaption(caption);
+ QString s = m_edLabel->text();
+ s.replace( QRegExp(oldprefix),m_prefix);
+ m_edLabel->setText(s);
+
+}
+
+}
+
+#include "floatdialog.moc"
diff --git a/src/kile/floatdialog.h b/src/kile/floatdialog.h
new file mode 100644
index 0000000..67acced
--- /dev/null
+++ b/src/kile/floatdialog.h
@@ -0,0 +1,58 @@
+/***************************************************************************
+ date : Jan 28 2005
+ version : 0.10
+ copyright : (C) 2005 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FLOATDIALOG_H
+#define FLOATDIALOG_H
+
+#include "kilewizard.h"
+#include <klineedit.h>
+
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+
+#include "kileinfo.h"
+
+namespace KileDialog
+{
+
+class FloatEnvironmentDialog : public Wizard
+{
+ Q_OBJECT
+
+public:
+ FloatEnvironmentDialog(KConfig *config, KileInfo *ki, QWidget *parent);
+ ~FloatEnvironmentDialog() {}
+
+public slots:
+ void slotOk();
+
+private slots:
+ void slotEnvironmentClicked();
+
+private:
+ KLineEdit *m_edLabel, *m_edCaption;
+ QRadioButton *m_rbFigure, *m_rbTable;
+ QCheckBox *m_cbHere,*m_cbTop,*m_cbBottom,*m_cbPage;
+ QCheckBox *m_cbCenter;
+
+ QString m_prefix;
+ KileInfo *m_ki;
+};
+
+}
+
+#endif
diff --git a/src/kile/generalconfigwidget.ui b/src/kile/generalconfigwidget.ui
new file mode 100644
index 0000000..30a88d9
--- /dev/null
+++ b/src/kile/generalconfigwidget.ui
@@ -0,0 +1,251 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KileWidgetGeneralConfig</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KileWidgetGeneralConfig</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>776</width>
+ <height>460</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>General</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox5</cstring>
+ </property>
+ <property name="title">
+ <string>Project Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>kcfg_Restore</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Reopen files and projects on startup</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Default project location:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_DefaultProjectLocation</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>kcfg_DefaultProjectLocation</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Autosave Options</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_Autosave</cstring>
+ </property>
+ <property name="text">
+ <string>Auto&amp;save</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Interval &amp;time in minutes (1 - 9999):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_AutosaveInterval</cstring>
+ </property>
+ </widget>
+ <widget class="KIntNumInput">
+ <property name="name">
+ <cstring>kcfg_AutosaveInterval</cstring>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="maxValue">
+ <number>9999</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>Template Variables</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>kcfg_Author</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>kcfg_TemplateEncoding</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>kcfg_DocumentClassOptions</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Author:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_Author</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Documentclass options:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_DocumentClassOptions</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>Input &amp;encoding:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_TemplateEncoding</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>File Clean-Up Details</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_CleanUpAfterClose</cstring>
+ </property>
+ <property name="text">
+ <string>Automatically clean-up files after close</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>kcfg_CleanUpFileExtensions</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_UnfoldConfigTree</cstring>
+ </property>
+ <property name="text">
+ <string>Open all tree items of config pages, when calling this dialog</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>It's impossible to open special tree items in Kile's configuration dialog. You have the choice to open all items, which may lead to a bad size of the dialog, or none of them.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_RunLyxServer</cstring>
+ </property>
+ <property name="text">
+ <string>Let Kile process LyX commands sent by bibliography editors/viewers</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/src/kile/graphicsconfigwidget.ui b/src/kile/graphicsconfigwidget.ui
new file mode 100644
index 0000000..ce225b6
--- /dev/null
+++ b/src/kile/graphicsconfigwidget.ui
@@ -0,0 +1,134 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KileWidgetGraphicsConfig</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KileWidgetGraphicsConfig</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>602</width>
+ <height>180</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Graphics</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>m_bgGraphics</cstring>
+ </property>
+ <property name="title">
+ <string>Include Graphics</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_tlResolution</cstring>
+ </property>
+ <property name="text">
+ <string>Default resolution:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_resolution</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>kcfg_resolution</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_tlBbox</cstring>
+ </property>
+ <property name="text">
+ <string>Bounding box:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_boundingbox</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>m_tlImageMagick</cstring>
+ </property>
+ <property name="text">
+ <string>ImageMagick:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>m_tlResolutionHelp</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>(used when the picture offers no resolution)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="1">
+ <property name="name">
+ <cstring>kcfg_boundingbox</cstring>
+ </property>
+ <property name="text">
+ <string>Tr&amp;y to determine from the picture</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="1">
+ <property name="name">
+ <cstring>m_tlBBoxHelp</cstring>
+ </property>
+ <property name="text">
+ <string>(you have to install the ImageMagick package to use this option)</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="1">
+ <property name="name">
+ <cstring>m_lbImagemagick</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<includes>
+ <include location="global" impldecl="in declaration">kconfig.h</include>
+ <include location="local" impldecl="in declaration">latexcmd.h</include>
+ <include location="local" impldecl="in declaration">latexcmddialog.h</include>
+</includes>
+<variables>
+ <variable access="private">KConfig *m_config;</variable>
+ <variable access="private">KileDocument::LatexCommands *m_commands;</variable>
+</variables>
+<slots>
+ <slot access="private" specifier="non virtual">slotConfigure()</slot>
+</slots>
+<functions>
+ <function access="private" specifier="non virtual">init()</function>
+ <function specifier="non virtual">setLatexCommands( KConfig * config, KileDocument::LatexCommands * commands )</function>
+</functions>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/src/kile/help/CMakeLists.txt b/src/kile/help/CMakeLists.txt
new file mode 100644
index 0000000..4003afa
--- /dev/null
+++ b/src/kile/help/CMakeLists.txt
@@ -0,0 +1,4 @@
+
+########### install files ###############
+
+INSTALL( FILES latex-kile.lst latex-tetex.lst latex-tetex3.lst latex-texlive-3.9.lst DESTINATION share/apps/kile/help )
diff --git a/src/kile/help/Makefile.am b/src/kile/help/Makefile.am
new file mode 100644
index 0000000..11979c6
--- /dev/null
+++ b/src/kile/help/Makefile.am
@@ -0,0 +1,3 @@
+helpdir = $(kde_datadir)/kile/help
+help_DATA = latex-kile.lst latex-tetex.lst latex-tetex3.lst latex-texlive-3.9.lst
+
diff --git a/src/kile/help/latex-kile.lst b/src/kile/help/latex-kile.lst
new file mode 100644
index 0000000..986f7a6
--- /dev/null
+++ b/src/kile/help/latex-kile.lst
@@ -0,0 +1,236 @@
+# Keys for LaTeX help (from Kile)
+# v0.1
+# dani/2003
+#
+\a => IDX139
+\addcontentsline => SEC173
+\address => SEC92
+\addtocontents => SEC174
+\addtocounter => SEC4
+\addtolength => SEC86
+\addvspace => SEC148
+\alph => SEC5
+\Alph => SEC5
+\appendix => IDX314
+\arabic => SEC6
+array => SEC31
+\author => SEC133
+\backslash => IDX346
+\begin => SEC30
+\bfseries => IDX380
+\bibitem => SEC70
+\bibliography => SEC73
+\bibliographystyle => SEC73
+\bigskip => SEC149
+\caption => IDX80
+\cc => SEC93
+\cdots => IDX275
+center => SEC32
+\centering => SEC33
+\chapter => SEC142
+\circle => SEC48
+\cite => SEC71
+\cleardoublepage => SEC108
+\clearpage => SEC109
+\cline => SEC65
+\closing => SEC94
+\dashbox => SEC49
+\date => SEC134
+\ddots => IDX276
+\depth => IDX193
+description => SEC34
+\documentclass => SEC24
+\dotfill => SEC144
+\emph => IDX376
+\encl => SEC95
+\end => SEC30
+\enlargethispage => SEC110
+enumerate => SEC35
+eqnarray => SEC36
+equation => SEC37
+\fbox => SEC154
+figure => SEC38
+\flushbottom => SEC26
+flushleft => SEC39
+flushright => SEC41
+\fnsymbol => SEC7
+\fontencoding => IDX416
+\fontfamily => IDX417
+\fontseries => IDX418
+\fontshape => IDX419
+\fontsize => IDX420
+\footnote => SEC80
+\footnotemark => SEC81
+\footnotesize => IDX406
+\footnotetext => SEC82
+\frac => IDX277
+\frame => SEC50
+\framebox => SEC51
+\fussy => SEC111
+\height => IDX192
+\hfill => SEC145
+\hline => SEC66
+\hrulefill => SEC146
+\hspace => SEC147
+\Huge => IDX413
+\huge => IDX412
+\hyphenation => SEC112
+\include => SEC168
+\includeonly => SEC169
+\indent => SEC121
+\input => SEC170
+\item => SEC43
+itemize => SEC43
+\itshape => IDX375
+\kill => IDX136
+\label => SEC16
+\large => IDX409
+\LARGE => IDX411
+\Large => IDX410
+\ldots => IDX278
+\lefteqn => IDX74
+letter => SEC44
+\line => SEC52
+\linebreak => SEC113
+\linethickness => SEC53
+list => SEC45
+\listoffigures => IDX358
+\listoftables => IDX359
+\location => IDX204
+lrbox => SEC156
+\makebox => SEC157
+\makebox => SEC54
+\makelabels => SEC97
+\maketitle => SEC132
+\markboth => SEC139
+\markright => SEC140
+\mathbf => IDX394
+\mathcal => IDX399
+\mathit => IDX397
+\mathnormal => IDX398
+\mathrm => IDX393
+\mathsf => IDX395
+\mathtt => IDX396
+\mathversion => IDX400
+\mbox => SEC158
+\mdseries => IDX378
+\medskip => SEC150
+minipage => SEC46
+\multicolumn => SEC67
+\multiput => SEC55
+\name => SEC98
+\newcommand => SEC20
+\newcounter => SEC8
+\newenvironment => SEC21
+\newfont => SEC23
+\newlength => SEC84
+\newline => SEC114
+\newpage => SEC115
+\newsavebox => SEC159
+\newtheorem => SEC22
+\nocite => SEC72
+\nofiles => IDX360
+\noindent => SEC122
+\nolinebreak => SEC116
+\nopagebreak => SEC117
+\normalfont => IDX392
+\normalsize => IDX408
+\onecolumn => SEC27
+\opening => SEC99
+\oval => SEC56
+\overbrace => IDX279
+\overline => IDX280
+\pagebreak => SEC118
+\pagenumbering => SEC137
+\pageref => SEC17
+\pagestyle => SEC138
+\par => SEC123
+\paragraph => SEC142
+\parbox => SEC160
+picture => SEC47
+\ps => SEC100
+\pushtabs => IDX137
+\put => SEC57
+quotation => SEC60
+quote => SEC61
+\raggedbottom => SEC28
+\raggedleft => SEC42
+\raggedright => SEC40
+\raisebox => SEC161
+\ref => SEC18
+\refstepcounter => SEC9
+\rmfamily => IDX373
+\roman => SEC10
+\Roman => SEC10
+\rule => SEC162
+\savebox => SEC163
+\sbox => SEC164
+\scriptsize => IDX405
+\scshape => IDX388
+\section => SEC142
+\selectfont => IDX421
+\setcounter => SEC12
+\setlength => SEC85
+\settodepth => SEC87
+\settoheight => SEC88
+\settowidth => SEC89
+\sffamily => IDX386
+\shortstack => SEC58
+\signature => SEC101
+\sloppy => SEC119
+\slshape => IDX384
+\small => IDX407
+\smallskip => SEC151
+\sqrt => IDX281
+\startbreaks => SEC102
+\stepcounter => SEC11
+\stopbreaks => SEC103
+\subparagraph => SEC142
+\subsection => SEC142
+\subsubsection => SEC142
+\symbol => IDX347
+tabbing => SEC62
+table => SEC63
+\tableofcontents => IDX357
+tabular => SEC64
+\telephone => SEC104
+\textbf => IDX380
+\textit => IDX375
+\textmd => IDX378
+\textnormal => IDX392
+\textrm => IDX373
+\textsc => IDX388
+\textsf => IDX386
+\textsl => IDX384
+\texttt => IDX389
+\textup => IDX381
+\thanks => SEC135
+thebibliography => SEC69
+theorem => SEC74
+\thispagestyle => SEC141
+\tiny => IDX404
+\title => SEC136
+titlepage => SEC75
+\today => IDX165
+\totalheight => IDX194
+\ttfamily => IDX389
+\twocolumn => SEC29
+\typein => SEC176
+\typeout => SEC177
+\underbrace => IDX282
+\underline => IDX283
+\upshape => IDX381
+\usebox => SEC165
+\usecounter => SEC13
+\usefont => IDX422
+\usepackage => IDX46
+\value => SEC14
+\vdots => IDX284
+\vector => SEC59
+\verb => SEC77
+verbatim => SEC76
+verse => SEC78
+\vfill => SEC152
+\vline => SEC68
+\vspace => SEC153
+\width => SEC90
diff --git a/src/kile/help/latex-tetex.lst b/src/kile/help/latex-tetex.lst
new file mode 100644
index 0000000..2b06073
--- /dev/null
+++ b/src/kile/help/latex-tetex.lst
@@ -0,0 +1,204 @@
+# Keys for LaTeX help (from TeTeX)
+# v0.2
+# dani/2003
+# jeroen/2005
+\part
+\chapter => ltx-141.html
+\section => ltx-141.html
+\subsection => ltx-141.html
+\subsubsection => ltx-141.html
+\paragraph => ltx-141.html
+\subparagraph => ltx-141.html
+\subsubparagraph => ltx-141.html
+\subsubsubparagraph => ltx-141.html
+\documentclass => ltx-22.html
+\documentstyle => ltx-22.html
+\addcontentsline => ltx-171.html
+\addtocontents => ltx-172.html
+\addtocounter => ltx-195.html
+\address => ltx-93.html
+\addtolength => ltx-89.html
+\addvspace => ltx-198.html
+\alph => ltx-199.html
+\appendix => ltx-200.html
+\arabic => ltx-201.html
+\author => ltx-203.html
+\backslash => ltx-164.html
+\baselineskip => baselineskip.html
+\baselinestretch => baselineskip.html
+\bf => ltx-204.html
+\bibitem => ltx-205.html
+\bigskip => ltx-206.html
+\boldmath => boldmath.html
+\cal => ltx-407.html
+\caption => caption.html
+\cdots => ltx-207.html
+\centering => ltx-30.html
+\circle => ltx-210.html
+\cite => ltx-211.html
+\cleardoublepage => ltx-212.html
+\clearpage => ltx-213.html
+\cline => ltx-214.html
+\closing => ltx-98.html
+\dashbox => ltx-216.html
+\date => ltx-217.html
+\ddots => ltx-218.html
+\dotfill => ltx-220.html
+\em => ltx-221.html
+\ensuremath => ensuremath.html
+\fbox => ltx-226.html
+\flushbottom => ltx-227.html
+\fnsymbol => ltx-230.html
+\footnote => ltx-231.html
+\footnotemark => ltx-232.html
+\footnotesize => ltx-233.html
+\footnotetext => ltx-234.html
+\frac => ltx-235.html
+\frame => ltx-236.html
+\framebox => ltx-237.html
+\frenchspacing => frenchsp.html
+\hfill => ltx-238.html
+\hline => ltx-239.html
+\hrulefill => ltx-240.html
+\hspace => ltx-241.html
+\huge => ltx-242.html
+\Huge => ltx-243.html
+\hyphenation => ltx-244.html
+\include => ltx-245.html
+\includeonly => ltx-246.html
+\indent => ltx-247.html
+\input => ltx-248.html
+\it => ltx-249.html
+\item => item.html
+\kill => ltx-251.html
+\label => ltx-252.html
+\large => ltx-253.html
+\Large => ltx-254.html
+\LARGE => ltx-255.html
+\ldots => ltx-256.html
+\left => ltx-403.html#big
+\lefteqn => lefteqn.html
+\line => ltx-257.html
+\linebreak => ltx-258.html
+\linethickness => ltx-259.html
+\linewidth => textwidth.html
+\location => ltx-261.html
+\makebox => ltx-262.html
+\maketitle => ltx-263.html
+\markboth => ltx-264.html
+\markright => ltx-264.html
+\mathcal => ltx-407.html
+\mathop => stackrel.html#mathop
+\mbox => ltx-265.html
+\medskip => ltx-266.html
+\multicolumn => ltx-268.html
+\multiput => ltx-269.html
+\newcommand => ltx-18.html
+\newcounter => ltx-271.html
+\newenvironment => ltx-19.html
+\newfont => ltx-21.html
+\newlength => ltx-87.html
+\newline => ltx-275.html
+\newpage => ltx-276.html
+\newsavebox => ltx-277.html
+\newtheorem => ltx-20.html
+\nocite => ltx-279.html
+\noindent => ltx-280.html
+\nolinebreak => ltx-281.html
+\normalsize => ltx-282.html
+\nopagebreak => ltx-283.html
+\not => ltx-404.html#not
+\onecolumn => ltx-284.html
+\opening => ltx-97.html
+\oval => ltx-286.html
+\overbrace => ltx-287.html
+\overline => ltx-288.html
+\pagebreak => ltx-289.html
+\pagenumbering => ltx-137.html
+\pageref => ltx-291.html
+\pagestyle => ltx-138.html
+\par => ltx-293.html
+\parbox => ltx-294.html
+\parindent => ltx-86.html#lencmd
+\parskip => parskip.html
+\protect => fragile.html
+\providecommand => ltx-18.html
+\put => ltx-296.html
+\raggedbottom => ltx-299.html
+\raggedleft => ltx-300.html
+\raggedright => ltx-301.html
+\raisebox => ltx-302.html
+\ref => ltx-303.html
+\renewcommand => ltx-18.html
+\right => ltx-403.html#big
+\rm => ltx-304.html
+\roman => ltx-305.html
+\rule => ltx-306.html
+\savebox => ltx-307.html
+\sbox => ltx-307.html
+\sc => ltx-308.html
+\scriptsize => ltx-309.html
+\setcounter => ltx-310.html
+\setlength => ltx-88.html
+\settowidth => ltx-90.html
+\sf => ltx-313.html
+\shortstack => ltx-314.html
+\signature => ltx-315.html
+\sl => ltx-316.html
+\small => ltx-317.html
+\smallskip => ltx-318.html
+\sqrt => ltx-319.html
+\stackrel => stackrel.html
+\tableofcontents => toc.html
+\telephone => ltx-323.html
+\textwidth => textwidth.html
+\textheight => ltx-86.html#lencmd
+\thanks => ltx-324.html
+\thispagestyle => ltx-140.html
+\tiny => ltx-328.html
+\title => ltx-329.html
+\today => ltx-330.html
+\tt => ltx-331.html
+\twocolumn => ltx-332.html
+\typeout => ltx-174.html
+\typein => ltx-175.html
+\underbrace => ltx-335.html
+\underline => ltx-336.html
+\unitlength => unitlength.html
+\usebox => ltx-337.html
+\usecounter => ltx-338.html
+\value => ltx-339.html
+\vdots => ltx-340.html
+\vector => ltx-341.html
+\verb => ltx-342.html
+\vfill => ltx-345.html
+\vline => ltx-346.html
+\vphantom => ltx-403.html#big
+\vspace => ltx-347.html
+abstract => ltx-420.html
+array => ltx-202.html
+center => ltx-29.html
+description => ltx-31.html
+displaymath => ltx-421.html
+enumerate => ltx-222.html
+eqnarray => ltx-223.html
+equation => ltx-224.html
+figure => ltx-225.html
+flushleft => ltx-228.html
+flushright => ltx-229.html
+itemize => ltx-250.html
+list => ltx-260.html
+math => ltx-115.html#math
+minipage => ltx-267.html
+picture => ltx-43.html
+quotation => ltx-297.html
+quote => ltx-298.html
+tabbing => ltx-58.html
+table => ltx-67.html
+tabular => ltx-68.html
+thebibliography => ltx-73.html
+theorem => ltx-77.html
+titlepage => ltx-78.html
+trivlist => trivlist.html
+verbatim => ltx-79.html
+verse => ltx-81.html
diff --git a/src/kile/help/latex-tetex3.lst b/src/kile/help/latex-tetex3.lst
new file mode 100644
index 0000000..5796f0e
--- /dev/null
+++ b/src/kile/help/latex-tetex3.lst
@@ -0,0 +1,340 @@
+# Keys for LaTeX help (for TeTeX v3.x)
+# v0.1
+# dani/2005
+#
+\acute => latex.html#accents-chars-math
+\addcontentsline => latex.html#bslash-addcontentsline-title
+\address => latex.html#bslash-address-title
+\addtocontents => latex.html#bslash-addtocontents-title
+\addtocounter => latex.html#bslash-addtocounter-title
+\addtolength => latex.html#bslash-addtolength-title
+\addvspace => latex.html#bslash-addvspace-title
+\aleph => latex.html#misc-symbols-title
+\alph => latex.html#bslash-alph-title
+\angle => latex.html#misc-symbols-title
+\appendix => latex.html#sectioning
+\approx => latex.html#binary-and-relational-ops-title
+\arabic => latex.html#bslash-arabic-title
+\ast => latex.html#binary-and-relational-ops-title
+\author => latex.html#bslash-author-title
+\backslash => latex.html#delimiters-title
+\bar => latex.html#accents-chars-math
+\bfseries => latex.html#typefaces
+\bibitem => latex.html#bslash-bibitem-title
+\bibliographystyle => latex.html#using-bibtex-title
+\bibliography => latex.html#using-bibtex-title
+\bigcap => latex.html#variable-math-size-symbols-title
+\bigcup => latex.html#variable-math-size-symbols-title
+\bigodot => latex.html#variable-math-size-symbols-title
+\bigoplus => latex.html#variable-math-size-symbols-title
+\bigotimes => latex.html#variable-math-size-symbols-title
+\bigskip => latex.html#bslash-bigskip-title
+\biguplus => latex.html#variable-math-size-symbols-title
+\bigvee => latex.html#variable-math-size-symbols-title
+\bigwedge => latex.html#variable-math-size-symbols-title
+\Box => latex.html#misc-symbols-title
+\breve => latex.html#accents-chars-math
+\bullet => latex.html#binary-and-relational-ops-title
+\caption => latex.html#figure-title
+\cc => latex.html#bslash-cc-title
+\cdot => latex.html#binary-and-relational-ops-title
+\cdots => latex.html#math-miscellany-title
+\centering => latex.html#bslash-centering-title
+\chapter => latex.html#sectioning
+\check => latex.html#accents-chars-math
+\circ => latex.html#binary-and-relational-ops-title
+\circle => latex.html#bslash-circle-title
+\cite => latex.html#bslash-cite-title
+\cleardoublepage => latex.html#bslash-cleardoublepage-title
+\clearpage => latex.html#bslash-clearpage-title
+\cline => latex.html#bslash-cline-title
+\closing => latex.html#bslash-closing-title
+\clubsuit => latex.html#misc-symbols-title
+\coprod => latex.html#variable-math-size-symbols-title
+\dashbox => latex.html#bslash-dashbox-title
+\date => latex.html#bslash-date-title
+\ddot => latex.html#accents-chars-math
+\ddots => latex.html#math-miscellany-title
+\depth => latex.html#predefined-lengths-title
+\Diamond => latex.html#misc-symbols-title
+\diamondsuit => latex.html#misc-symbols-title
+\div => latex.html#binary-and-relational-ops-title
+\documentclass => latex.html#document-classes
+\dot => latex.html#accents-chars-math
+\dotfill => latex.html#bslash-dotfill-title
+\downarrow => latex.html#arrows-title
+\downarrow => latex.html#delimiters-title
+\ell => latex.html#misc-symbols-title
+\emph => latex.html#typefaces
+\encl => latex.html#bslash-encl-title
+\enlargethispage => latex.html#bslash-enlargethispage-title
+\ensuremath => latex.html#math-miscellany-title
+\equiv => latex.html#binary-and-relational-ops-title
+\exists => latex.html#misc-symbols-title
+\fbox => latex.html#bslash-fbox-title
+\fboxrule => latex.html#bslash-framebox-op-picture-cp-title
+\fboxsep => latex.html#bslash-framebox-op-picture-cp-title
+\flat => latex.html#misc-symbols-title
+\flushbottom => latex.html#bslash-flushbottom-title
+\fnsymbol => latex.html#bslash-fnsymbol-title
+\fontencoding => latex.html#low-dash-level-font-commands-title
+\fontfamily => latex.html#low-dash-level-font-commands-title
+\fontseries => latex.html#low-dash-level-font-commands-title
+\fontshape => latex.html#low-dash-level-font-commands-title
+\fontsize => latex.html#low-dash-level-font-commands-title
+\footnote => latex.html#bslash-footnote-title
+\footnotemark => latex.html#bslash-footnotemark-title
+\footnotesize => latex.html#sizes-title
+\footnotetext => latex.html#bslash-footnotetext-title
+\forall => latex.html#misc-symbols-title
+\frac => latex.html#math-miscellany-title
+\framebox => latex.html#bslash-framebox-op-picture-cp-title
+\frame => latex.html#bslash-frame-title
+\fussy => latex.html#bslash-fussy-title
+\geq => latex.html#binary-and-relational-ops-title
+\gg => latex.html#binary-and-relational-ops-title
+\graphicspath => latex-packages.html#graphicspath
+\grave => latex.html#accents-chars-math
+\hat => latex.html#accents-chars-math
+\hbar => latex.html#misc-symbols-title
+\heartsuit => latex.html#misc-symbols-title
+\height => latex.html#predefined-lengths-title
+\hfill => latex.html#bslash-hfill-title
+\hline => latex.html#bslash-hline-title
+\hrulefill => latex.html#bslash-hrulefill-title
+\hspace => latex.html#bslash-hspace-title
+\huge => latex.html#sizes-title
+\Huge => latex.html#sizes-title
+\hypersetup => latex-packages.html#hyperref
+\hyphenation => latex.html#bslash-hyphenation-title
+\imath => latex.html#misc-symbols-title
+\Im => latex.html#misc-symbols-title
+\include => latex.html#bslash-include-title
+\includegraphics => latex-packages.html#includegraphics
+\includeonly => latex.html#bslash-includeonly-title
+\indent => latex.html#bslash-indent-title
+\infty => latex.html#misc-symbols-title
+\input => latex.html#bslash-input-title
+\int => latex.html#variable-math-size-symbols-title
+\item => latex.html#enumerate-title
+\itshape => latex.html#typefaces
+\jmath => latex.html#misc-symbols-title
+\label => latex.html#bslash-label-title
+\langle => latex.html#delimiters-title
+\large => latex.html#sizes-title
+\Large => latex.html#sizes-title
+\LARGE => latex.html#sizes-title
+\ldots => latex.html#math-miscellany-title
+\leftarrow => latex.html#arrows-title
+\Leftarrow => latex.html#arrows-title
+\lefteqn => latex.html#eqnarray-title
+\leftrightarrow => latex.html#arrows-title
+\Leftrightarrow => latex.html#arrows-title
+\leq => latex.html#binary-and-relational-ops-title
+\linebreak => latex.html#bslash-linebreak-title
+\line => latex.html#bslash-line-title
+\linethickness => latex.html#bslash-linethickness-title
+\listoffigures => latex.html#table-of-contents
+\listoftables => latex.html#table-of-contents
+\ll => latex.html#binary-and-relational-ops-title
+\location => latex.html#bslash-location-title
+\longleftarrow => latex.html#arrows-title
+\Longleftarrow => latex.html#arrows-title
+\longleftrightarrow => latex.html#arrows-title
+\longrightarrow => latex.html#arrows-title
+\Longrightarrow => latex.html#arrows-title
+\makebox => latex.html#bslash-makebox-title
+\makelabels => latex.html#bslash-makelabels-title
+\maketitle => latex.html#bslash-maketitle-title
+\marginpar => latex.html#margin-notes
+\markboth => latex.html#bslash-markboth-title
+\markright => latex.html#bslash-markright-title
+\mathbf => latex.html#typefaces
+\mathcal => latex.html#typefaces
+\mathit => latex.html#typefaces
+\mathnormal => latex.html#typefaces
+\mathrm => latex.html#typefaces
+\mathsf => latex.html#typefaces
+\mathtt => latex.html#typefaces
+\mathversion => latex.html#typefaces
+\mbox => latex.html#bslash-mbox-title
+\mdseries => latex.html#typefaces
+\medskip => latex.html#bslash-medskip-title
+\mp => latex.html#binary-and-relational-ops-title
+\multicolumn => latex.html#bslash-multicolumn-title
+\multiput => latex.html#bslash-multiput-title
+\nabla => latex.html#misc-symbols-title
+\name => latex.html#bslash-name-title
+\natural => latex.html#misc-symbols-title
+\nearrow => latex.html#arrows-title
+\neq => latex.html#binary-and-relational-ops-title
+\newcommand => latex.html#bslash-newcommand-title
+\newcounter => latex.html#bslash-newcounter-title
+\newenvironment => latex.html#bslash-newenvironment-title
+\newfont => latex.html#bslash-newfont-title
+\newlength => latex.html#bslash-newlength-title
+\newline => latex.html#bslash-newline-title
+\newpage => latex.html#bslash-newpage-title
+\newsavebox => latex.html#bslash-newsavebox-title
+\newtheorem => latex.html#bslash-newtheorem-title
+\nocite => latex.html#bslash-nocite-title
+\noindent => latex.html#bslash-noindent-title
+\nolinebreak => latex.html#bslash-nolinebreak-title
+\nopagebreak => latex.html#bslash-nopagebreak-title
+\normalsize => latex.html#sizes-title
+\nwarrow => latex.html#arrows-title
+\oint => latex.html#variable-math-size-symbols-title
+\onecolumn => latex.html#bslash-onecolumn-title
+\opening => latex.html#bslash-opening-title
+\oval => latex.html#bslash-oval-title
+\overbrace => latex.html#math-miscellany-title
+\overline => latex.html#math-miscellany-title
+\pagebreak => latex.html#bslash-pagebreak-title
+\pagenumbering => latex.html#bslash-pagenumbering-title
+\pageref => latex.html#bslash-pageref-title
+\pagestyle => latex.html#bslash-pagestyle-title
+\paragraph => latex.html#sectioning
+\parbox => latex.html#bslash-parbox-title
+\par => latex.html#bslash-par-title
+\partial => latex.html#misc-symbols-title
+\part => latex.html#sectioning
+\per => latex.html#binary-and-relational-ops-title
+\pm => latex.html#binary-and-relational-ops-title
+\prime => latex.html#misc-symbols-title
+\prod => latex.html#variable-math-size-symbols-title
+\propto => latex.html#binary-and-relational-ops-title
+\ps => latex.html#bslash-ps-title
+\put => latex.html#bslash-put-title
+\put => latex.html#picture-title
+\raggedbottom => latex.html#bslash-raggedbottom-title
+\raggedleft => latex.html#bslash-raggedleft-title
+\raggedright => latex.html#bslash-raggedright-title
+\raisebox => latex.html#bslash-raisebox-title
+\rangle => latex.html#delimiters-title
+\ref => latex.html#bslash-ref-title
+\refstepcounter => latex.html#bslash-refstepcounter-title
+\Re => latex.html#misc-symbols-title
+\renewcommand => latex.html#bslash-newcommand-title
+\renewenvironment => latex.html#bslash-newenvironment-title
+\rightarrow => latex.html#arrows-title
+\Rightarrow => latex.html#arrows-title
+\rmfamily => latex.html#typefaces
+\roman => latex.html#bslash-roman-title
+\rule => latex.html#bslash-rule-title
+\samepage => latex.html#bslash-samepage-title
+\savebox => latex.html#bslash-savebox-title
+\sbox => latex.html#bslash-sbox-title
+\scriptsize => latex.html#sizes-title
+\scshape => latex.html#typefaces
+\searrow => latex.html#arrows-title
+\section => latex.html#sectioning
+\selectfont => latex.html#low-dash-level-font-commands-title
+\setcounter => latex.html#bslash-setcounter-title
+\setlength => latex.html#bslash-setlength-title
+\settodepth => latex.html#bslash-settodepth-title
+\settoheight => latex.html#bslash-settoheight-title
+\settowidth => latex.html#bslash-settowidth-title
+\sffamily => latex.html#typefaces
+\shortstack => latex.html#bslash-shortstack-title
+\signature => latex.html#bslash-signature-title
+\sim => latex.html#binary-and-relational-ops-title
+\simeq => latex.html#binary-and-relational-ops-title
+\sloppy => latex.html#bslash-sloppy-title
+\slshape => latex.html#typefaces
+\small => latex.html#sizes-title
+\smallskip => latex.html#bslash-smallskip-title
+\spadesuit => latex.html#misc-symbols-title
+\sqrt => latex.html#math-miscellany-title
+\stackrel => latex.html#arrows-title
+\star => latex.html#binary-and-relational-ops-title
+\startbreaks => latex.html#bslash-startbreaks-title
+\stepcounter => latex.html#bslash-stepcounter-title
+\stopbreaks => latex.html#bslash-stopbreaks-title
+\subparagraph => latex.html#sectioning
+\subsection => latex.html#sectioning
+\subset => latex.html#binary-and-relational-ops-title
+\subsubsection => latex.html#sectioning
+\sum => latex.html#variable-math-size-symbols-title
+\surd => latex.html#misc-symbols-title
+\swarrow => latex.html#arrows-title
+\tableofcontents => latex.html#table-of-contents
+\telephone => latex.html#bslash-telephone-title
+\textbf => latex.html#typefaces
+\textit => latex.html#typefaces
+\textmd => latex.html#typefaces
+\textnormal => latex.html#typefaces
+\textrm => latex.html#typefaces
+\textsc => latex.html#typefaces
+\textsf => latex.html#typefaces
+\textsl => latex.html#typefaces
+\texttt => latex.html#typefaces
+\textup => latex.html#typefaces
+\thanks => latex.html#bslash-thanks-title
+\thispagestyle => latex.html#bslash-thispagestyle-title
+\tilde => latex.html#accents-chars-math
+\times => latex.html#binary-and-relational-ops-title
+\tiny => latex.html#sizes-title
+\title => latex.html#bslash-title-title
+\totalheight => latex.html#predefined-lengths-title
+\triangle => latex.html#misc-symbols-title
+\ttfamily => latex.html#typefaces
+\twocolumn => latex.html#bslash-twocolumn-title
+\typein => latex.html#bslash-typein-title
+\typeout => latex.html#bslash-typeout-title
+\underbrace => latex.html#math-miscellany-title
+\underline => latex.html#math-miscellany-title
+\unitlength => latex.html#picture-title
+\uparrow => latex.html#arrows-title
+\Uparrow => latex.html#arrows-title
+\uparrow => latex.html#delimiters-title
+\updownarrow => latex.html#delimiters-title
+\upshape => latex.html#typefaces
+\usebox => latex.html#bslash-usebox-title
+\usecounter => latex.html#bslash-usecounter-title
+\usefont => latex.html#low-dash-level-font-commands-title
+\usepackage => latex.html#document-classes
+\value => latex.html#bslash-value-title
+\vdots => latex.html#math-miscellany-title
+\vec => latex.html#accents-chars-math
+\vector => latex.html#bslash-vector-title
+\verb => latex.html#bslash-verb-title
+\vert => latex.html#delimiters-title
+\Vert => latex.html#delimiters-title
+\vfill => latex.html#bslash-vfill-title
+\vline => latex.html#bslash-vline-title
+\vpageref => latex-packages.html#varioref
+\vpagerefrange => latex-packages.html#varioref
+\vref => latex-packages.html#varioref
+\vrefrange => latex-packages.html#varioref
+\vspace => latex.html#bslash-vspace-title
+\widehat => latex.html#accents-chars-math
+\widetilde => latex.html#accents-chars-math
+\width => latex.html#predefined-lengths-title
+\wp => latex.html#misc-symbols-title
+array => latex.html#array-title
+center => latex.html#center-title
+description => latex.html#description-title
+displaymath => latex.html#math-formulae
+enumerate => latex.html#enumerate-title
+eqnarray => latex.html#eqnarray-title
+equation => latex.html#equation-title
+figure => latex.html#figure-title
+flushleft => latex.html#flushleft-title
+flushright => latex.html#flushright-title
+itemize => latex.html#itemize-title
+letter => latex.html#letter-title
+list => latex.html#list-title
+lrbox => latex.html#lrbox-title
+math => latex.html#math-formulae
+minipage => latex.html#minipage-title
+picture => latex.html#picture-title
+quotation => latex.html#quotation-title
+quote => latex.html#quote-title
+tabbing => latex.html#tabbing-title
+table => latex.html#table-title
+tabular => latex.html#tabular-title
+thebibliography => latex.html#thebibliography-title
+theorem => latex.html#theorem-title
+titlepage => latex.html#titlepage-title
+verbatim => latex.html#verbatim-title
+verse => latex.html#verse-title
diff --git a/src/kile/help/latex-texlive-3.9.lst b/src/kile/help/latex-texlive-3.9.lst
new file mode 100644
index 0000000..91f14da
--- /dev/null
+++ b/src/kile/help/latex-texlive-3.9.lst
@@ -0,0 +1,559 @@
+# Keys for LaTeX help (for TexLive with TeX-Refs v3.9)
+# v0.2
+# dani/2007
+#
+\acute => tex-refs.html#accents-chars-math
+\addcontentsline => tex-refs.html#cmd-addcontentsline-title
+\address => tex-refs.html#cmd-address
+\addtocontents => tex-refs.html#cmd-addtocontents-title
+\addtocounter => tex-refs.html#cmd-addtocounter
+\addtolength => tex-refs.html#cmd-addtolength
+\addvspace => tex-refs.html#cmd-addvspace
+\aleph => tex-refs.html#cmd-misc-symbol-aleph
+\alpha => tex-refs.html#greek-letters-title
+\alph => tex-refs.html#cmd-alph-title
+\angle => tex-refs.html#cmd-misc-symbol-angle
+\appendix => tex-refs.html#cmd-sectioning-appendix
+\approx => tex-refs.html#binary-and-relational-ops-title
+\aput => tex-refs.html#pstricks-attaching
+\Aput => tex-refs.html#pstricks-attaching
+\arabic => tex-refs.html#cmd-arabic-title
+\arccos => tex-refs.html#cmd-math-func-arccos
+\arcsin => tex-refs.html#cmd-math-func-arcsin
+\arctan => tex-refs.html#cmd-math-func-arctan
+array => tex-refs.html#env-array
+\arrows => tex-refs.html#hackers
+\ast => tex-refs.html#binary-and-relational-ops-title
+\author => tex-refs.html#cmd-author
+\autoref => tex-refs.html#hyperref
+\backslash => tex-refs.html#delimiters-title
+\beta => tex-refs.html#greek-letters-title
+\bibitem => tex-refs.html#cmd-bibitem
+\bibliographystyle => tex-refs.html#using-bibtex
+\bibliography => tex-refs.html#using-bibtex
+\bigcap => tex-refs.html#cmd-math-symbol-bigcap
+\bigcup => tex-refs.html#cmd-math-symbol-bigcup
+\bigodot => tex-refs.html#cmd-math-symbol-bigodot
+\bigoplus => tex-refs.html#cmd-math-symbol-bigoplus
+\bigotimes => tex-refs.html#cmd-math-symbol-bigotimes
+\bigskip => tex-refs.html#cmd-bigskip
+\biguplus => tex-refs.html#cmd-math-symbol-biguplus
+\bigvee => tex-refs.html#cmd-math-symbol-bigvee
+\bigwedge => tex-refs.html#cmd-math-symbol-bigwedge
+\bmod => tex-refs.html#cmd-math-func-bmod
+\bm => tex-refs.html#cmd-bm
+\boldsymbol => tex-refs.html#amsmath
+\Box => tex-refs.html#cmd-misc-symbol-box
+\bput => tex-refs.html#pstricks-attaching
+\Bput => tex-refs.html#pstricks-attaching
+\breve => tex-refs.html#accents-chars-math
+\bullet => tex-refs.html#binary-and-relational-ops-title
+\cc => tex-refs.html#cmd-cc
+\cdots => tex-refs.html#cmd-math-misc-cdots
+\cdots => tex-refs.html#ellipsis-title
+\cdot => tex-refs.html#binary-and-relational-ops-title
+\centering => tex-refs.html#cmd-centering
+center => tex-refs.html#env-center
+\chapter => tex-refs.html#cmd-sectioning-chapter
+\check => tex-refs.html#accents-chars-math
+\chi => tex-refs.html#greek-letters-title
+\circlenode => tex-refs.html#pstricks-nodes
+\circle => tex-refs.html#cmd-circle
+\circ => tex-refs.html#binary-and-relational-ops-title
+\cite => tex-refs.html#cmd-cite
+\cleardoublepage => tex-refs.html#cmd-cleardoublepage
+\clearpage => tex-refs.html#cmd-clearpage
+\cline => tex-refs.html#cmd-cline
+\clipbox => tex-refs.html#pstricks-clipping
+\closedshadow => tex-refs.html#safe-tricks
+\closepath => tex-refs.html#safe-tricks
+\closing => tex-refs.html#cmd-closing
+\clubsuit => tex-refs.html#cmd-misc-symbol-clubsuit
+\cnodeput => tex-refs.html#pstricks-nodes
+\cnode => tex-refs.html#pstricks-nodes
+\code => tex-refs.html#hackers
+\coor => tex-refs.html#hackers
+\coprod => tex-refs.html#cmd-math-symbol-coprod
+\cosh => tex-refs.html#cmd-math-func-cosh
+\cos => tex-refs.html#cmd-math-func-cos
+\coth => tex-refs.html#cmd-math-func-coth
+\cot => tex-refs.html#cmd-math-func-cot
+\cput => tex-refs.html#pstricks-framed
+\csc => tex-refs.html#cmd-math-func-csc
+\curveto => tex-refs.html#pretty-safe-tricks
+\dag => tex-refs.html#cmd-other-symbol-dag
+\dashbox => tex-refs.html#cmd-dashbox
+\dataplot => tex-refs.html#pstricks-plots
+\date => tex-refs.html#cmd-date
+\ddots => tex-refs.html#cmd-math-misc-ddots
+\ddots => tex-refs.html#ellipsis-title
+\ddot => tex-refs.html#accents-chars-math
+\degrees => tex-refs.html#pstricks-dimensions
+\deg => tex-refs.html#cmd-math-func-deg
+\delta => tex-refs.html#greek-letters-title
+\Delta => tex-refs.html#greek-letters-title
+\depth => tex-refs.html#cmd-length-pre-depth
+description => tex-refs.html#env-description
+\det => tex-refs.html#cmd-math-func-det
+\diamondsuit => tex-refs.html#cmd-misc-symbol-diamondsuit
+\Diamond => tex-refs.html#cmd-misc-symbol-diamond
+\dim => tex-refs.html#cmd-math-func-dim
+\dim => tex-refs.html#hackers
+\div => tex-refs.html#binary-and-relational-ops-title
+\documentclass => tex-refs.html#starting-and-ending
+\dotfill => tex-refs.html#cmd-dotfill
+\dot => tex-refs.html#accents-chars-math
+\downarrow => tex-refs.html#arrows-title
+\downarrow => tex-refs.html#delimiters-title
+\ell => tex-refs.html#cmd-misc-symbol-ell
+\emph => tex-refs.html#styles-title
+\encl => tex-refs.html#cmd-encl
+\endoverlaybox => tex-refs.html#pstricks-overlays
+\endpscharclip => tex-refs.html#pstricks-stroking
+\endpsclip => tex-refs.html#pstricks-clipping
+\endpspicture => tex-refs.html#pictures
+\endTeXtoEPS => tex-refs.html#pstricks-exporting
+\enlargethispage => tex-refs.html#cmd-enlargethispage
+\ensuremath => tex-refs.html#cmd-math-misc-ensuremath
+enumerate => tex-refs.html#env-enumerate
+\epsilon => tex-refs.html#greek-letters-title
+eqnarray => tex-refs.html#env-eqnarray
+equation => tex-refs.html#env-equation
+\equiv => tex-refs.html#binary-and-relational-ops-title
+\eta => tex-refs.html#greek-letters-title
+\everypsbox => tex-refs.html#pstricks-boxes
+\exists => tex-refs.html#cmd-misc-symbol-exists
+\exp => tex-refs.html#cmd-math-func-exp
+\fbox => tex-refs.html#cmd-fbox
+figure => tex-refs.html#env-figure
+\fileplot => tex-refs.html#pstricks-plots
+\file => tex-refs.html#hackers
+\fill => tex-refs.html#safe-tricks
+\flat => tex-refs.html#cmd-misc-symbol-flat
+\floatname => tex-refs.html#float
+\floatplacement => tex-refs.html#float
+\floatstyle => tex-refs.html#float
+\flqq => tex-refs.html#german
+\flq => tex-refs.html#german
+\flushbottom => tex-refs.html#cmd-flushbottom-title
+flushleft => tex-refs.html#env-flushleft
+flushright => tex-refs.html#env-flushright
+\fnsymbol => tex-refs.html#cmd-fnsymbol-title
+\fontencoding => tex-refs.html#low-dash-level-font-commands-title
+\fontfamily => tex-refs.html#low-dash-level-font-commands-title
+\fontseries => tex-refs.html#low-dash-level-font-commands-title
+\fontshape => tex-refs.html#low-dash-level-font-commands-title
+\fontsizep => tex-refs.html#low-dash-level-font-commands-title
+\footnotemark => tex-refs.html#cmd-footnotemark
+\footnotesize => tex-refs.html#sizes-title
+\footnote => tex-refs.html#cmd-cmd-footnote
+\footnotetext => tex-refs.html#cmd-footnotetext
+\forall => tex-refs.html#cmd-misc-symbol-forall
+\frac => tex-refs.html#cmd-math-misc-frac
+\framebox => tex-refs.html#cmd-framebox
+\framebox => tex-refs.html#cmd-framebox-op-picture-cp
+\frame => tex-refs.html#cmd-frame
+\frqq => tex-refs.html#german
+\frq => tex-refs.html#german
+\fussy => tex-refs.html#cmd-fussy
+\gamma => tex-refs.html#greek-letters-title
+\Gamma => tex-refs.html#greek-letters-title
+\gcd => tex-refs.html#cmd-math-func-gcd
+\geq => tex-refs.html#binary-and-relational-ops-title
+\gg => tex-refs.html#binary-and-relational-ops-title
+\glqq => tex-refs.html#german
+\glq => tex-refs.html#german
+\graphicspath => tex-refs.html#graphicspath
+\grave => tex-refs.html#accents-chars-math
+\grestore => tex-refs.html#safe-tricks
+\grqq => tex-refs.html#german
+\gsave => tex-refs.html#safe-tricks
+\hat => tex-refs.html#accents-chars-math
+\hbar => tex-refs.html#cmd-misc-symbol-hbar
+\heartsuit => tex-refs.html#cmd-misc-symbol-heartsuit
+\height => tex-refs.html#cmd-length-pre-height
+\hfill => tex-refs.html#cmd-hfill
+\hline => tex-refs.html#cmd-hline
+\hom => tex-refs.html#cmd-math-func-hom
+\href => tex-refs.html#hyperref
+\hrulefill => tex-refs.html#cmd-hrulefill
+\hspace => tex-refs.html#cmd-hspace
+\huge => tex-refs.html#sizes-title
+\Huge => tex-refs.html#sizes-title
+\hyertarget => tex-refs.html#hyperref
+\hyperbaseurl => tex-refs.html#hyperref
+\hyperimage => tex-refs.html#hyperref
+\hyperlink => tex-refs.html#hyperref
+\hyperref => tex-refs.html#hyperref
+\hyphenation => tex-refs.html#cmd-hyphenation
+\imath => tex-refs.html#cmd-misc-symbol-imath
+\Im => tex-refs.html#cmd-misc-symbol-im
+\includegraphics => tex-refs.html#includegraphics
+\includeonly => tex-refs.html#cmd-includeonly-title
+\include => tex-refs.html#cmd-include-title
+\indent => tex-refs.html#cmd-indent
+\inf => tex-refs.html#cmd-math-func-inf
+\infty => tex-refs.html#cmd-misc-symbol-infty
+\input => tex-refs.html#cmd-input-title
+\int => tex-refs.html#cmd-math-symbol-int
+\iota => tex-refs.html#greek-letters-title
+itemize => tex-refs.html#env-itemize
+\jmath => tex-refs.html#cmd-misc-symbol-jmath
+\kappa => tex-refs.html#greek-letters-title
+\ker => tex-refs.html#cmd-math-func-ker
+\kill => tex-refs.html#env-tabbing
+\label => tex-refs.html#cmd-label-title
+\lambda => tex-refs.html#greek-letters-title
+\Lambda => tex-refs.html#greek-letters-title
+\langle => tex-refs.html#delimiters-title
+\large => tex-refs.html#sizes-title
+\Large => tex-refs.html#sizes-title
+\LARGE => tex-refs.html#sizes-title
+\ldots => tex-refs.html#cmd-math-misc-ldots
+\ldots => tex-refs.html#ellipsis-title
+\leftarrow => tex-refs.html#arrows-title
+\Leftarrow => tex-refs.html#arrows-title
+\leftrightarrow => tex-refs.html#arrows-title
+\Leftrightarrow => tex-refs.html#arrows-title
+\leq => tex-refs.html#binary-and-relational-ops-title
+letter => tex-refs.html#env-letter
+\lg => tex-refs.html#cmd-math-func-lg
+\liminf => tex-refs.html#cmd-math-func-liminf
+\limsup => tex-refs.html#cmd-math-func-limsup
+\lim => tex-refs.html#cmd-math-func-lim
+\linebreak => tex-refs.html#cmd-linebreak
+\line => tex-refs.html#cmd-line
+\linethickness => tex-refs.html#cmd-linethickness
+\lineto => tex-refs.html#pretty-safe-tricks
+\listof => tex-refs.html#float
+\listplot => tex-refs.html#pstricks-plots
+list => tex-refs.html#env-list
+\ll => tex-refs.html#binary-and-relational-ops-title
+\ln => tex-refs.html#cmd-math-func-ln
+\location => tex-refs.html#cmd-location
+\log => tex-refs.html#cmd-math-func-log
+\longleftarrow => tex-refs.html#arrows-title
+\Longleftarrow => tex-refs.html#arrows-title
+\longleftrightarrow => tex-refs.html#arrows-title
+\longrightarrow => tex-refs.html#arrows-title
+\Longrightarrow => tex-refs.html#arrows-title
+\lput => tex-refs.html#pstricks-attaching
+lrbox => tex-refs.html#env-lrbox
+\makebox => tex-refs.html#cmd-makebox
+\makelabels => tex-refs.html#cmd-makelabels
+\maketitle => tex-refs.html#cmd-maketitle
+\markboth => tex-refs.html#cmd-markboth
+\markright => tex-refs.html#cmd-markright
+\mathbf => tex-refs.html#styles-title
+\mathcal => tex-refs.html#styles-title
+\mathit => tex-refs.html#styles-title
+\mathnormal => tex-refs.html#styles-title
+\mathrm => tex-refs.html#styles-title
+\mathtt => tex-refs.html#styles-title
+\max => tex-refs.html#cmd-math-func-max
+\mbox => tex-refs.html#cmd-mbox
+\medskip => tex-refs.html#cmd-medskip
+minipage => tex-refs.html#env-minipage
+\min => tex-refs.html#cmd-math-func-min
+\movepath => tex-refs.html#safe-tricks
+\moveto => tex-refs.html#safe-tricks
+\mp => tex-refs.html#binary-and-relational-ops-title
+\mput => tex-refs.html#pstricks-attaching
+\mrestore => tex-refs.html#safe-tricks
+\msave => tex-refs.html#safe-tricks
+\multicolumn => tex-refs.html#cmd-multicolumn
+\multips => tex-refs.html#pstricks-repetition
+\multiput => tex-refs.html#cmd-multiput
+\multirput => tex-refs.html#pstricks-repetition
+\mu => tex-refs.html#greek-letters-title
+\nabla => tex-refs.html#cmd-misc-symbol-nabla
+\name => tex-refs.html#cmd-name
+\natural => tex-refs.html#cmd-misc-symbol-natural
+\ncangles => tex-refs.html#pstricks-connections
+\ncangle => tex-refs.html#pstricks-connections
+\ncarc => tex-refs.html#pstricks-connections
+\ncbar => tex-refs.html#pstricks-connections
+\nccircle => tex-refs.html#pstricks-connections
+\nccoil => tex-refs.html#pstricks-coils
+\nccurve => tex-refs.html#pstricks-connections
+\ncdiagg => tex-refs.html#pstricks-connections
+\ncdiag => tex-refs.html#pstricks-connections
+\ncline => tex-refs.html#pstricks-connections
+\ncLine => tex-refs.html#pstricks-connections
+\ncloop => tex-refs.html#pstricks-connections
+\nczigzag => tex-refs.html#pstricks-coils
+\nearrow => tex-refs.html#arrows-title
+\neq => tex-refs.html#binary-and-relational-ops-title
+\newcmykcolor => tex-refs.html#pstricks-color
+\newcommand => tex-refs.html#cmd-newcommand-title
+\newcounter => tex-refs.html#cmd-newcounter-title
+\newenvironment => tex-refs.html#cmd-newenvironment-title
+\newfloat => tex-refs.html#float
+\newfont => tex-refs.html#cmd-newfont-title
+\newgray => tex-refs.html#pstricks-color
+\newhsbcolor => tex-refs.html#pstricks-color
+\newlength => tex-refs.html#cmd-newlength
+\newline => tex-refs.html#cmd-newline
+\newpage => tex-refs.html#cmd-newpage
+\newpath => tex-refs.html#safe-tricks
+\newpsobject => tex-refs.html#pstricks-custom
+newpsstyle => tex-refs.html#pstricks-custom
+\newrgbcolor => tex-refs.html#pstricks-color
+\newsavebox => tex-refs.html#cmd-newsavebox
+\newtheorem => tex-refs.html#cmd-newtheorem-title
+\nocite => tex-refs.html#cmd-nocite
+\noindent => tex-refs.html#cmd-noindent
+\nolinebreak => tex-refs.html#cmd-nolinebreak
+\nolinkurl => tex-refs.html#cmd-nolinkurl
+\nopagebreak => tex-refs.html#cmd-nopagebreak
+\NormalCoor => tex-refs.html#pstricks-coordinates
+\normalsize => tex-refs.html#sizes-title
+\nu => tex-refs.html#greek-letters-title
+\nwarrow => tex-refs.html#arrows-title
+\oint => tex-refs.html#cmd-math-symbol-oint
+\omega => tex-refs.html#greek-letters-title
+\Omega => tex-refs.html#greek-letters-title
+\onecolumn => tex-refs.html#cmd-onecolumn-title
+\opening => tex-refs.html#cmd-opening
+\openshadow => tex-refs.html#safe-tricks
+\ovalnode => tex-refs.html#pstricks-nodes
+\oval => tex-refs.html#cmd-oval
+\overbrace => tex-refs.html#cmd-math-misc-overbrace
+\overlaybox => tex-refs.html#pstricks-overlays
+\overline => tex-refs.html#cmd-math-misc-overline
+\pagebreak => tex-refs.html#cmd-pagebreak
+\pagenumbering => tex-refs.html#cmd-pagenumbering
+\pageref => tex-refs.html#cmd-pageref
+\pagestyle => tex-refs.html#cmd-pagestyle
+\parabola => tex-refs.html#pstricks-curves
+\paragraph => tex-refs.html#cmd-sectioning-paragraph
+\parametricplot => tex-refs.html#pstricks-plots
+\parbox => tex-refs.html#cmd-parbox
+\par => tex-refs.html#cmd-par
+\partial => tex-refs.html#cmd-misc-symbol-partial
+\part => tex-refs.html#cmd-sectioning-part
+\pcangle => tex-refs.html#pstricks-connections
+\pcarc => tex-refs.html#pstricks-connections
+\pcbar => tex-refs.html#pstricks-connections
+\pccoil => tex-refs.html#pstricks-coils
+\pccurve => tex-refs.html#pstricks-connections
+\pcdiag => tex-refs.html#pstricks-connections
+\pcline => tex-refs.html#pstricks-connections
+\pcloop => tex-refs.html#pstricks-connections
+\pczigzag => tex-refs.html#pstricks-coils
+\per => tex-refs.html#binary-and-relational-ops-title
+\phi => tex-refs.html#greek-letters-title
+\Phi => tex-refs.html#greek-letters-title
+picture => tex-refs.html#env-picture
+\pi => tex-refs.html#greek-letters-title
+\Pi => tex-refs.html#greek-letters-title
+\pmb => tex-refs.html#amsmath
+\pmod => tex-refs.html#cmd-math-func-pmod
+\pm => tex-refs.html#binary-and-relational-ops-title
+\pnode => tex-refs.html#pstricks-nodes
+\poptabs => tex-refs.html#env-tabbing
+\prime => tex-refs.html#cmd-misc-symbol-prime
+\prod => tex-refs.html#cmd-math-symbol-prod
+\propto => tex-refs.html#binary-and-relational-ops-title
+\psarcn => tex-refs.html#pstricks-arcs
+\psarc => tex-refs.html#pstricks-arcs
+\psaxes => tex-refs.html#pstricks-axes
+\psbezier => tex-refs.html#pstricks-curves
+\psccurve => tex-refs.html#pstricks-curves
+\pscharclip => tex-refs.html#pstricks-stroking
+\pscharpath => tex-refs.html#pstricks-stroking
+\pscirclebox => tex-refs.html#pstricks-framed
+\pscircle => tex-refs.html#pstricks-arcs
+\psclip => tex-refs.html#pstricks-clipping
+\pscoil => tex-refs.html#pstricks-coils
+\psCoil => tex-refs.html#pstricks-coils
+\pscurve => tex-refs.html#pstricks-curves
+\pscustom => tex-refs.html#pstricks-basics
+\psdblframebox => tex-refs.html#pstricks-framed
+\psdots => tex-refs.html#pstricks-dots
+\psecurve => tex-refs.html#pstricks-curves
+\psellipse => tex-refs.html#pstricks-arcs
+\psframebox => tex-refs.html#pstricks-framed
+\psframe => tex-refs.html#pstricks-lines
+\psgrid => tex-refs.html#pstricks-grids
+\psi => tex-refs.html#greek-letters-title
+\Psi => tex-refs.html#greek-letters-title
+\pslabelsep => tex-refs.html#placing
+\pslbrace => tex-refs.html#pstricks-tricks
+\psline => tex-refs.html#pstricks-lines
+\pslongbox => tex-refs.html#pstricks-boxes
+\psmathboxfalse => tex-refs.html#pstricks-boxes
+\psmathboxtrue => tex-refs.html#pstricks-boxes
+\psovalbox => tex-refs.html#pstricks-framed
+\psoverlay => tex-refs.html#pstricks-overlays
+\pspicture => tex-refs.html#pictures
+\psplot => tex-refs.html#pstricks-plots
+\pspolygon => tex-refs.html#pstricks-lines
+\psrbrace => tex-refs.html#pstricks-tricks
+\pssetlength => tex-refs.html#pstricks-dimensions
+\psset => tex-refs.html#pstricks-setting
+\psshadowbox => tex-refs.html#pstricks-framed
+\ps => tex-refs.html#cmd-ps
+\pstextpath => tex-refs.html#pstricks-path
+\PSTtoEPS => tex-refs.html#pstricks-exporting
+\psverbboxfalse => tex-refs.html#pstricks-boxes
+\psverbboxtrue => tex-refs.html#pstricks-boxes
+\pswedge => tex-refs.html#pstricks-arcs
+\pszigzag => tex-refs.html#pstricks-coils
+\pushtabs => tex-refs.html#env-tabbing
+\putoverlaybox => tex-refs.html#pstricks-overlays
+\put => tex-refs.html#cmd-put
+\qdisk => tex-refs.html#pstricks-arcs
+\qline => tex-refs.html#pstricks-lines
+quotation => tex-refs.html#env-quotation
+quote => tex-refs.html#env-quote
+\radians => tex-refs.html#pstricks-dimensions
+\raggedbottom => tex-refs.html#cmd-raggedbottom-title
+\raggedleft => tex-refs.html#cmd-raggedleft
+\raggedright => tex-refs.html#cmd-raggedright
+\raisebox => tex-refs.html#cmd-raisebox
+\rangle => tex-refs.html#delimiters-title
+\rcoor => tex-refs.html#hackers
+\rcurveto => tex-refs.html#pretty-safe-tricks
+\readdata => tex-refs.html#pstricks-plots
+\refstepcounter => tex-refs.html#cmd-refstepcounter-title
+\ref => tex-refs.html#cmd-ref-title
+\restylefloat => tex-refs.html#float
+\Re => tex-refs.html#cmd-misc-symbol-re
+\rho => tex-refs.html#greek-letters-title
+\rightarrow => tex-refs.html#arrows-title
+\Rightarrow => tex-refs.html#arrows-title
+\rlineto => tex-refs.html#pretty-safe-tricks
+\RnodeRef => tex-refs.html#pstricks-nodes
+\rnode => tex-refs.html#pstricks-nodes
+\Rnode => tex-refs.html#pstricks-nodes
+\rotatedown => tex-refs.html#pstricks-rotation
+\rotateleft => tex-refs.html#pstricks-rotation
+\rotateright => tex-refs.html#pstricks-rotation
+\rotate => tex-refs.html#safe-tricks
+\rput => tex-refs.html#placing
+\rule => tex-refs.html#cmd-rule
+\samepage => tex-refs.html#cmd-samepage
+\savebox => tex-refs.html#cmd-savebox
+\savedata => tex-refs.html#pstricks-plots
+\sbox => tex-refs.html#cmd-sbox
+\scalebox => tex-refs.html#pstricks-rotation
+\scaleboxto => tex-refs.html#pstricks-rotation
+\scale => tex-refs.html#safe-tricks
+\scriptsize => tex-refs.html#sizes-title
+\searrow => tex-refs.html#arrows-title
+\sec => tex-refs.html#cmd-math-func-sec
+\section => tex-refs.html#cmd-sectioning-section
+\selectfont => tex-refs.html#low-dash-level-font-commands-title
+\setcolor => tex-refs.html#hackers
+\setcounter => tex-refs.html#cmd-setcounter-title
+\setlength => tex-refs.html#cmd-setlength
+\settodepth => tex-refs.html#cmd-settodepth
+\settoheight => tex-refs.html#cmd-settoheight
+\settowidth => tex-refs.html#cmd-settowidth
+\shortstack => tex-refs.html#cmd-shortstack
+\sigma => tex-refs.html#greek-letters-title
+\Sigma => tex-refs.html#greek-letters-title
+\signature => tex-refs.html#cmd-signature
+\simeq => tex-refs.html#binary-and-relational-ops-title
+\sim => tex-refs.html#binary-and-relational-ops-title
+\sinh => tex-refs.html#cmd-math-func-sinh
+\sin => tex-refs.html#cmd-math-func-sin
+\sloppy => tex-refs.html#cmd-sloppy
+\smallskip => tex-refs.html#cmd-smallskip
+\small => tex-refs.html#sizes-title
+\spadesuit => tex-refs.html#cmd-misc-symbol-spadsuit
+\SpecialCoor => tex-refs.html#pstricks-coordinates
+\sqrt => tex-refs.html#cmd-math-misc-sqrt
+\startbreaks => tex-refs.html#cmd-startbreaks
+\star => tex-refs.html#binary-and-relational-ops-title
+\stepcounter => tex-refs.html#cmd-stepcounter-title
+\stopbreaks => tex-refs.html#cmd-stopbreaks
+\stroke => tex-refs.html#safe-tricks
+\subparagraph => tex-refs.html#cmd-sectioning-subparagraph
+\subsection => tex-refs.html#cmd-sectioning-subsection
+\subset => tex-refs.html#binary-and-relational-ops-title
+\subsubsection => tex-refs.html#cmd-sectioning-subsubsection
+\sum => tex-refs.html#cmd-math-symbol-sum
+\sup => tex-refs.html#cmd-math-func-sup
+\surd => tex-refs.html#cmd-misc-symbol-surd
+\swapaxes => tex-refs.html#safe-tricks
+\swarrow => tex-refs.html#arrows-title
+tabbing => tex-refs.html#env-tabbing
+table => tex-refs.html#env-table
+tabular => tex-refs.html#env-tabular
+\tanh => tex-refs.html#cmd-math-func-tanh
+\tan => tex-refs.html#cmd-math-func-tan
+\tau => tex-refs.html#greek-letters-title
+\telephone => tex-refs.html#cmd-telephone
+\texorpdfstring => tex-refs.html#hyperref
+\textbf => tex-refs.html#styles-title
+\textit => tex-refs.html#styles-title
+\textmd => tex-refs.html#styles-title
+\textnormal => tex-refs.html#styles-title
+\TeXtoEPS => tex-refs.html#pstricks-exporting
+\textrm => tex-refs.html#styles-title
+\textsc => tex-refs.html#styles-title
+\textsf => tex-refs.html#styles-title
+\textsl => tex-refs.html#styles-title
+\texttt => tex-refs.html#styles-title
+\textup => tex-refs.html#styles-title
+\thanks => tex-refs.html#cmd-thanks
+thebibliography => tex-refs.html#env-thebibliography
+theorem => tex-refs.html#env-theorem
+\theta => tex-refs.html#greek-letters-title
+\Theta => tex-refs.html#greek-letters-title
+\thispagestyle => tex-refs.html#cmd-thispagestyle
+\tilde => tex-refs.html#accents-chars-math
+\times => tex-refs.html#binary-and-relational-ops-title
+\tiny => tex-refs.html#sizes-title
+titlepage => tex-refs.html#env-titlepage
+\title => tex-refs.html#cmd-title
+\totalheight => tex-refs.html#cmd-length-pre-totalheight
+\translate => tex-refs.html#safe-tricks
+\triangle => tex-refs.html#cmd-misc-symbol-triangle
+\twocolumn => tex-refs.html#cmd-twocolumn-title
+\typein => tex-refs.html#cmd-typein-title
+\typeout => tex-refs.html#cmd-typeout-title
+\underbrace => tex-refs.html#cmd-math-misc-underbrace
+\underline => tex-refs.html#cmd-math-misc-underline
+\uparrow => tex-refs.html#arrows-title
+\Uparrow => tex-refs.html#arrows-title
+\uparrow => tex-refs.html#delimiters-title
+\updownarrow => tex-refs.html#delimiters-title
+\upsilon => tex-refs.html#greek-letters-title
+\Upsilon => tex-refs.html#greek-letters-title
+\uput => tex-refs.html#placing
+\usebox => tex-refs.html#cmd-usebox
+\usecounter => tex-refs.html#cmd-usecounter-title
+\usepackage => tex-refs.html#usepackage-linkend
+\value => tex-refs.html#cmd-value-title
+\varepsilon => tex-refs.html#greek-letters-title
+\varphi => tex-refs.html#greek-letters-title
+\varpi => tex-refs.html#greek-letters-title
+\varrho => tex-refs.html#greek-letters-title
+\varsigma => tex-refs.html#greek-letters-title
+\vartheta => tex-refs.html#greek-letters-title
+\vdots => tex-refs.html#cmd-math-misc-vdots
+\vdots => tex-refs.html#ellipsis-title
+\vec => tex-refs.html#accents-chars-math
+\vector => tex-refs.html#cmd-vector
+verbatim => tex-refs.html#env-verbatim
+\verb => tex-refs.html#cmd-verb
+verse => tex-refs.html#env-verse
+\vert => tex-refs.html#delimiters-title
+\Vert => tex-refs.html#delimiters-title
+\vfill => tex-refs.html#cmd-vfill
+\vline => tex-refs.html#cmd-vline
+\vpagerefrange => tex-refs.html#varioref
+\vpageref => tex-refs.html#cmd-vpageref
+\vrefrange => tex-refs.html#varioref
+\vref => tex-refs.html#cmd-vref
+\vspace => tex-refs.html#cmd-vspace
+\widehat => tex-refs.html#accents-chars-math
+\widetilde => tex-refs.html#accents-chars-math
+\width => tex-refs.html#cmd-length-pre-width
+\wp => tex-refs.html#cmd-misc-symbol-wp
+\xi => tex-refs.html#greek-letters-title
+\Xi => tex-refs.html#greek-letters-title
+\zeta => tex-refs.html#greek-letters-title
diff --git a/src/kile/helpconfigwidget.ui b/src/kile/helpconfigwidget.ui
new file mode 100644
index 0000000..2588736
--- /dev/null
+++ b/src/kile/helpconfigwidget.ui
@@ -0,0 +1,178 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KileWidgetHelpConfig</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KileWidgetHelpConfig</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>436</width>
+ <height>309</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Help</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_lbLocation</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Location of TeX documentation:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_location</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Insert the path to the TeX documentation directory here. For example /usr/share/texmf/doc.</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>kcfg_location</cstring>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>kcfg_use</cstring>
+ </property>
+ <property name="title">
+ <string>Context Sensitive Help</string>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_rbTeTeX</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>59</y>
+ <width>358</width>
+ <height>26</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Use your system's &amp;TeX documentation</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_rbKileRef</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>27</y>
+ <width>358</width>
+ <height>26</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Use the &amp;Kile LaTeX reference</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>0</number>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QButtonGroup" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>kcfg_embedded</cstring>
+ </property>
+ <property name="title">
+ <string>User Help</string>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_rbEmbedded</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>80</y>
+ <width>358</width>
+ <height>26</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Use &amp;embedded viewer</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_rbExternal</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>110</y>
+ <width>401</width>
+ <height>26</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Show help file in a &amp;separate window</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pbConfigure</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>30</y>
+ <width>130</width>
+ <height>34</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Con&amp;figure...</string>
+ </property>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>m_pbConfigure</sender>
+ <signal>clicked()</signal>
+ <receiver>KileWidgetHelpConfig</receiver>
+ <slot>slotConfigure()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">kilehelp.h</include>
+ <include location="local" impldecl="in implementation">helpconfigwidget.ui.h</include>
+</includes>
+<forwards>
+ <forward>namespace KileHelp { class Help; } class avoid_compile_error</forward>
+</forwards>
+<variables>
+ <variable access="private">KileHelp::Help *m_help;</variable>
+</variables>
+<slots>
+ <slot access="private" specifier="nicht virtual">slotConfigure()</slot>
+</slots>
+<functions>
+ <function specifier="non virtual">setHelp( KileHelp::Help * help )</function>
+</functions>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/src/kile/helpconfigwidget.ui.h b/src/kile/helpconfigwidget.ui.h
new file mode 100644
index 0000000..7403127
--- /dev/null
+++ b/src/kile/helpconfigwidget.ui.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you want to add, delete, or rename functions or slots, use
+** Qt Designer to update this file, preserving your code.
+**
+** You should not define a constructor or destructor in this file.
+** Instead, write your code in functions called init() and destroy().
+** These will automatically be called by the form's constructor and
+** destructor.
+*****************************************************************************/
+
+void KileWidgetHelpConfig::slotConfigure()
+{
+ m_help->userHelpDialog();
+}
+
+
+
+void KileWidgetHelpConfig::setHelp( KileHelp::Help *help )
+{
+ m_help = help;
+}
diff --git a/src/kile/icons/CMakeLists.txt b/src/kile/icons/CMakeLists.txt
new file mode 100644
index 0000000..a7471d9
--- /dev/null
+++ b/src/kile/icons/CMakeLists.txt
@@ -0,0 +1,11 @@
+ADD_SUBDIRECTORY( actions )
+
+INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${KDE3_INCLUDE_DIR} ${QT_INCLUDE_DIR} )
+
+INCLUDE(KDE3Macros)
+
+########### install files ###############
+
+
+KDE3_INSTALL_ICONS( hicolor )
+
diff --git a/src/kile/icons/Makefile.am b/src/kile/icons/Makefile.am
new file mode 100644
index 0000000..e8f1605
--- /dev/null
+++ b/src/kile/icons/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS=actions
+KDE_ICON = AUTO
diff --git a/src/kile/icons/actions/CMakeLists.txt b/src/kile/icons/actions/CMakeLists.txt
new file mode 100644
index 0000000..9c1c204
--- /dev/null
+++ b/src/kile/icons/actions/CMakeLists.txt
@@ -0,0 +1,11 @@
+INCLUDE(KDE3Macros)
+
+########### install files ###############
+
+
+KDE3_INSTALL_ICONS( hicolor )
+
+#original Makefile.am contents follow:
+
+#kileiconsdir = $(kde_datadir)/kile/icons
+#kileicons_ICON = AUTO
diff --git a/src/kile/icons/actions/Makefile.am b/src/kile/icons/actions/Makefile.am
new file mode 100644
index 0000000..3eb69a1
--- /dev/null
+++ b/src/kile/icons/actions/Makefile.am
@@ -0,0 +1,2 @@
+kileiconsdir = $(kde_datadir)/kile/icons
+kileicons_ICON = AUTO
diff --git a/src/kile/icons/actions/hi16-action-acute.png b/src/kile/icons/actions/hi16-action-acute.png
new file mode 100644
index 0000000..c7c2d5e
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-acute.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-bar.png b/src/kile/icons/actions/hi16-action-bar.png
new file mode 100644
index 0000000..d1c3c3f
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-bar.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-beamerblock.png b/src/kile/icons/actions/hi16-action-beamerblock.png
new file mode 100644
index 0000000..de997f7
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-beamerblock.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-beamerframe.png b/src/kile/icons/actions/hi16-action-beamerframe.png
new file mode 100644
index 0000000..b89f02d
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-beamerframe.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-binom.png b/src/kile/icons/actions/hi16-action-binom.png
new file mode 100644
index 0000000..c05816e
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-binom.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-breve.png b/src/kile/icons/actions/hi16-action-breve.png
new file mode 100644
index 0000000..e7b3e02
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-breve.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-chapter.png b/src/kile/icons/actions/hi16-action-chapter.png
new file mode 100644
index 0000000..cb29fd0
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-chapter.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-check.png b/src/kile/icons/actions/hi16-action-check.png
new file mode 100644
index 0000000..9787c3f
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-check.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-closeallenv.png b/src/kile/icons/actions/hi16-action-closeallenv.png
new file mode 100644
index 0000000..fc59785
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-closeallenv.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-closeenv.png b/src/kile/icons/actions/hi16-action-closeenv.png
new file mode 100644
index 0000000..4e164fc
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-closeenv.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-closegroup.png b/src/kile/icons/actions/hi16-action-closegroup.png
new file mode 100644
index 0000000..3995d42
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-closegroup.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-complete1.png b/src/kile/icons/actions/hi16-action-complete1.png
new file mode 100644
index 0000000..929ad3f
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-complete1.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-complete2.png b/src/kile/icons/actions/hi16-action-complete2.png
new file mode 100644
index 0000000..1725693
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-complete2.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-complete3.png b/src/kile/icons/actions/hi16-action-complete3.png
new file mode 100644
index 0000000..e521b7a
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-complete3.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-configure_kile.png b/src/kile/icons/actions/hi16-action-configure_kile.png
new file mode 100644
index 0000000..519431e
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-configure_kile.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-configure_project.png b/src/kile/icons/actions/hi16-action-configure_project.png
new file mode 100644
index 0000000..24dc3ae
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-configure_project.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-ddot.png b/src/kile/icons/actions/hi16-action-ddot.png
new file mode 100644
index 0000000..db0e653
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-ddot.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-delenv_i.png b/src/kile/icons/actions/hi16-action-delenv_i.png
new file mode 100644
index 0000000..c4aac87
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-delenv_i.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-delenv_o.png b/src/kile/icons/actions/hi16-action-delenv_o.png
new file mode 100644
index 0000000..af497e7
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-delenv_o.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-deleol.png b/src/kile/icons/actions/hi16-action-deleol.png
new file mode 100644
index 0000000..31856d4
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-deleol.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-delete.png b/src/kile/icons/actions/hi16-action-delete.png
new file mode 100644
index 0000000..7d63c7e
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-delete.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-delgroup_i.png b/src/kile/icons/actions/hi16-action-delgroup_i.png
new file mode 100644
index 0000000..a56761e
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-delgroup_i.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-delgroup_o.png b/src/kile/icons/actions/hi16-action-delgroup_o.png
new file mode 100644
index 0000000..9410e54
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-delgroup_o.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-delline.png b/src/kile/icons/actions/hi16-action-delline.png
new file mode 100644
index 0000000..53ad84c
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-delline.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-delmath.png b/src/kile/icons/actions/hi16-action-delmath.png
new file mode 100644
index 0000000..538b45f
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-delmath.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-delpar.png b/src/kile/icons/actions/hi16-action-delpar.png
new file mode 100644
index 0000000..a4107d7
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-delpar.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-delword.png b/src/kile/icons/actions/hi16-action-delword.png
new file mode 100644
index 0000000..04b6215
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-delword.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-description.png b/src/kile/icons/actions/hi16-action-description.png
new file mode 100644
index 0000000..2b99a40
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-description.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-dot.png b/src/kile/icons/actions/hi16-action-dot.png
new file mode 100644
index 0000000..33bb8c2
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-dot.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-enumerate.png b/src/kile/icons/actions/hi16-action-enumerate.png
new file mode 100644
index 0000000..0d8b86d
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-enumerate.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-eqnarray.png b/src/kile/icons/actions/hi16-action-eqnarray.png
new file mode 100644
index 0000000..ecfd2a5
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-eqnarray.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-equation.png b/src/kile/icons/actions/hi16-action-equation.png
new file mode 100644
index 0000000..5f1795f
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-equation.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-file.png b/src/kile/icons/actions/hi16-action-file.png
new file mode 100644
index 0000000..48fa699
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-file.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-gotobeginenv.png b/src/kile/icons/actions/hi16-action-gotobeginenv.png
new file mode 100644
index 0000000..7e21652
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-gotobeginenv.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-gotobegingroup.png b/src/kile/icons/actions/hi16-action-gotobegingroup.png
new file mode 100644
index 0000000..b0f6ee1
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-gotobegingroup.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-gotoendenv.png b/src/kile/icons/actions/hi16-action-gotoendenv.png
new file mode 100644
index 0000000..b3c3a7f
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-gotoendenv.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-gotoendgroup.png b/src/kile/icons/actions/hi16-action-gotoendgroup.png
new file mode 100644
index 0000000..7ba128b
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-gotoendgroup.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-graphics.png b/src/kile/icons/actions/hi16-action-graphics.png
new file mode 100644
index 0000000..97ed040
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-graphics.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-grave.png b/src/kile/icons/actions/hi16-action-grave.png
new file mode 100644
index 0000000..d2f7e86
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-grave.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-hat.png b/src/kile/icons/actions/hi16-action-hat.png
new file mode 100644
index 0000000..5d9838c
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-hat.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-include.png b/src/kile/icons/actions/hi16-action-include.png
new file mode 100644
index 0000000..cd04b1f
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-include.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-item.png b/src/kile/icons/actions/hi16-action-item.png
new file mode 100644
index 0000000..ffe7855
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-item.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-itemize.png b/src/kile/icons/actions/hi16-action-itemize.png
new file mode 100644
index 0000000..c6c7f11
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-itemize.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-js.png b/src/kile/icons/actions/hi16-action-js.png
new file mode 100644
index 0000000..5a9cfa5
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-js.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-label.png b/src/kile/icons/actions/hi16-action-label.png
new file mode 100644
index 0000000..8528ced
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-label.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-masteritem.png b/src/kile/icons/actions/hi16-action-masteritem.png
new file mode 100644
index 0000000..f49922c
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-masteritem.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-matchenv.png b/src/kile/icons/actions/hi16-action-matchenv.png
new file mode 100644
index 0000000..a0703f1
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-matchenv.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-matchgroup.png b/src/kile/icons/actions/hi16-action-matchgroup.png
new file mode 100644
index 0000000..ccb7ed2
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-matchgroup.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-math0.png b/src/kile/icons/actions/hi16-action-math0.png
new file mode 100644
index 0000000..e1f30b2
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-math0.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-math1.png b/src/kile/icons/actions/hi16-action-math1.png
new file mode 100644
index 0000000..294b808
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-math1.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-math10.png b/src/kile/icons/actions/hi16-action-math10.png
new file mode 100644
index 0000000..dee3af2
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-math10.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-math2.png b/src/kile/icons/actions/hi16-action-math2.png
new file mode 100644
index 0000000..14d374e
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-math2.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-math3.png b/src/kile/icons/actions/hi16-action-math3.png
new file mode 100644
index 0000000..2d14c68
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-math3.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-math4.png b/src/kile/icons/actions/hi16-action-math4.png
new file mode 100644
index 0000000..e13ef24
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-math4.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-math5.png b/src/kile/icons/actions/hi16-action-math5.png
new file mode 100644
index 0000000..8b58b24
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-math5.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-math6.png b/src/kile/icons/actions/hi16-action-math6.png
new file mode 100644
index 0000000..ff2b708
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-math6.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-math7.png b/src/kile/icons/actions/hi16-action-math7.png
new file mode 100644
index 0000000..15c6ca8
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-math7.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-math8.png b/src/kile/icons/actions/hi16-action-math8.png
new file mode 100644
index 0000000..69e8b17
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-math8.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-math9.png b/src/kile/icons/actions/hi16-action-math9.png
new file mode 100644
index 0000000..584fef0
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-math9.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-mathmode.png b/src/kile/icons/actions/hi16-action-mathmode.png
new file mode 100644
index 0000000..6f3e17a
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-mathmode.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-minipage.png b/src/kile/icons/actions/hi16-action-minipage.png
new file mode 100644
index 0000000..411c3cd
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-minipage.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-nextbullet.png b/src/kile/icons/actions/hi16-action-nextbullet.png
new file mode 100644
index 0000000..d5a7543
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-nextbullet.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-nextparagraph.png b/src/kile/icons/actions/hi16-action-nextparagraph.png
new file mode 100644
index 0000000..cec170c
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-nextparagraph.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-nextsection.png b/src/kile/icons/actions/hi16-action-nextsection.png
new file mode 100644
index 0000000..6735abf
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-nextsection.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-nroot.png b/src/kile/icons/actions/hi16-action-nroot.png
new file mode 100644
index 0000000..7769a71
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-nroot.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-part.png b/src/kile/icons/actions/hi16-action-part.png
new file mode 100644
index 0000000..c0b1f8a
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-part.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-prevbullet.png b/src/kile/icons/actions/hi16-action-prevbullet.png
new file mode 100644
index 0000000..24ac8f0
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-prevbullet.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-prevparagraph.png b/src/kile/icons/actions/hi16-action-prevparagraph.png
new file mode 100644
index 0000000..0fac9d2
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-prevparagraph.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-prevsection.png b/src/kile/icons/actions/hi16-action-prevsection.png
new file mode 100644
index 0000000..bd008c0
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-prevsection.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-projectitem.png b/src/kile/icons/actions/hi16-action-projectitem.png
new file mode 100644
index 0000000..a28ac92
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-projectitem.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-refreshstructure.png b/src/kile/icons/actions/hi16-action-refreshstructure.png
new file mode 100644
index 0000000..b4ec789
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-refreshstructure.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-relation.png b/src/kile/icons/actions/hi16-action-relation.png
new file mode 100644
index 0000000..6ad3e0b
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-relation.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-scriptnew.png b/src/kile/icons/actions/hi16-action-scriptnew.png
new file mode 100644
index 0000000..d54660f
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-scriptnew.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-scriptopen.png b/src/kile/icons/actions/hi16-action-scriptopen.png
new file mode 100644
index 0000000..7a32291
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-scriptopen.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-section.png b/src/kile/icons/actions/hi16-action-section.png
new file mode 100644
index 0000000..1f47dbe
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-section.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-selenv_i.png b/src/kile/icons/actions/hi16-action-selenv_i.png
new file mode 100644
index 0000000..1062b29
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-selenv_i.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-selenv_o.png b/src/kile/icons/actions/hi16-action-selenv_o.png
new file mode 100644
index 0000000..4c753ca
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-selenv_o.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-selgroup_i.png b/src/kile/icons/actions/hi16-action-selgroup_i.png
new file mode 100644
index 0000000..3ea9420
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-selgroup_i.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-selgroup_o.png b/src/kile/icons/actions/hi16-action-selgroup_o.png
new file mode 100644
index 0000000..5faf92a
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-selgroup_o.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-selline.png b/src/kile/icons/actions/hi16-action-selline.png
new file mode 100644
index 0000000..f1b509a
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-selline.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-selmath.png b/src/kile/icons/actions/hi16-action-selmath.png
new file mode 100644
index 0000000..0fc9be2
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-selmath.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-selpar.png b/src/kile/icons/actions/hi16-action-selpar.png
new file mode 100644
index 0000000..c8f85ac
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-selpar.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-selword.png b/src/kile/icons/actions/hi16-action-selword.png
new file mode 100644
index 0000000..3ff1476
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-selword.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-smallfrac.png b/src/kile/icons/actions/hi16-action-smallfrac.png
new file mode 100644
index 0000000..84f5b96
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-smallfrac.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-structure.png b/src/kile/icons/actions/hi16-action-structure.png
new file mode 100644
index 0000000..0e1c83c
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-structure.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-subsection.png b/src/kile/icons/actions/hi16-action-subsection.png
new file mode 100644
index 0000000..8b63d22
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-subsection.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-subsubsection.png b/src/kile/icons/actions/hi16-action-subsubsection.png
new file mode 100644
index 0000000..66c1e26
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-subsubsection.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-tilde.png b/src/kile/icons/actions/hi16-action-tilde.png
new file mode 100644
index 0000000..688bd5a
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-tilde.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-vec.png b/src/kile/icons/actions/hi16-action-vec.png
new file mode 100644
index 0000000..e3673ac
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-vec.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-verb.png b/src/kile/icons/actions/hi16-action-verb.png
new file mode 100644
index 0000000..bda8ba2
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-verb.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-verbatim.png b/src/kile/icons/actions/hi16-action-verbatim.png
new file mode 100644
index 0000000..b6aafe1
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-verbatim.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-viewdvi.png b/src/kile/icons/actions/hi16-action-viewdvi.png
new file mode 100644
index 0000000..c5ab476
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-viewdvi.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-viewhtml.png b/src/kile/icons/actions/hi16-action-viewhtml.png
new file mode 100644
index 0000000..bbcaacd
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-viewhtml.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-viewpdf.png b/src/kile/icons/actions/hi16-action-viewpdf.png
new file mode 100644
index 0000000..abe0fc3
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-viewpdf.png
Binary files differ
diff --git a/src/kile/icons/actions/hi16-action-viewps.png b/src/kile/icons/actions/hi16-action-viewps.png
new file mode 100644
index 0000000..17133a9
--- /dev/null
+++ b/src/kile/icons/actions/hi16-action-viewps.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-array.png b/src/kile/icons/actions/hi22-action-array.png
new file mode 100644
index 0000000..4edecf3
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-array.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-bboxnext.png b/src/kile/icons/actions/hi22-action-bboxnext.png
new file mode 100644
index 0000000..86c10d5
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-bboxnext.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-bboxprev.png b/src/kile/icons/actions/hi22-action-bboxprev.png
new file mode 100644
index 0000000..02e232a
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-bboxprev.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-binom.png b/src/kile/icons/actions/hi22-action-binom.png
new file mode 100644
index 0000000..933f49e
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-binom.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-cline.png b/src/kile/icons/actions/hi22-action-cline.png
new file mode 100644
index 0000000..961c543
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-cline.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-complete1.png b/src/kile/icons/actions/hi22-action-complete1.png
new file mode 100644
index 0000000..80548bd
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-complete1.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-complete2.png b/src/kile/icons/actions/hi22-action-complete2.png
new file mode 100644
index 0000000..08bb81e
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-complete2.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-complete3.png b/src/kile/icons/actions/hi22-action-complete3.png
new file mode 100644
index 0000000..a775c72
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-complete3.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-configure_kile.png b/src/kile/icons/actions/hi22-action-configure_kile.png
new file mode 100644
index 0000000..2f3af44
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-configure_kile.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-configure_project.png b/src/kile/icons/actions/hi22-action-configure_project.png
new file mode 100644
index 0000000..60b1ebd
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-configure_project.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-convert.png b/src/kile/icons/actions/hi22-action-convert.png
new file mode 100644
index 0000000..6bb9ccf
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-convert.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-description.png b/src/kile/icons/actions/hi22-action-description.png
new file mode 100644
index 0000000..dceb92e
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-description.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-dfrac.png b/src/kile/icons/actions/hi22-action-dfrac.png
new file mode 100644
index 0000000..3b3a492
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-dfrac.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-displaymathmode.png b/src/kile/icons/actions/hi22-action-displaymathmode.png
new file mode 100644
index 0000000..25789e2
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-displaymathmode.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-emph.png b/src/kile/icons/actions/hi22-action-emph.png
new file mode 100644
index 0000000..5893ba9
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-emph.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-enumerate.png b/src/kile/icons/actions/hi22-action-enumerate.png
new file mode 100644
index 0000000..e6c0075
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-enumerate.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-eqnarray.png b/src/kile/icons/actions/hi22-action-eqnarray.png
new file mode 100644
index 0000000..28c7a25
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-eqnarray.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-equation.png b/src/kile/icons/actions/hi22-action-equation.png
new file mode 100644
index 0000000..9be4032
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-equation.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-errornext.png b/src/kile/icons/actions/hi22-action-errornext.png
new file mode 100644
index 0000000..a123656
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-errornext.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-errorprev.png b/src/kile/icons/actions/hi22-action-errorprev.png
new file mode 100644
index 0000000..e4cd9d3
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-errorprev.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-filegrep.png b/src/kile/icons/actions/hi22-action-filegrep.png
new file mode 100644
index 0000000..86f4440
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-filegrep.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-hline.png b/src/kile/icons/actions/hi22-action-hline.png
new file mode 100644
index 0000000..f8c54f8
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-hline.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-item.png b/src/kile/icons/actions/hi22-action-item.png
new file mode 100644
index 0000000..d3b4396
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-item.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-itemize.png b/src/kile/icons/actions/hi22-action-itemize.png
new file mode 100644
index 0000000..9b52812
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-itemize.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-js.png b/src/kile/icons/actions/hi22-action-js.png
new file mode 100644
index 0000000..0b4fc82
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-js.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-jspage.png b/src/kile/icons/actions/hi22-action-jspage.png
new file mode 100644
index 0000000..2dd1d23
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-jspage.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-label.png b/src/kile/icons/actions/hi22-action-label.png
new file mode 100644
index 0000000..32b4ca2
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-label.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-master.png b/src/kile/icons/actions/hi22-action-master.png
new file mode 100644
index 0000000..61a2f34
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-master.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-minipage.png b/src/kile/icons/actions/hi22-action-minipage.png
new file mode 100644
index 0000000..18e47c4
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-minipage.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-multicolumn.png b/src/kile/icons/actions/hi22-action-multicolumn.png
new file mode 100644
index 0000000..d2e2181
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-multicolumn.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-newline.png b/src/kile/icons/actions/hi22-action-newline.png
new file mode 100644
index 0000000..c204da2
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-newline.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-nroot.png b/src/kile/icons/actions/hi22-action-nroot.png
new file mode 100644
index 0000000..77df234
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-nroot.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-output_win.png b/src/kile/icons/actions/hi22-action-output_win.png
new file mode 100644
index 0000000..56b4373
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-output_win.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-preview_env.png b/src/kile/icons/actions/hi22-action-preview_env.png
new file mode 100644
index 0000000..9cac746
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-preview_env.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-preview_sel.png b/src/kile/icons/actions/hi22-action-preview_sel.png
new file mode 100644
index 0000000..7061f34
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-preview_sel.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-preview_subdoc.png b/src/kile/icons/actions/hi22-action-preview_subdoc.png
new file mode 100644
index 0000000..953a3d2
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-preview_subdoc.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-project_add.png b/src/kile/icons/actions/hi22-action-project_add.png
new file mode 100644
index 0000000..ddedf0b
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-project_add.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-project_remove.png b/src/kile/icons/actions/hi22-action-project_remove.png
new file mode 100644
index 0000000..277af20
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-project_remove.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-project_show.png b/src/kile/icons/actions/hi22-action-project_show.png
new file mode 100644
index 0000000..353c658
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-project_show.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-projectgrep.png b/src/kile/icons/actions/hi22-action-projectgrep.png
new file mode 100644
index 0000000..1645f1b
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-projectgrep.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-quick.png b/src/kile/icons/actions/hi22-action-quick.png
new file mode 100644
index 0000000..e5d2b33
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-quick.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-quickwizard.png b/src/kile/icons/actions/hi22-action-quickwizard.png
new file mode 100644
index 0000000..53b0167
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-quickwizard.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-refreshstructure.png b/src/kile/icons/actions/hi22-action-refreshstructure.png
new file mode 100644
index 0000000..4d6779b
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-refreshstructure.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-scriptnew.png b/src/kile/icons/actions/hi22-action-scriptnew.png
new file mode 100644
index 0000000..ceac4db
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-scriptnew.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-scriptopen.png b/src/kile/icons/actions/hi22-action-scriptopen.png
new file mode 100644
index 0000000..2445f3a
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-scriptopen.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-slanted.png b/src/kile/icons/actions/hi22-action-slanted.png
new file mode 100644
index 0000000..d7adf64
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-slanted.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-strong.png b/src/kile/icons/actions/hi22-action-strong.png
new file mode 100644
index 0000000..b58de15
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-strong.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-tabbing.png b/src/kile/icons/actions/hi22-action-tabbing.png
new file mode 100644
index 0000000..4b4f741
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-tabbing.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-tabular.png b/src/kile/icons/actions/hi22-action-tabular.png
new file mode 100644
index 0000000..75f5d35
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-tabular.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-typewriter.png b/src/kile/icons/actions/hi22-action-typewriter.png
new file mode 100644
index 0000000..333557b
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-typewriter.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-verb.png b/src/kile/icons/actions/hi22-action-verb.png
new file mode 100644
index 0000000..fc2cdc4
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-verb.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-verbatim.png b/src/kile/icons/actions/hi22-action-verbatim.png
new file mode 100644
index 0000000..c6fade8
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-verbatim.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-viewdvi.png b/src/kile/icons/actions/hi22-action-viewdvi.png
new file mode 100644
index 0000000..bec3084
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-viewdvi.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-viewhtml.png b/src/kile/icons/actions/hi22-action-viewhtml.png
new file mode 100644
index 0000000..327fabf
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-viewhtml.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-viewlog.png b/src/kile/icons/actions/hi22-action-viewlog.png
new file mode 100644
index 0000000..14bdf5d
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-viewlog.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-viewpdf.png b/src/kile/icons/actions/hi22-action-viewpdf.png
new file mode 100644
index 0000000..518152f
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-viewpdf.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-viewps.png b/src/kile/icons/actions/hi22-action-viewps.png
new file mode 100644
index 0000000..74ba789
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-viewps.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-vline.png b/src/kile/icons/actions/hi22-action-vline.png
new file mode 100644
index 0000000..04e422a
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-vline.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-warnnext.png b/src/kile/icons/actions/hi22-action-warnnext.png
new file mode 100644
index 0000000..b47401d
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-warnnext.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-warnprev.png b/src/kile/icons/actions/hi22-action-warnprev.png
new file mode 100644
index 0000000..6f27156
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-warnprev.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-watchfile.png b/src/kile/icons/actions/hi22-action-watchfile.png
new file mode 100644
index 0000000..d5bc58f
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-watchfile.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-wizard_array.png b/src/kile/icons/actions/hi22-action-wizard_array.png
new file mode 100644
index 0000000..888ba4e
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-wizard_array.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-wizard_float.png b/src/kile/icons/actions/hi22-action-wizard_float.png
new file mode 100644
index 0000000..bb224ba
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-wizard_float.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-wizard_math.png b/src/kile/icons/actions/hi22-action-wizard_math.png
new file mode 100644
index 0000000..86e04f3
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-wizard_math.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-wizard_pstools.png b/src/kile/icons/actions/hi22-action-wizard_pstools.png
new file mode 100644
index 0000000..e53e97b
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-wizard_pstools.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-wizard_tabbing.png b/src/kile/icons/actions/hi22-action-wizard_tabbing.png
new file mode 100644
index 0000000..ca147a5
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-wizard_tabbing.png
Binary files differ
diff --git a/src/kile/icons/actions/hi22-action-wizard_tabular.png b/src/kile/icons/actions/hi22-action-wizard_tabular.png
new file mode 100644
index 0000000..77ef24a
--- /dev/null
+++ b/src/kile/icons/actions/hi22-action-wizard_tabular.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-bibtex.png b/src/kile/icons/actions/hi32-action-bibtex.png
new file mode 100644
index 0000000..fed3b0a
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-bibtex.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-dblatex.png b/src/kile/icons/actions/hi32-action-dblatex.png
new file mode 100644
index 0000000..8b4788b
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-dblatex.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-dvipdf.png b/src/kile/icons/actions/hi32-action-dvipdf.png
new file mode 100644
index 0000000..580eef7
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-dvipdf.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-dvipng.png b/src/kile/icons/actions/hi32-action-dvipng.png
new file mode 100644
index 0000000..8e89f5c
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-dvipng.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-dvips.png b/src/kile/icons/actions/hi32-action-dvips.png
new file mode 100644
index 0000000..15312b2
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-dvips.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-dvisearch.png b/src/kile/icons/actions/hi32-action-dvisearch.png
new file mode 100644
index 0000000..6431ab6
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-dvisearch.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-environment.png b/src/kile/icons/actions/hi32-action-environment.png
new file mode 100644
index 0000000..6883e42
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-environment.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-js.png b/src/kile/icons/actions/hi32-action-js.png
new file mode 100644
index 0000000..e77ad6f
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-js.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-l2h.png b/src/kile/icons/actions/hi32-action-l2h.png
new file mode 100644
index 0000000..f12c72f
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-l2h.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-latex.png b/src/kile/icons/actions/hi32-action-latex.png
new file mode 100644
index 0000000..355613b
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-latex.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-lilypond.png b/src/kile/icons/actions/hi32-action-lilypond.png
new file mode 100644
index 0000000..37869ff
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-lilypond.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-makeidx.png b/src/kile/icons/actions/hi32-action-makeidx.png
new file mode 100644
index 0000000..67ce18c
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-makeidx.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-mpost.png b/src/kile/icons/actions/hi32-action-mpost.png
new file mode 100644
index 0000000..eae8ea5
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-mpost.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-pdflatex.png b/src/kile/icons/actions/hi32-action-pdflatex.png
new file mode 100644
index 0000000..ef129d2
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-pdflatex.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-pdftex.png b/src/kile/icons/actions/hi32-action-pdftex.png
new file mode 100644
index 0000000..1031887
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-pdftex.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-ps2pdf.png b/src/kile/icons/actions/hi32-action-ps2pdf.png
new file mode 100644
index 0000000..cd0bfa8
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-ps2pdf.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-scriptnew.png b/src/kile/icons/actions/hi32-action-scriptnew.png
new file mode 100644
index 0000000..770ff8d
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-scriptnew.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-scriptopen.png b/src/kile/icons/actions/hi32-action-scriptopen.png
new file mode 100644
index 0000000..e4064bb
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-scriptopen.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-texcompiler.png b/src/kile/icons/actions/hi32-action-texcompiler.png
new file mode 100644
index 0000000..e3c998d
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-texcompiler.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-viewbib.png b/src/kile/icons/actions/hi32-action-viewbib.png
new file mode 100644
index 0000000..e0cec4f
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-viewbib.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-viewdvi.png b/src/kile/icons/actions/hi32-action-viewdvi.png
new file mode 100644
index 0000000..1243c58
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-viewdvi.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-viewhtml.png b/src/kile/icons/actions/hi32-action-viewhtml.png
new file mode 100644
index 0000000..c9cfe10
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-viewhtml.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-viewpdf.png b/src/kile/icons/actions/hi32-action-viewpdf.png
new file mode 100644
index 0000000..e45ac5e
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-viewpdf.png
Binary files differ
diff --git a/src/kile/icons/actions/hi32-action-viewps.png b/src/kile/icons/actions/hi32-action-viewps.png
new file mode 100644
index 0000000..368c2cb
--- /dev/null
+++ b/src/kile/icons/actions/hi32-action-viewps.png
Binary files differ
diff --git a/src/kile/icons/actions/hi48-action-graphicspage.png b/src/kile/icons/actions/hi48-action-graphicspage.png
new file mode 100644
index 0000000..e4abeef
--- /dev/null
+++ b/src/kile/icons/actions/hi48-action-graphicspage.png
Binary files differ
diff --git a/src/kile/icons/actions/hi64-action-preview.png b/src/kile/icons/actions/hi64-action-preview.png
new file mode 100644
index 0000000..c0b64ff
--- /dev/null
+++ b/src/kile/icons/actions/hi64-action-preview.png
Binary files differ
diff --git a/src/kile/icons/hi128-app-kile.png b/src/kile/icons/hi128-app-kile.png
new file mode 100644
index 0000000..c87c6fd
--- /dev/null
+++ b/src/kile/icons/hi128-app-kile.png
Binary files differ
diff --git a/src/kile/icons/hi16-app-kile.png b/src/kile/icons/hi16-app-kile.png
new file mode 100644
index 0000000..73bedc1
--- /dev/null
+++ b/src/kile/icons/hi16-app-kile.png
Binary files differ
diff --git a/src/kile/icons/hi22-app-kile.png b/src/kile/icons/hi22-app-kile.png
new file mode 100644
index 0000000..c4e255a
--- /dev/null
+++ b/src/kile/icons/hi22-app-kile.png
Binary files differ
diff --git a/src/kile/icons/hi32-app-kile.png b/src/kile/icons/hi32-app-kile.png
new file mode 100644
index 0000000..cf4bad9
--- /dev/null
+++ b/src/kile/icons/hi32-app-kile.png
Binary files differ
diff --git a/src/kile/icons/hi48-app-kile.png b/src/kile/icons/hi48-app-kile.png
new file mode 100644
index 0000000..fa7a436
--- /dev/null
+++ b/src/kile/icons/hi48-app-kile.png
Binary files differ
diff --git a/src/kile/icons/hi64-app-kile.png b/src/kile/icons/hi64-app-kile.png
new file mode 100644
index 0000000..37ee7c5
--- /dev/null
+++ b/src/kile/icons/hi64-app-kile.png
Binary files differ
diff --git a/src/kile/icons/hisc-app-kile.svgz b/src/kile/icons/hisc-app-kile.svgz
new file mode 100644
index 0000000..25bc14a
--- /dev/null
+++ b/src/kile/icons/hisc-app-kile.svgz
Binary files differ
diff --git a/src/kile/includegraphicsdialog.cpp b/src/kile/includegraphicsdialog.cpp
new file mode 100644
index 0000000..1cfd825
--- /dev/null
+++ b/src/kile/includegraphicsdialog.cpp
@@ -0,0 +1,531 @@
+/***************************************************************************
+ date : Dec 06 2005
+ version : 0.24
+ copyright : (C) 2004-2005 by Holger Danielsson, 2004 Jeroen Wijnhout
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "includegraphicsdialog.h"
+
+#include <qregexp.h>
+#include <qfileinfo.h>
+#include <qgroupbox.h>
+#include <qvgroupbox.h>
+#include <qlayout.h>
+#include <qpixmap.h>
+#include <qcheckbox.h>
+#include <qlabel.h>
+
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include "kiledebug.h"
+#include <kpushbutton.h>
+#include <kprocess.h>
+#include <klineedit.h>
+
+#include "kileconfig.h"
+#include "kileinfo.h"
+#include "kileedit.h"
+
+namespace KileDialog
+{
+
+IncludeGraphics::IncludeGraphics(QWidget *parent, const QString &startdir, KileInfo *ki) :
+ KDialogBase( Plain, i18n("Include Graphics"), Ok | Cancel, Ok, parent, 0, true, true),
+ m_startdir(startdir),
+ m_width(0),
+ m_height(0),
+ m_ki(ki),
+ m_proc(0)
+{
+ // Layout
+ QVBoxLayout *vbox = new QVBoxLayout(plainPage(), 6,6 );
+
+ // first groupbox: choose picture
+ QVGroupBox* group= new QVGroupBox(i18n("File"), plainPage());
+
+ QWidget *widget = new QWidget(group);
+ QGridLayout *grid = new QGridLayout( widget, 4,3, 6,6, "");
+ grid->addRowSpacing( 0, fontMetrics().lineSpacing() );
+ grid->addColSpacing( 0, fontMetrics().lineSpacing() );
+ grid->setColStretch(1,1);
+
+ // line 1: QLabel
+ QLabel *label1 = new QLabel(i18n("Picture:"), widget);
+ grid->addWidget( label1, 0,0 );
+
+ // line 1: KLineEdit
+ edit_file = new KLineEdit("",widget);
+ edit_file->setMinimumWidth(300);
+ grid->addWidget( edit_file, 0,1 );
+
+ // line 1: Choose-Box
+ KPushButton *pb_choose = new KPushButton("", widget, "filechooser_button" );
+ pb_choose->setPixmap( SmallIcon("fileopen") );
+
+ pb_choose->setFixedWidth(pb_choose->sizeHint().width()); // set width
+ grid->addRowSpacing( 0, pb_choose->sizeHint().height()+5 ); // update height of line
+ grid->addWidget(pb_choose,0,2);
+
+ // line 2: some (more or less useful) information
+ QLabel *label2 = new QLabel(i18n("Info:"), widget);
+ infolabel = new QLabel("---", widget);
+
+ grid->addWidget( label2, 1,0 );
+ grid->addWidget( infolabel, 1,1 );
+
+ // line 3: some output options
+ QLabel *label3 = new QLabel(i18n("Output:"), widget);
+
+ QWidget *cb_widget = new QWidget(widget);
+ QGridLayout *cb_grid = new QGridLayout( cb_widget, 1,2, 0,0,"");
+ cb_center = new QCheckBox(i18n("Center picture"),cb_widget);
+ cb_pdftex = new QCheckBox(i18n("pdftex/pdflatex"),cb_widget);
+ cb_grid->addWidget(cb_center,0,0);
+ cb_grid->addWidget(cb_pdftex,0,1);
+
+ grid->addWidget( label3, 2,0 );
+ grid->addWidget( cb_widget, 2,1 );
+
+ // line 4: graphics path
+ QLabel *label5 = new QLabel(i18n("Path:"), widget);
+ cb_graphicspath = new QCheckBox(i18n("Use \\graphicspath command of LaTeX"),widget);
+
+ grid->addWidget( label5, 3,0 );
+ grid->addWidget( cb_graphicspath, 3,1 );
+
+ // second groupbox: options
+ QVGroupBox* gb_opt= new QVGroupBox(i18n("Options"), plainPage());
+ QWidget *widget_opt = new QWidget(gb_opt);
+ QGridLayout *grid_opt = new QGridLayout( widget_opt, 2,4, 6,6, "");
+
+ QLabel *label7 = new QLabel(i18n("Width:"), widget_opt);
+ QLabel *label8 = new QLabel(i18n("Height:"),widget_opt);
+ QLabel *label9 = new QLabel(i18n("Angle:"), widget_opt);
+ QLabel *label10= new QLabel(i18n("Bounding box:"), widget_opt);
+ edit_width = new KLineEdit("",widget_opt);
+ edit_height = new KLineEdit("",widget_opt);
+ edit_angle = new KLineEdit("",widget_opt);
+ edit_bb = new KLineEdit("",widget_opt);
+
+ grid_opt->addWidget( label7, 0,0, Qt::AlignRight );
+ grid_opt->addWidget( edit_width, 0,1 );
+ grid_opt->addWidget( label9, 0,2, Qt::AlignRight );
+ grid_opt->addWidget( edit_angle, 0,3 );
+
+ grid_opt->addWidget( label8, 1,0, Qt::AlignRight );
+ grid_opt->addWidget( edit_height, 1,1 );
+ grid_opt->addWidget( label10, 1,2, Qt::AlignRight );
+ grid_opt->addWidget( edit_bb, 1,3 );
+
+ // third groupbox: figure environment
+ QGroupBox *gb_fig= new QGroupBox(2,Qt::Horizontal,i18n("Figure Environment"), plainPage());
+ QWidget *widget_fig = new QWidget(gb_fig);
+ QGridLayout *grid_fig = new QGridLayout( widget_fig, 3,2, 6,6, "");
+
+ QLabel *label4 = new QLabel(i18n("Figure:"), widget_fig);
+ lb_label = new QLabel(i18n("Label:"), widget_fig);
+ lb_caption = new QLabel(i18n("Caption:"), widget_fig);
+ cb_figure = new QCheckBox(i18n("Use figure environment"),widget_fig);
+ edit_label = new KLineEdit("fig:",widget_fig);
+ edit_caption = new KLineEdit("",widget_fig);
+
+ grid_fig->addWidget( label4,0,0);
+ grid_fig->addWidget( cb_figure, 0,1);
+ grid_fig->addWidget( lb_label,1,0);
+ grid_fig->addWidget( edit_label, 1,1);
+ grid_fig->addWidget( lb_caption,2,0);
+ grid_fig->addWidget( edit_caption, 2,1);
+
+ // add to layout
+ vbox->addWidget(group);
+ vbox->addWidget(gb_opt);
+ vbox->addWidget(gb_fig);
+ vbox->addStretch();
+
+ // read configuration
+ readConfig();
+ updateFigure();
+
+ // connect
+ connect( pb_choose, SIGNAL( clicked() ), this, SLOT( chooseFile() ) );
+ connect( cb_figure, SIGNAL(clicked()), this, SLOT(updateFigure() ) );
+
+ setFocusProxy( edit_file );
+}
+
+IncludeGraphics::~IncludeGraphics()
+{
+ delete m_proc;
+}
+
+////////////////////////////// configuration data //////////////////////////////
+
+void IncludeGraphics::readConfig()
+{
+ cb_center->setChecked( KileConfig::igCenter() );
+ cb_pdftex->setChecked( KileConfig::igPdftex() );
+ cb_graphicspath->setChecked( KileConfig::igGraphicspath() );
+ cb_figure->setChecked( KileConfig::igFigure() );
+
+ m_imagemagick = KileConfig::imagemagick();
+ m_boundingbox = KileConfig::boundingbox();
+ m_defaultresolution = KileConfig::resolution();
+}
+
+void IncludeGraphics::writeConfig()
+{
+ KileConfig::setIgCenter( cb_center->isChecked() );
+ KileConfig::setIgPdftex( cb_pdftex->isChecked() );
+ KileConfig::setIgGraphicspath( cb_graphicspath->isChecked() );
+ KileConfig::setIgFigure( cb_figure->isChecked() );
+}
+
+////////////////////////////// update figure environment //////////////////////////////
+
+void IncludeGraphics::updateFigure()
+{
+ bool state = cb_figure->isChecked();
+
+ lb_label->setEnabled(state);
+ lb_caption->setEnabled(state);
+ edit_label->setEnabled(state);
+ edit_caption->setEnabled(state);
+}
+
+////////////////////////////// determine the whole tag //////////////////////////////
+
+QString IncludeGraphics::getTemplate()
+{
+ QString s;
+
+ // state of figure and center checkbox
+ bool figure = cb_figure->isChecked();
+ bool center = cb_center->isChecked();
+ QString indent = ( figure || center ) ? m_ki->editorExtension()->autoIndentEnvironment() : QString::null;
+
+ // add start of figure environment ?
+ if ( figure )
+ s += "\\begin{figure}\n";
+
+ // add start of center environment ?
+ if ( center )
+ {
+ if ( figure )
+ s += indent + "\\centering\n";
+ else
+ s += "\\begin{center}\n";
+ }
+
+ // add includegraphics command
+ s += indent + "\\includegraphics";
+
+ // add some options
+ QString options = getOptions();
+ if ( !options.isEmpty() )
+ s += '[' + options + ']';
+
+ // add name of picture
+ // either take the filename or try to take the relative part of the name
+ QString filename = ( cb_graphicspath->isChecked() )
+ ? QFileInfo(edit_file->text()).fileName()
+ : m_ki->relativePath(QFileInfo(m_ki->getCompileName()).dirPath(), edit_file->text());
+ s += '{' + filename + "}\n";
+
+ // add some comments (depending of given resolution, this may be wrong!)
+ QString info = getInfo();
+ if (info.length() > 0)
+ s += indent + info + '\n';
+
+ // close center environment ?
+ if ( center && !figure )
+ s += "\\end{center}\n";
+
+ // close figure environment ?
+ if ( figure )
+ {
+ QString caption = edit_caption->text().stripWhiteSpace();
+ if ( !caption.isEmpty() )
+ s += indent + "\\caption{" + caption + "}\n";
+ QString label = edit_label->text().stripWhiteSpace();
+ if ( !label.isEmpty() && label!="fig:" )
+ s += indent + "\\label{" + label + "}\n";
+ s += "\\end{figure}\n";
+ }
+
+ return s;
+}
+
+QString IncludeGraphics::getFilename()
+{
+ return edit_file->text();
+}
+
+////////////////////////////// some calculations //////////////////////////////
+
+QString IncludeGraphics::getOptions()
+{
+ QString s = "";
+
+ if ( ! edit_width->text().isEmpty() )
+ s += ",width=" + edit_width->text();
+
+ if ( ! edit_height->text().isEmpty() )
+ s += ",height=" + edit_height->text();
+
+ if ( ! edit_angle->text().isEmpty() )
+ s += ",angle=" + edit_angle->text();
+
+ // Only dvips needs the bounding box, not pdftex/pdflatex.
+ // But it will be always inserted as a comment.
+ if ( !edit_bb->text().isEmpty() && !cb_pdftex->isChecked() )
+ s += ",bb=" + edit_bb->text();
+
+ if ( s.left(1) == "," )
+ return s.right(s.length()-1);
+ else
+ return s;
+}
+
+////////////////////////////// graphics info //////////////////////////////
+
+QString IncludeGraphics::getInfo()
+{
+ QString wcm,hcm,dpi;
+ int wpx=0,hpx=0;
+
+ bool ok = getPictureSize(wpx,hpx,dpi,wcm,hcm);
+ if ( ! ok )
+ return "";
+ else
+ {
+ QFileInfo fi( edit_file->text() );
+
+ return "% " + fi.baseName() + '.' + fi.extension(true)
+ + QString(": %1x%2 pixel").arg(wpx).arg(hpx)
+ + ", " + dpi + "dpi"
+ + ", " + wcm + 'x' + hcm + " cm"
+ + ", bb=" + edit_bb->text();
+ }
+}
+
+void IncludeGraphics::setInfo()
+{
+ QString text;
+ QString wcm,hcm,dpi;
+ int wpx,hpx;
+
+ if ( !edit_file->text().isEmpty() && getPictureSize(wpx,hpx,dpi,wcm,hcm) )
+ {
+ text = QString("%1x%2 pixel").arg(wpx).arg(hpx)
+ + " / " + wcm + 'x' + hcm + " cm"
+ + " (" + dpi + "dpi)";
+ }
+ else
+ text = "---";
+
+// insert text
+infolabel->setText(text);
+}
+
+bool IncludeGraphics::getPictureSize(int &wpx, int &hpx, QString &dpi, QString &wcm, QString &hcm)
+{
+ wpx = m_width;
+ hpx = m_height;
+
+ dpi = QString("%1").arg((int)(m_resolution+0.5));
+
+ // convert from inch to cm
+ float w = (float)m_width / m_resolution * 2.54;
+ wcm = wcm.setNum(w,'f',2);
+
+ float h = (float)m_height / m_resolution * 2.54;
+ hcm = hcm.setNum(h,'f',2);
+ return true;
+}
+
+
+void IncludeGraphics::chooseFile()
+{
+ QString filter = ( cb_pdftex->isChecked() )
+ ? i18n("*.png *.jpg *.pdf|Graphics\n") // dani 31.7.2004
+ + "*.png|PNG Files\n"
+ + "*.jpg|JPG Files\n"
+ + "*.pdf|PDF Files\n"
+ + "*|All Files"
+ : i18n("*.png *.jpg *.eps.gz *.eps|Graphics\n") // dani 31.7.2004
+ + "*.png|PNG Files\n"
+ + "*.jpg|JPG Files\n"
+ + "*.eps.gz|Zipped EPS Files\n"
+ + "*.eps|EPS Files\n"
+ + "*|All Files";
+
+ QString fn = KFileDialog::getOpenFileName( m_startdir,filter,
+ this,i18n("Select File") );
+ QFileInfo fi(fn);
+ // insert the chosen file
+ edit_file->setText( fn );
+
+ // could we accept the picture?
+ if ( !fn.isEmpty() && fi.exists() && fi.isReadable() )
+ {
+ // execute the command and filter the result:
+ // eps|eps.gz --> %%BoundingBox: 0 0 123 456
+ // bitmaps --> w=123 h=456 dpi=789
+ QString grep = " | grep -m1 \"^%%BoundingBox:\"";
+ QString ext = QFileInfo(fn).extension();
+ if ( ext == "eps" )
+ execute( "cat " + fn + grep);
+ else if ( ext == "eps.gz" )
+ execute( "gunzip -c " + fn + grep);
+ else
+ execute("identify -format \"w=%w h=%h dpi=%x\" \"" + fn + "\"");
+ }
+ else{
+ KILE_DEBUG() << "=== IncludeGraphics::error ====================" << endl;
+ KILE_DEBUG() << " filename: '" << fn << "'" << endl;
+ }
+}
+
+void IncludeGraphics::execute(const QString &command)
+{
+ if ( !m_boundingbox || (!m_imagemagick && command.left(8)=="identify") )
+ return;
+
+ if(m_proc)
+ delete m_proc;
+
+ m_proc = new KShellProcess("/bin/sh");
+ m_proc->clearArguments();
+ (*m_proc) << QStringList::split(' ',command);
+
+ connect(m_proc, SIGNAL(receivedStdout(KProcess*,char*,int)),
+ this, SLOT(slotProcessOutput(KProcess*,char*,int)) );
+ connect(m_proc, SIGNAL(receivedStderr(KProcess*,char*,int)),
+ this, SLOT(slotProcessOutput(KProcess*,char*,int)) );
+ connect(m_proc, SIGNAL(processExited(KProcess*)),
+ this, SLOT(slotProcessExited(KProcess*)) );
+
+ m_output = "";
+ KILE_DEBUG() << "=== IncludeGraphics::execute ====================" << endl;
+ KILE_DEBUG() << " execute '" << command << "'" << endl;
+
+ m_proc->start(KProcess::NotifyOnExit, KProcess::AllOutput);
+}
+
+// get all output of identify
+
+void IncludeGraphics::slotProcessOutput(KProcess*,char* buffer,int buflen)
+{
+ m_output += QString::fromLocal8Bit(buffer,buflen);
+}
+
+// identify was called
+
+void IncludeGraphics::slotProcessExited(KProcess* proc)
+{
+ if ( proc->normalExit() && !proc->exitStatus() ) {
+ KILE_DEBUG() << " result: " << m_output << endl;
+
+ // set the default resolution
+ m_resolution = m_defaultresolution;
+
+ // analyze the result
+ if ( m_output.left(14) == "%%BoundingBox:" )
+ {
+ edit_bb->setText( m_output.stripWhiteSpace().mid(15,m_output.length()-15) );
+
+ // show information
+ setInfo();
+ }
+ else if ( m_output.left(2) == "w=" )
+ {
+ // dani 31.7.2004
+ // older version of imagemagick (pre 6.0):
+ // - doesn't care of PixelsPerCentimeter, but always works with PixelsPerInch
+ // - doesn't use floating numbers as resolution
+ // so the bounding box has to be calculated in a different way
+
+ // this regexp will accept floating point numbers as resolution
+ QRegExp reg("w=(\\d+)\\s+h=(\\d+)\\s+dpi=([0-9.]+) (.*)");
+ if ( reg.search(m_output) == -1 )
+ return;
+
+ // get bounding box and resolution
+ bool ok;
+ m_width = (int)reg.cap(1).toInt( &ok);
+ if (!ok) return;
+
+ m_height = (int)reg.cap(2).toInt( &ok);
+ if (!ok) return;
+
+ float res = (float)reg.cap(3).toFloat( &ok);
+ if (!ok) return;
+ if ( res > 0.0 )
+ m_resolution = res;
+
+ // look, if resolution is in PixelsPerCentimeter
+ if ( reg.cap(4).stripWhiteSpace() == "PixelsPerCentimeter" )
+ m_resolution *= 2.54;
+
+ // calc the bounding box
+ int bbw = (int)( (float)m_width*72.0/m_resolution + 0.5 );
+ int bbh = (int)( (float)m_height*72.0/m_resolution + 0.5 );
+
+ // take width and height as parameters for the bounding box
+ edit_bb->setText( QString("0 0 ") + QString("%1").arg(bbw)
+ + ' '
+ + QString("%1").arg(bbh)
+ );
+
+ // show information
+ setInfo();
+
+ }
+ }
+}
+
+void IncludeGraphics::slotOk()
+{
+ if ( checkParameter() ) {
+ writeConfig();
+ accept();
+ }
+}
+
+bool IncludeGraphics::checkParameter()
+{
+ QString filename = edit_file->text().stripWhiteSpace();
+ edit_file->setText(filename);
+
+ if ( filename.isEmpty() )
+ {
+ if ( KMessageBox::warningYesNo( this, i18n("No graphics file was given. Proceed any way?") ) == KMessageBox::No ) return false;
+ }
+ else
+ {
+ QFileInfo fi( filename );
+ if ( ! fi.exists() )
+ {
+ if ( KMessageBox::warningYesNo( this, i18n("The graphics file does not exist. Proceed any way?") ) == KMessageBox::No ) return false;
+ }
+ }
+
+ return true;
+}
+
+}
+
+#include "includegraphicsdialog.moc"
+
diff --git a/src/kile/includegraphicsdialog.h b/src/kile/includegraphicsdialog.h
new file mode 100644
index 0000000..e85ff34
--- /dev/null
+++ b/src/kile/includegraphicsdialog.h
@@ -0,0 +1,93 @@
+/***************************************************************************
+ date : Nov 02 2005
+ version : 0.23
+ copyright : (C) 2004-2005 by Holger Danielsson, 2004 Jeroen Wijnhout
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef INCLUDEGRAPHICSDIALOG_H
+#define INCLUDEGRAPHICSDIALOG_H
+
+#include <qstring.h>
+
+#include <kdialogbase.h>
+
+/**
+ *@author dani
+ */
+
+class QLabel;
+class QCheckBox;
+
+class KileInfo;
+class KLineEdit;
+class KProcess;
+class KShellProcess;
+
+namespace KileDialog
+{
+
+class IncludeGraphics : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ IncludeGraphics(QWidget *parent,const QString &startdir,KileInfo *ki);
+ ~IncludeGraphics();
+
+ QString getTemplate();
+ QString getFilename();
+
+private slots:
+ void chooseFile();
+ void updateFigure();
+
+ void slotProcessOutput(KProcess* proc,char* buffer,int buflen);
+ void slotProcessExited(KProcess* proc);
+
+ void slotOk();
+
+private:
+ void readConfig();
+ void writeConfig();
+ bool checkParameter();
+ QString getOptions();
+ QString getInfo();
+ bool getPictureSize(int &wpx, int &hpx, QString &dpi, QString &wcm, QString &hcm);
+ void setInfo();
+
+ QLabel *infolabel;
+ KLineEdit *edit_file, *edit_label, *edit_caption, *edit_width, *edit_height, *edit_angle, *edit_bb;
+ QCheckBox *cb_center, *cb_pdftex, *cb_figure, *cb_graphicspath;
+ QLabel *lb_label, *lb_caption;
+
+ QString m_startdir;
+ QString m_output;
+
+ // current picture
+ int m_width,m_height;
+ float m_resolution;
+
+ // default
+ bool m_imagemagick;
+ bool m_boundingbox;
+ float m_defaultresolution;
+
+ void execute(const QString &command);
+
+ KileInfo *m_ki;
+ KShellProcess* m_proc;
+};
+
+}
+
+#endif
diff --git a/src/kile/internal-testing/env-grabbing-testing.tex b/src/kile/internal-testing/env-grabbing-testing.tex
new file mode 100644
index 0000000..b56cb6b
--- /dev/null
+++ b/src/kile/internal-testing/env-grabbing-testing.tex
@@ -0,0 +1,60 @@
+% /***************************************************************************
+% begin : Mon 9 october 2006
+% copyright : (C) 2006 by Holger Danielsson, Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: test if all possible environments/commands are grabbed for mathpreview
+% compiles: no
+%
+
+1234$ \sqrt{2}$ $a^2$
+
+$ \$ % \( % \[ $$$$
+\begin{array}{ccc}
+x^2 & y^2 & z^2
+\end{array}
+$
+
+\begin{equation}
+% \begin{equation} $
+ a^2 \\\\\$
+ \begin{array}{ccc}
+ \alpha & \beta & \gamma
+ \end{array}
+\end{equation}
+
+$\begin{array}{ccc}
+a^2 & b^2 & c^2
+\end{array}$
+
+\[
+ a^2
+\] \$ $ x^2$
+
+\(
+ b^2 % $ test $
+\)
+
+\begin{displaymath}
+ \alpha + \beta + \gamma = 180 % comment
+\end{displaymath}
+
+\begin{math}
+ \alpha + \beta + \gamma = 180 % comment
+\end{math}
+
+\begin{eqnarray}
+\zeta + \beta + \gamma = 180 % comment
+\end{eqnarray}
+
+% \begin{mathtest} % has to be defined in configure-kile-commands to work
+% asdasdasd
+% \end{mathtest}
diff --git a/src/kile/internal-testing/find-verbatim.tex b/src/kile/internal-testing/find-verbatim.tex
new file mode 100644
index 0000000..3fd1e01
--- /dev/null
+++ b/src/kile/internal-testing/find-verbatim.tex
@@ -0,0 +1,51 @@
+% /***************************************************************************
+% begin : Mon 9 october 2006
+% copyright : (C) 2006 by Holger Danielsson, Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: only insert special "` outside verbatim
+% compiles: no
+%
+
+\verb+ hallo """""" " " " " " +
+
+\verb hallo asdasd "` "' "` "'
+
+\verb+ hallo """"" + " "` "'
+
+\verb+ hallo """"""" " " + " "` "' "` "' \verb+ hallo+ "` "' "` "' "` "' "`
+\verb sdasfd " ""' "` "' "` "' "` "' "`
+
+\verb """klh""kjsahd""" ashfdkjsdhf " "' "` "'
+\verb"""""""` "' "`
+\verb#""" asdasd "`# asdasd "` "'
+"` "' verb asdasd \verb 2 "` "'
+
+asdsda asdsad \verbl ashdkasd "" " " " l asdasd "` "'
+\verb"`
+\verb"'
+\verb
+\verb""" hjakhkasdf """" """"" "" "` "' "` "' "`
+\begin{verbatim}
+ sdfsdf """
+\end{verbatim}
+
+\begin{verbatim*}
+ sadsdf " " " " " "
+\end{verbatim*}
+
+abc \verb " ""
+
+abc \verb|"""""
+
+abc \verb|d" """""
+
+abc \verb|def
diff --git a/src/kile/internal-testing/hello.tex b/src/kile/internal-testing/hello.tex
new file mode 100644
index 0000000..d66f018
--- /dev/null
+++ b/src/kile/internal-testing/hello.tex
@@ -0,0 +1,18 @@
+% /***************************************************************************
+% begin : Mon 9 october 2006
+% copyright : (C) 2006 by Holger Danielsson, Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: Tests if included files are accesible thoughr the structure view
+% compiles: no
+%
+
+test test test test \ No newline at end of file
diff --git a/src/kile/internal-testing/helloo.tex b/src/kile/internal-testing/helloo.tex
new file mode 100644
index 0000000..a59ae1d
--- /dev/null
+++ b/src/kile/internal-testing/helloo.tex
@@ -0,0 +1,18 @@
+% /***************************************************************************
+% begin : Mon 9 october 2006
+% copyright : (C) 2006 by Holger Danielsson, Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: Tests if included files are used for generating cmd lists
+% compiles: no
+%
+
+\newcommand{\hhhhhhhh}{} \ No newline at end of file
diff --git a/src/kile/internal-testing/internaltesting.kilepr b/src/kile/internal-testing/internaltesting.kilepr
new file mode 100644
index 0000000..7842e81
--- /dev/null
+++ b/src/kile/internal-testing/internaltesting.kilepr
@@ -0,0 +1,112 @@
+[General]
+img_extIsRegExp=false
+img_extensions=.eps .pdf .dvi .ps .fig .gif .jpg .jpeg .png
+kileprversion=1
+kileversion=1.9
+lastDocument=syntax-math2.tex
+masterDocument=
+name=Internal Testing
+pkg_extIsRegExp=false
+pkg_extensions=.cls .sty .dtx
+src_extIsRegExp=false
+src_extensions=.tex .ltx .bib .mp
+
+[Tools]
+MakeIndex=
+QuickBuild=
+
+[item:env-grabbing-testing.tex]
+archive=true
+column=18
+encoding=ISO 8859-15
+highlight=LaTeX
+line=14
+open=true
+
+[item:find-verbatim.tex]
+archive=true
+column=18
+encoding=UTF-8
+highlight=LaTeX
+line=14
+open=true
+
+[item:hello.tex]
+archive=true
+column=1
+encoding=ISO 8859-15
+highlight=LaTeX
+line=15
+open=true
+
+[item:helloo.tex]
+archive=true
+column=0
+encoding=ISO 8859-15
+highlight=LaTeX
+line=0
+open=true
+
+[item:internaltesting.kilepr]
+archive=true
+column=47
+encoding=
+highlight=
+line=0
+open=false
+
+[item:syntax-cite.tex]
+archive=true
+column=0
+encoding=ISO 8859-15
+highlight=LaTeX
+line=16
+open=true
+
+[item:syntax-cmds.tex]
+archive=true
+column=0
+encoding=ISO 8859-15
+highlight=LaTeX
+line=16
+open=true
+
+[item:syntax-comment-updateStruct.tex]
+archive=true
+column=15
+encoding=ISO 8859-15
+highlight=LaTeX
+line=14
+open=true
+
+[item:syntax-generic.tex]
+archive=true
+column=48
+encoding=ISO 8859-15
+highlight=LaTeX
+line=14
+open=true
+
+[item:syntax-math1.tex]
+archive=true
+column=0
+encoding=ISO 8859-15
+highlight=LaTeX
+line=17
+open=true
+
+[item:syntax-math2.tex]
+archive=true
+column=0
+encoding=ISO 8859-15
+highlight=LaTeX
+line=17
+open=true
+
+[item:teppich.eps]
+archive=true
+column=47
+encoding=
+highlight=
+line=0
+open=false
diff --git a/src/kile/internal-testing/preview.tex b/src/kile/internal-testing/preview.tex
new file mode 100644
index 0000000..4a48157
--- /dev/null
+++ b/src/kile/internal-testing/preview.tex
@@ -0,0 +1,52 @@
+\documentclass{article}
+\usepackage{amsmath}
+% begin : Sat 11 august 2007
+% copyright : (C) 2007 by Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: test if quickpreview is working
+% compiles: yes
+%
+\begin{document}
+
+% math groups
+$1$
+\$ $asd$ \$
+$$222$$ % does not work because it is difficult to realize and is considered bad practice see ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf
+\( 1231 \)
+\[ 1231 \]
+\ensuremath{4}
+
+% environments
+\begin{equation}
+ 4
+\end{equation}
+\begin{displaymath}
+ 5
+\end{displaymath}
+\begin{align}
+ 6 &=6
+\end{align}
+
+\begin{math}
+ 7
+\end{math}
+
+\begin{eqnarray}
+ 8
+\end{eqnarray}
+
+% \begin{mathtest} % has to be defined in configure-kile-commands to work
+% asdasdasd
+% \end{mathtest}
+
+\end{document}
+
diff --git a/src/kile/internal-testing/syntax-cite.tex b/src/kile/internal-testing/syntax-cite.tex
new file mode 100644
index 0000000..cfd1d99
--- /dev/null
+++ b/src/kile/internal-testing/syntax-cite.tex
@@ -0,0 +1,48 @@
+% /***************************************************************************
+% begin : Mon 9 october 2006
+% copyright : (C) 2006 by Holger Danielsson, Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: syntax file check for optional argument of cite command
+% compiles: no
+%
+
+ \begin{enumerate}
+ \item This MFA is \cite[Figure 1: The Graph $G_{5a}$]{23mfa}
+
+ \item This MFA is \cite[ Figure 2: The Graph $G_{5b}$]{23mfa}
+
+ \item This MFA is \cite [Figure 3: The Graph $G_{5c}$]{23mfa}
+
+ \item This MFA is \cite [ Figure 4: The Graph $G_{5d}$]{23mfa}
+
+ \item This MFA is \cite[Figure 5:
+ The Graph $G_{5e}$]{23mfa}
+
+ \item This MFA is \cite[Figure 6:
+ The Graph $G_{5f}$]{
+ 23mfa}
+
+ \item This MFA is \cite (test) [ Figure 1: The Graph $G_{5g}$]{
+ 23mfa}
+
+ \end{enumerate}
+
+$y = \sqrt{1-x^2}$
+
+ \begin{thebibliography}{10}
+ \bibitem{23mfa}
+ Gr\"uttm\"uller M, Kalinowski T, Leck U, Hartmann S, Roberts I.T,
+ \textit{Maximal flat antichains of minimum weight},
+ Submitted for publication
+ \end{thebibliography}
+ \end{document}
+
diff --git a/src/kile/internal-testing/syntax-cmds.tex b/src/kile/internal-testing/syntax-cmds.tex
new file mode 100644
index 0000000..19ba2fb
--- /dev/null
+++ b/src/kile/internal-testing/syntax-cmds.tex
@@ -0,0 +1,32 @@
+% /***************************************************************************
+% begin : Mon 9 october 2006
+% copyright : (C) 2006 by Holger Danielsson, Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: test document for syntax file latex.xml
+% (syntax highlighting for \newcommand and \def)
+% compiles: no
+
+\newcommand{\abc}{ $ start { % comment
+ test { abc --> } } end } behind % comment
+
+\newcommand{\abc}[1]{ $ start { % comment
+ test { abc --> #1 } } end } behind % comment
+
+\newcommand{\abc}[1][default]{ $ start { % comment
+ test { abc --> #1 } } end } behind % comment
+
+\def\xyz{ $ start { % comment
+ test{ abc --> } } end } behind % comment
+
+\def\xyz#1{ $ start { % comment
+ test{ abc --> #1 } } end } behind % comment
+
diff --git a/src/kile/internal-testing/syntax-comment-updateStruct.tex b/src/kile/internal-testing/syntax-comment-updateStruct.tex
new file mode 100644
index 0000000..71110e2
--- /dev/null
+++ b/src/kile/internal-testing/syntax-comment-updateStruct.tex
@@ -0,0 +1,345 @@
+% /***************************************************************************
+% begin : Mon 9 october 2006
+% copyright : (C) 2006 by Holger Danielsson, Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: syntax file check for comments, has all commands updateStruct should grab
+% compiles: no
+%
+
+\usepackage{graphicx,
+import,
+amsmath}
+\usepackage{floatflt,
+pifont,url,psfrag,booktabs}
+\usepackage[english]{babel}
+\usepackage[T1]{
+fontenc}
+% you can easily test if kile grabbed all newcommands by viewing the structure view (no ERROR sections) and by codecompletion, the commands have ascending number of h's. asdf
+
+\newcommand{\bla}{}
+\newcommand{\blah}{test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\blahh}%
+{test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\blahhh}
+{test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\blahhhh}{%
+test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\blahhhhh}{
+test
+\section{ERROR}
+test
+\ensuremath{a^2 + b^2 = c^2}
+\section{ERROR}
+}
+\newcommand{\blahhhhhh}{
+test % \section{ERROR}
+\section{ERROR}
+test
+\ensuremath{a^2 + b^2 = c^2}
+\section{ERROR}
+}
+\newcommand{\blahhhhhhh}{% \section{ERROR}
+test \% \section{ERROR}
+\section{ERROR}
+test
+\ensuremath{a^2 + b^2 = c^2}
+\section{ERROR}
+}
+% \newcommand{\blahhhhhhhh}{test\section{ERROR}test\ensuremath{a^2 + b^2 = c^2}} as reserve
+
+\newcommand{\blaeh}
+{test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\blaehh}%
+{test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\blaehhh}
+{test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\blaehhhh}{%
+test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\blaehhhhh}{
+test
+\section{ERROR}
+test
+\ensuremath{a^2 + b^2 = c^2}
+\section{ERROR}
+}
+\newcommand{% \section{ERROR}
+\blaehhhhhh}{test % \section{ERROR}
+\section{ERROR}
+test
+\ensuremath{a^2 + b^2 = c^2}
+\section{ERROR}
+}
+\newcommand{\blaehhhhhhh}{% \section{ERROR}
+test \% \section{ERROR}
+\section{ERROR}
+test
+\ensuremath{a^2 + b^2 = c^2}
+\section{ERROR}
+}
+
+\newcommand{\blu}[1]{}
+\newcommand{\bluh}[1]{test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\bluhh}[1]%
+{test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\bluhhh}[1]
+{test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\bluhhhh}[1]{%
+test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\bluhhhhh}[1]{
+test
+\section{ERROR}
+test
+\ensuremath{a^2 + b^2 = c^2}
+\section{ERROR}
+}
+\newcommand{\bluhhhhhh}[1]{
+test % \section{ERROR}
+\section{ERROR}
+test
+\ensuremath{a^2 + b^2 = c^2}
+\section{ERROR}
+}
+\newcommand{\bluhhhhhhh}[1]{
+test \% \section{ERROR}
+\section{ERROR}
+test
+\ensuremath{a^2 + b^2 = c^2}
+\section{ERROR}
+}
+
+\newcommand{\bloe}[3][stdarg]{}
+
+\newcommand{\bloeh}[3][stdarg]{test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\bloehh}[3][stdarg]%
+{test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\bloehhh}[3][stdarg]
+{test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\bloehhhh}[3][stdarg]{%
+test \section{ERROR} test \ensuremath{a^2 + b^2 = c^2}}
+\newcommand{\bloehhhhh}[3][stdarg]{
+test
+\section{ERROR}
+test
+\ensuremath{a^2 + b^2 = c^2}
+\section{ERROR}
+}
+\newcommand{\bloehhhhhh}[3][stdarg]{
+test % \section{ERROR}
+\section{ERROR}
+test
+\ensuremath{a^2 + b^2 = c^2}
+\section{ERROR}
+}
+\newcommand{\bloehhhhhhh}[3][stdarg]{
+test \% \section{ERROR}
+\section{ERROR}
+test
+\ensuremath{a^2 + b^2 = c^2}
+\section{ERROR}
+}
+\newcommand{\bloehhhhhhhh}[3][]{} % is also valid latex ...
+
+\providecommand{\bloehhhhhhhhh}{test} % not yet supported
+
+\newenvironment{hello}{test \%}{\section{ERROR}}
+\newenvironment{helloo}[2]{test \%}{\section{ERROR}}
+\newenvironment{hellooo}[3][stdarg]{test \%}{\section{ERROR}} % also not yet supported
+
+\renewcommand{\section}[2]{asd} % also missing
+\input{helloo} %allowed in preamble
+
+\iffalse
+\addunit{\knoelks}{knoe} % needed for fancyunits
+\fi
+
+\DeclareMathOperator{\destroyer}{D}
+\DeclareMathOperator*{\destroyerr}{D}
+
+\bibliographystyle{plain}
+
+\begin{document}
+\input{hello}
+\input{./hello}
+\input{/home/thomas/devel/svn/office-trunk/kile/kile/internal-testing/hello} % change this to your local absolute path
+
+\include{hello}
+\include{./hello}
+
+\iffalse \include{/home/thomas/devel/svn/office-trunk/kile/kile/internal-testing/hello}
+\fi % http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/2904, may not work with your setup
+
+\import{/home/thomas/devel/svn/office-trunk/kile/kile/internal-testing}{hello}
+% new, see #128227
+
+\begin{figure}[htb]
+blubb
+ \includegraphics{./teppich.eps}
+\end{figure}
+
+\begin{figure}[htb]
+ \includegraphics[width=2cm,
+bb=0 0 120 101]{teppich.eps}
+\label{picture---}
+\end{figure}
+
+\begin{figure}[b!]
+\centering
+\psfrag{xtitle}{$\alpha$ [asasa]}
+\psfrag{ytitle}{$R$ [asdas]}
+\includegraphics{teppich.eps}
+\caption{blubb}
+\label{fig:stuff}
+\end{figure}
+
+\begin{table}[h]
+\centering
+\begin{tabular}{cccc}
+$m_p$ & $R_p$ & $m_s$ & $R_s$ \\ \toprule
+0,105(6)&28,6(1,6)&69(3)&43,5(1,9) \\ \bottomrule
+\end{tabular}
+\caption{Si-Dunkelkennlinie}
+\label{tab:si-ivt-dunkel}
+\vspace{1cm}
+\end{table}
+
+\label{asdf}
+\ref{asdf}
+\pageref{asdf}
+\ref{picture---}
+
+\part{-1}
+\chapter{0}
+\section{A}
+\subsection{KHL}
+\subsubsection{C}
+\paragraph{% should jump to first position of textstring
+D}
+\subparagraph{E}
+
+\part*{-1}
+\chapter*{0}
+\section*{A}
+\subsection*{B}
+\subsubsection*{C}
+\paragraph*{% should jump to first position of textstring
+D}
+\subparagraph*{E}
+
+\iffalse
+\bibliography{test,./test,/home/thomas/devel/svn/office-trunk/kile/kile/internal-testing/test,test.bib,./test.bib,test2.bib} % where test2.bib lies in a directory referenced in $BIBINPUTS
+\fi
+
+%\section{111}
+%\section{%222}
+\%%\section{333}
+\%%\section{%444}
+\%\section{555}
+\%\section{666}
+\\\section{777}
+\\\section{%888
+ 999} adsdfgsdfg sdfgsfdga sadfgsdf
+\\\%\section{aaa}
+\\\%\section{%bbb
+ ccc}
+
+% \section{ERROR}
+% \section{ERROR} \% \section{ERROR}
+% % \section{ERROR}
+\% \section{blubb}
+\% \section{blahh} % \section{ERROR}
+\% \section{nix} \% \section{garnix}
+ab % \section{ERROR}
+bc \% \section{hallo} % \section{ERROR}
+de % \section{ERROR} % \section{ERROR}
+
+\section{% \section{ERROR}
+ comment}
+
+\section{%
+ comment}
+
+Test 1
+
+\includegraphics[width=2cm,bb=0 0 120 101]{teppich.eps}
+% teppich.eps: 160x135 pixel, 96dpi, 4.23x3.57 cm, bb=0 0 120 101
+
+Test 2
+
+\includegraphics[
+ width=2cm,bb=0 0 120 101]{teppich.eps}
+% teppich.eps: 160x135 pixel, 96dpi, 4.23x3.57 cm, bb=0 0 120 101
+
+Test 3
+
+\includegraphics[
+ width=2cm,
+ bb=0 0 120 101]{teppich.eps}
+% teppich.eps: 160x135 pixel, 96dpi, 4.23x3.57 cm, bb=0 0 120 101
+
+
+Test 4
+
+\includegraphics[%
+width=2cm,bb=0 0 120 101]{teppich.eps}
+% teppich.eps: 160x135 pixel, 96dpi, 4.23x3.57 cm, bb=0 0 120 101
+
+
+Test 5
+
+\includegraphics[%
+ width=2cm,
+ bb=0 0 120 101]{teppich.eps}
+% teppich.eps: 160x135 pixel, 96dpi, 4.23x3.57 cm, bb=0 0 120 101
+
+Test 6
+
+\includegraphics[width=2cm, % kommentar {abc}
+ bb=0 0 120 101]{teppich.eps}
+% teppich.eps: 160x135 pixel, 96dpi, 4.23x3.57 cm, bb=0 0 120 101
+
+
+Test 7
+
+\includegraphics[width=2cm,% kommentar {abc}
+ bb=0 0 120 101 % kommentar def
+ ]{teppich.eps}
+% teppich.eps: 160x135 pixel, 96dpi, 4.23x3.57 cm, bb=0 0 120 101
+
+Test 8
+
+\includegraphics
+[width=2cm,bb=0 0 120 101]{teppich.eps}
+% teppich.eps: 160x135 pixel, 96dpi, 4.23x3.57 cm, bb=0 0 120 101
+
+Test 9
+
+\includegraphics %
+[width=2cm,bb=0 0 120 101]{teppich.eps}
+% teppich.eps: 160x135 pixel, 96dpi, 4.23x3.57 cm, bb=0 0 120 101
+
+Test 10
+
+\% \includegraphics %
+[width=2cm,bb=0 0 120 101]{teppich.eps}
+% teppich.eps: 160x135 pixel, 96dpi, 4.23x3.57 cm, bb=0 0 120 101
+
+\begin{thebibliography}{bbxsec}
+\bibitem{prop}
+ T.~Lohse et al., {\em An Experiment to Study CP Violation in the
+ $B$ System Using an Internal Target at the HERA Proton Ring},
+ Proposal, {\bf DESY-PRC 94/02} (1994).
+\bibitem{PDG} Particle Data Group, Review of Particle Properties,
+ Eur. Phys. J. {\bf C15} (2000).
+\bibitem{bbxsec} P.~Nason, S.~Dawson and K.R.~Ellis,
+ \bf{303}{1988}{607};
+ {\bf B327} (1989) 49; {\bf B335} (1990) 260.
+\end{thebibliography} % taken from http://www-hera-b.desy.de/general/publications/hb2k/report/target/target.bib
diff --git a/src/kile/internal-testing/syntax-generic.tex b/src/kile/internal-testing/syntax-generic.tex
new file mode 100644
index 0000000..652050a
--- /dev/null
+++ b/src/kile/internal-testing/syntax-generic.tex
@@ -0,0 +1,238 @@
+% /***************************************************************************
+% begin : Mon 9 october 2006
+% copyright : (C) 2006 by Holger Danielsson, Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: test document for syntax file latex.xml
+% (general syntax highlighting)
+% compiles: no
+
+\section{xyz} % ok: sectioning command (red), parameter in black
+
+\section[short]{xyz} % ok
+
+\section*{xyz} % ok: star belongs to the sectioning command
+
+\section*[short]{xyz} % ok
+
+\sectionabc{xyz} % command, parameter in black
+
+\sectionabc[short]{xyz} % command
+
+\sectionabc*{xyz} % ok: star belongs to the command
+
+\sectionabc*[short]{xyz} % ok
+
+\command*{parameter} % ok
+
+
+\verb|a| abc % a in verbatim mode
+
+\verb|abc % only abc in verbatim mode
+abc % no verbatim mode more
+
+\verb*aba abc % only b in verbatim mode
+
+\verbabc abc % normal command
+
+\verb|aaaassss sss| abc % verbatim mode
+
+\rput* % \rput command (including star)
+
+\rput56 % \rput command, 56 in black
+
+\rput=ab % \rput command, =ab in black
+
+\rput*ab % \rput command, ab in black
+
+$ x^2 $$ \] $ abc % error; $$ and \]
+
+\( x^2 $$ \] $ abc % error; $$ and \]
+
+$ x^2 $$ \] \) abc % error; $$ and \]
+
+$$ x^2 $$ abc
+
+$$ x^2 $ \) \] $$ abc % error; $, \) and \]
+
+\[ x^2 $$ $ \) \] abc % error; $$, $ and \)
+
+\begin{XYZverbatim} % environment
+ xffg
+\end{XYZverbatim}
+
+\begin{verbatimXYZ} % environment
+ xffg
+\end{verbatimXYZ}
+
+\begin{verbatimX} % environment
+ xffg
+\end{verbatimX}
+
+\begin{verbatim} % environment
+ xffg % verbatim mode
+\end{verbatim}
+
+\begin {verbatim} % environment
+ xffg % verbatim mode
+\end {verbatim}
+
+\begin{verbatim*} % environment
+ xffg % verbatim mode
+\end{verbatim*}
+
+% \begin{verbatim] % comment
+% xffg
+% \end{verbatim}
+
+\begin{verbatim*XYZ} % error: *XYZ
+ xffg
+\end{verbatim*XYZ}
+
+\begin{verbatim56} % error: 56
+ xffg
+\end{verbatim56}
+
+\begin{verbatim=ab} % error: =ab
+ xffg
+\end{verbatim=ab}
+
+\begin{lstlisting} % environment
+ verbatim % verbatim mode
+\end{lstlisting}
+
+\begin{lstlisting}[frame=tb, % environment, parameter in black
+ language=pascal]
+ verbatim % verbatim mode
+\end{lstlisting}
+
+\begin{a} % environment
+ xffg
+\end{a}
+
+\begin{a*} % environment
+ xffg
+\end{a*}
+
+\begin{xyz} % environment
+asd
+\end{xyz}
+
+\begin{xyz*}
+asd
+\end{xyz*}
+
+
+\begin{xyz] % error: ]
+asd
+\end{xyz}
+
+\begin{xyz*ab} % error: *ab
+asd
+\end{xyz*ab}
+
+\begin{xyz=ab} % error: =ab
+asd
+\end{xyz=ab}
+
+\begin{xyz56} % error: 56
+asd
+\end{xyz56}
+
+\begin{align} % environment
+ 1&\le 2 \\ % mathmode
+ &\le \\
+ &\le
+\end{align}
+
+\begin {align*} % environment
+ 1&\le 2 \\ % mathmode
+ &\le \\
+ &\le
+\end{align*}
+
+\begin{align} % environment
+$ 1&\le 2 \\ % error: $
+$$ &\le \\ % error: $$
+\( \) &\le % error: \( and \)
+\[ \] % error: \[ and \]
+\end{align}
+
+\begin{align}{2} % environment
+x^2 &= 1 &\hskip2cm 1 &= 2 \\ % mathmode
+ &= & &= \\
+ &= & &=
+\end{align}
+
+\begin{XYZalign} % environment
+ 1&= x^2 \\
+3 &= 4\\
+ 5&=6
+\end{XYZalign}
+
+\begin{alignXYZ} % environment
+ 1&= x^2 \\
+3 &= 4\\
+ 5&=6
+\end{alignXYZ}
+
+\begin{alignX} % environment
+ 1&= x^2 \\
+3 &= 4\\
+ 5&=6
+\end{alignX}
+
+\begin{align*XYZ} % error: *XYZ
+ 1&= x^2 \\
+3 &= 4\\
+ 5&=6
+\end{align*XYZ}
+
+\begin{align56} % error: 56
+ 1&= x^2 \\
+3 &= 4\\
+ 5&=6
+\end{align56}
+
+\begin{align=ab} % error: =ab
+ 1&= x^2 \\
+3 &= 4\\
+ 5&=6
+\end{align=ab}
+
+$\begin{matrix} % mathmode
+ 1&2 \\
+ 3& 4 \\
+ 5&6
+\end{matrix}$
+
+$ % mathmode
+\begin{align} % error: align env in mathmode
+ 1&= x^2 \\
+3 &= 4\\
+ 5&=6
+\end{align}
+$
+
+\begin{ xyz} % error: spaces
+x^2
+\end{xyz }
+
+
+\begin{al ign} % error: spaces
+x^2 \intertext{normal} y^2
+\end{align }
+
+
+\begin{verba t im} % error: spaces
+x^2 \intertext{normal} y^2
+\end{ve rbatim}
+
diff --git a/src/kile/internal-testing/syntax-math1.tex b/src/kile/internal-testing/syntax-math1.tex
new file mode 100644
index 0000000..8cad289
--- /dev/null
+++ b/src/kile/internal-testing/syntax-math1.tex
@@ -0,0 +1,82 @@
+% /***************************************************************************
+% begin : Mon 9 october 2006
+% copyright : (C) 2006 by Holger Danielsson, Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: test document for syntax file latex.xml
+% (syntax highlighting for mathmode)
+% compiles: no
+%
+
+{
+% basic math mode
+\[blah \alpha\] xyz \par
+\(blah \alpha\) xyz \par
+$blah \alpha$ xyz \par
+$$blah \alpha$$ xyz \par
+
+% one space at the end
+\[blah \alpha \] xyz \par
+\(blah \alpha \) xyz \par
+$blah \alpha $ xyz \par
+$$blah \alpha $$ xyz \par
+
+% one space at the start
+\[ blah \alpha\] xyz \par
+\( blah \alpha\) xyz \par
+$ blah \alpha$ xyz \par
+$$ blah \alpha$$ xyz \par
+
+% a bit more advanced
+\(blah \alpha \command[sad\alpha]{sad\alpha}\) xyz
+\[blah \alpha \command[sad\alpha]{sad\alpha}\] xyz
+$blah \alpha \command[sad\alpha]{sad\alpha}$ xyz
+$$blah \alpha \command[sad\alpha]{sad\alpha}$$ xyz
+
+\(blah \alpha \command[sad\alpha]{sad\alpha} \) xyz
+\[blah \alpha \command[sad\alpha]{sad\alpha} \] xyz
+$blah \alpha \command[sad\alpha]{sad\alpha} $ xyz
+$$blah \alpha \command[sad\alpha]{sad\alpha} $$ xyz
+
+\( blah \alpha\command[sad\alpha]{sad\alpha} \) xyz
+\[ blah \alpha\command[sad\alpha]{sad\alpha} \] xyz
+$ blah \alpha\command[sad\alpha]{sad\alpha} $ xyz
+$$ blah \alpha\command[sad\alpha]{sad\alpha} $$ xyz
+}
+
+% equations
+{
+\begin{equation} xyz
+ blah \alpha
+\end{equation} xyz
+% in one line
+\begin{equation} xyz blah \alpha\end{equation} xyz
+% two in one line
+\begin{equation} xyz blah \alpha\end{equation} xyz \begin{equation} xyz blah \alpha\end{equation} xyz
+
+% with additional environments inside
+\begin{eqnarray} blah
+ \begin{split}
+(blah) blah \alpha & blah \\
+\text{sdfsdf}
+ \end{split}
+\end{eqnarray} xyz
+}
+
+% out of bug reports:
+{
+% #119617
+$$\phi_\ccc\circ\phi_a=(\ccc*\phi)_a\circ\phi_\ccc$$
+\begin{equation} a=b\nonumber\end{equation}
+xyz
+\[blah blah \qedhere\] xyz
+}
+
diff --git a/src/kile/internal-testing/syntax-math2.tex b/src/kile/internal-testing/syntax-math2.tex
new file mode 100644
index 0000000..8e5240a
--- /dev/null
+++ b/src/kile/internal-testing/syntax-math2.tex
@@ -0,0 +1,53 @@
+% /***************************************************************************
+% begin : Mon 9 october 2006
+% copyright : (C) 2006 by Holger Danielsson, Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: test document for syntax file latex.xml
+% (syntax highlighting for mathmode)
+% compiles: no
+%
+
+\newcommand{\abc}{def}
+\renewcommand{\ghi}{jkl}
+\definecolor{refkey}{rgb}{1,0,0}
+
+\newcommandasd{\mno}{pqr}
+\renewcommandasd{\stu}{vwx}
+\definecolorasd{labelkey}{rgb}{0,0,1}
+
+$50 \$abc\\text{qwe}xyz$xyz \par
+
+$50 \$abc\text{qwe}xyz$xyz \par
+$50 \$abc\text{qwe}$xyz \par
+$50 \$abc\mbox{qw\,e}xyz$xyz \par
+$50 \$abc\mbox{qw\enskip}xyz$xyz \par
+$50 \$abc\text{qw\cmd{def}}xyz$xyz \par
+$50 \$abc\text{qw\cmd{def\textbf{ghi}}}xyz$xyz \par
+$50 \$abc\text{qw\cmd{def\{\%ghi}}xyz$xyz \par
+$50 \$abc\text{qw\cmd{def\}\$ghi}}xyz$xyz \par
+$50 \$abc\text{qwe}\alpha$xyz \par
+
+$50 \$abc\text{qw%\cmd{def\textbf{ghi}}}xyz$xyz \par
+ \cmd{def\textbf{ghi}}}xyz$xyz \par
+
+$$50 \$abc\text{qwe}xyz$$xyz \par
+$$50 \$abc\text{qwe}$$xyz \par
+$$50 \$abc\text{qwe}\alpha$$xyz \par
+
+\[50\%\alpha\mbox{qwe}xyz\]xyz \par
+\[50\%\alpha\mbox{qwe}\alpha\]xyz \par
+
+\begin{equation}50\%\alpha \intertext{qwe}xyz\end{equation}xyz \par
+\begin{equation}50\%\alpha \intertext{qwe}\alpha\end{equation}xyz \par
+
+$50\%\mbox{abc\textbf{def}}$xyz \par
+
diff --git a/src/kile/internal-testing/syntax-noweb.tex b/src/kile/internal-testing/syntax-noweb.tex
new file mode 100644
index 0000000..c7c0b08
--- /dev/null
+++ b/src/kile/internal-testing/syntax-noweb.tex
@@ -0,0 +1,67 @@
+% /***************************************************************************
+% begin : Mon 12 february 2008
+% copyright : (C) 2008 by Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: test document for syntax file latex.xml
+% turn off syntax-HL inside noweb blocks
+% compiles: no
+
+\begin{document}
+
+\latexCmd
+$ \alpha + \beta = \gamma $
+
+<<SomeName,echo=F>>=
+code line
+code line$var
+var$var2
+class$varname
+output LaTeX
+@ %defs
+
+\latexCmd
+$ \alpha + \beta = \gamma $
+
+<<SomeName,echo=F>>=
+code line
+code line$var
+var$var2
+class$varname
+output LaTeX
+ @
+\latexCmd
+$ \alpha + \beta = \gamma $
+
+<<SomeName,echo=F>>=
+code line
+code line$var
+var$var2
+class$varname
+output LaTeX
+@ %defs
+
+\latexCmd
+$ \alpha + \beta = \gamma $
+
+<<SomeName,echo=F>>=
+code line
+code line$var
+var$var2
+class$varname
+output LaTeX
+ @ %defs
+
+\latexCmd
+$ \alpha + \beta = \gamma $
+
+\end{document}
+
diff --git a/src/kile/internal-testing/syntax-tabular.tex b/src/kile/internal-testing/syntax-tabular.tex
new file mode 100644
index 0000000..8ba891a
--- /dev/null
+++ b/src/kile/internal-testing/syntax-tabular.tex
@@ -0,0 +1,30 @@
+% /***************************************************************************
+% begin : Mon 12 february 2008
+% copyright : (C) 2008 by Thomas Braun
+% ***************************************************************************/
+%
+% /***************************************************************************
+% * *
+% * This program is free software; you can redistribute it and/or modify *
+% * it under the terms of the GNU General Public License as published by *
+% * the Free Software Foundation; either version 2 of the License, or *
+% * (at your option) any later version. *
+% * *
+% ***************************************************************************/
+% description: test document for syntax file latex.xml
+% highlight & and @{} in tabular like environments
+% compiles: no
+
+\begin{document}
+
+\begin{tabular}{lcr@{3cm}}
+ a & b & c & d
+\end{tabular}
+
+\begin{tabular}{lcr@{3cm}}
+ a & b & c & d
+\end{mpsupertabular}
+
+
+\end{document}
+
diff --git a/src/kile/internal-testing/teppich.eps b/src/kile/internal-testing/teppich.eps
new file mode 100644
index 0000000..773bf85
--- /dev/null
+++ b/src/kile/internal-testing/teppich.eps
@@ -0,0 +1,281 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%BoundingBox: 0 0 64 64
+%%HiResBoundingBox: 0.000000 0.000000 64.000000 64.000000
+%.............................................
+%%Creator: ESP Ghostscript 81503 (epswrite)
+%%CreationDate: 2006/10/13 23:15:31
+%%DocumentData: Clean7Bit
+%%LanguageLevel: 2
+%%EndComments
+%%BeginProlog
+% This copyright applies to everything between here and the %%EndProlog:
+% Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved.
+%%BeginResource: procset GS_epswrite_2_0_1001
+/GS_epswrite_2_0_1001 80 dict dup begin
+/PageSize 2 array def/setpagesize{ PageSize aload pop 3 index eq exch
+4 index eq and{ pop pop pop}{ PageSize dup 1
+5 -1 roll put 0 4 -1 roll put dup null eq {false} {dup where} ifelse{ exch get exec}
+{ pop/setpagedevice where
+{ pop 1 dict dup /PageSize PageSize put setpagedevice}
+{ /setpage where{ pop PageSize aload pop pageparams 3 {exch pop} repeat
+setpage}if}ifelse}ifelse}ifelse} bind def
+/!{bind def}bind def/#{load def}!/N/counttomark #
+/rG{3{3 -1 roll 255 div}repeat setrgbcolor}!/G{255 div setgray}!/K{0 G}!
+/r6{dup 3 -1 roll rG}!/r5{dup 3 1 roll rG}!/r3{dup rG}!
+/w/setlinewidth #/J/setlinecap #
+/j/setlinejoin #/M/setmiterlimit #/d/setdash #/i/setflat #
+/m/moveto #/l/lineto #/c/rcurveto #
+/p{N 2 idiv{N -2 roll rlineto}repeat}!
+/P{N 0 gt{N -2 roll moveto p}if}!
+/h{p closepath}!/H{P closepath}!
+/lx{0 rlineto}!/ly{0 exch rlineto}!/v{0 0 6 2 roll c}!/y{2 copy c}!
+/re{4 -2 roll m exch dup lx exch ly neg lx h}!
+/^{3 index neg 3 index neg}!
+/f{P fill}!/f*{P eofill}!/s{H stroke}!/S{P stroke}!
+/q/gsave #/Q/grestore #/rf{re fill}!
+/Y{P clip newpath}!/Y*{P eoclip newpath}!/rY{re Y}!
+/|={pop exch 4 1 roll 1 array astore cvx 3 array astore cvx exch 1 index def exec}!
+/|{exch string readstring |=}!
+/+{dup type/nametype eq{2 index 7 add -3 bitshift 2 index mul}if}!
+/@/currentfile #/${+ @ |}!
+/B{{2 copy string{readstring pop}aload pop 4 array astore cvx
+3 1 roll}repeat pop pop true}!
+/Ix{[1 0 0 1 11 -2 roll exch neg exch neg]exch}!
+/,{true exch Ix imagemask}!/If{false exch Ix imagemask}!/I{exch Ix image}!
+/Ic{exch Ix false 3 colorimage}!
+/F{/Columns counttomark 3 add -2 roll/Rows exch/K -1/BlackIs1 true>>
+/CCITTFaxDecode filter}!/FX{<</EndOfBlock false F}!
+/X{/ASCII85Decode filter}!/@X{@ X}!/&2{2 index 2 index}!
+/@F{@ &2<<F}!/@C{@X &2 FX}!
+/$X{+ @X |}!/&4{4 index 4 index}!/$F{+ @ &4<<F |}!/$C{+ @X &4 FX |}!
+/IC{3 1 roll 10 dict begin 1{/ImageType/Interpolate/Decode/DataSource
+/ImageMatrix/BitsPerComponent/Height/Width}{exch def}forall
+currentdict end image}!
+/~{@ read {pop} if}!
+end def
+%%EndResource
+/pagesave null def
+%%EndProlog
+%%Page: 1 1
+%%BeginPageSetup
+GS_epswrite_2_0_1001 begin
+/pagesave save store 197 dict begin
+0.1 0.1 scale
+%%EndPageSetup
+gsave mark
+Q q
+0 0 250000 250000 re
+Y
+q[639.92 0 0 639.92 0 0]concat
+64 64 8[64 0 0 -64 0 64]@X false 3
+colorimage
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^
+!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8N']J,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^
+!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FmJ3s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^"@%Jj@$kG[ZAtp*
+Xhr`.e)\p5m*t"_d,+30f'0H[i0^n#GalTKIBFo#Plj4%!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8N']J,h]^!'Gc34FdDoJ,h]^!'Gc:6A/!UW0t!=
+gue1rp&"7Oqsa:Ume$AAo(qS>q;gu=i9U-lkk<Wip!VjlcJS37h=8G:n?U:$H_AGBD57A%KE+,b
+!'Gc34FdDoJ,h]^!'Gc34FmJ3s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W*!4FdDoJ,h]^!'Gc34FdDoJ/V7E
+GacIphX9CipZCr>kj\E5o(q\CqWm_KlLF]6nG2/5pu1T6h<FXdkOmBdo[)Rgbhhp2h!r;8n@mKB
+]$p)Td-RRGjBd_T'MXPe4FdDoJ,h]^!'Gc34FdDoJH,ZLs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!!'Gc34FdDoJ,h]^
+!'GcF98\%d`6R91f]Mk]kk<p!pYtQ6jR2g*n+c)7q<%/AjmMp(mJ,Z,pYP3/g?81\jn7']oZlCd
+b2)X.g@2r1n%I9>\C0cNcg7jZl`/(lU;Q,#N4f]lM#]Yg!'Gc34FdDoJ,h]^s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8N']J,h]^
+!'Gc34FdDoJ-%oc;h)!ae*G99o$QFfeE$8Sk4RKmp>5*.i9U-rm.]N+pYtQ6iTp6qlM'-!p=e^&
+fB)\Sj7L^Wo??(^aP?='g$lc-n%7':[aFKJcKq[VlD_khUrDPj_WR)li';=`!^2)74FdDoJ,h]^
+!'Gc34FmJ3s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W*!4FdDoJ,h]^!'Gc34Fe/@NK13k_V"@tg[WGBo$6.`dGjcIjRh'cp"AO$gZ\@dl1Wrtp>,!,
+h!+Oekk<Zkp"&6se)U)IiUb:No#]\W`S0gtfC-E'm^U^4[*S*Cc0MFQlDM\eUVuAf_<76#k*<R>
+CmiEW8rE[3J,h]^!'Gc34FdDoJH,ZLs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!!'Gc34FdDoJ,h]^!'Gca@[sC9jL`q0^Xhkkg$m&:n]K\Yc/8*=iUbOYo[W$p
+f&cSVk4RBhp"8F"fB2bWjn.'`o[;ajcf"E=ht"nFn]';P_V"@lf'g3!m^CL0ZHhg>bNl.KlD;Ma
+Tu6&`^uh#tjcd::O14/!X4eb$R/f@"!'Gc34FdDoJ,h]^s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!rr>03!'Gc34FdDoJ,h]^5]N^(b3?=\m'tL2][ZAbfC-W1nAa5Q
+akcL2hX\tMo?cIfdc0lIj7Lg\o[Djmdc0oHiq(OUo?Q7abMMg2h!rA;nA<iI^XhkceF'fnmBb.*
+YKZ=5b3GnFl(c2\T>Kc[^ZLipjcR+7NOIi&Zf-J<hCiK9!'Gc34FdDoJ,h]^!'Gf3s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!rr>03!'Gc34FdDoJ44U]WQ=>,bNlIZm'Y4,
+\^KlXeF(-(n&*fI`S0h&h!rPCo$#t]c/8*;i:>1Oo?Q:ccJS3;ht"tIo#]_Xa4p.&g@2u3n%[HB
+]@?8Ydd=Efm'+b#Xifq.aQ]P?kb5oWSA=9S^#bKjjH$h2Mm_Q"ZJgD=i-h]`123Wd4FdDoJ,h]^
+!'Gf3s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8N']J,h]^!'Gc34FfM1VP:uk
+VoS&&am-%Qla"h&[F"9Ndd=]sm_@?A_:\4og$lu7nAj;RaP?=-h=8VCn]BVWakZF-h!rG>n\s5O
+_qFOpfC-H(m^q!:\C0cOcg7p]l`J@qWlaP'`p'59kaoWRR_S!N]]G9djGgV-M6u5pZ/C/8hgDK]
+G,X1HA"ircJ,h]^!'Gc34FmJ3s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W*!4FdDoJ,h]^
+!'GcZ?(.1pjIjERUrDPra6BYIlEAFtZHhgEd-S9jmCLd7^")Pcf'gH,n&!`H_qFOtg$lr6nAO&M
+`7aXtg$ll2nA*ZE^=MbceF'osm^LU2[*S*Dc0MOUl`/(lVoS%s`9<i1kF96KQbDLE]&\p^j,:>)
+LU,ljYi'u4hg2<ZFf4&5U=gMeQN0-u!'Gc34FdDoJH,ZLs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+!'Gc34FdDoJ,h]^&P@t<Z.te^k+0?NTu6&h`TX8@l)VtlY0?4:c0Ma_m'b=/\^KlWe*alum_76>
+^Xhkgf'gE+n%[HB^Xhkff'g<&m_%';]$p)Wdd=KimBb.*Yg)L9bNc+LlDM\eUW)Gi_WRH)k*WmE
+Pe6"<\`8XWieXr"KX'HcY2=W-hKPsTF/I`2UYB7FdL8X'!'Gc34FdDoJ,h]^s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!!'Gc34FdDoJ-%lbCRN>/]&]0ijdNsHT#'T`_rmi7kblJcWlaP.bNc=Ula"h&
+[*S*IdI"HlmCC[4]$p)Ze*aitm^q!:]$p)Ye*acpmC1L1[F"9Hcg7p^l`\OuXNKh-aQfYCl(c5]
+TYfl_^uh'!jd!L>Oh'P5\)W@QieFbtK!4*\Xl"E(hK>aPEM_H-U=s:Qfh7"8!Bku64FdDoJ,h]^
+s8W-!s8W-!s8W-!s8W-!s8W-!rr>03!'Gc34FdDoJ3%VJN4.`3]]HTLmC:U3]@?8^eaC3'n%mZF
+_qFOrf^PublE8=rYg)L=cKhg_m'P+*[F"9Kd-\9hmE+/RcJ\<=ht#"Ko#on\b2)X1h=8SAn]'>R
+][ZAH`p'8:kb,fUSA=9T^?(Znjc[49Njn&,[GltIiIeAmJ$%UTX58'!h/fIKDPPs$T\="Lfj^H'
+-tB(R4FdDoJ,h]^!'Gf3s8W-!s8W-!s8W-!s8W-!rr>03!'Gc34Fdi1M1)DYM6u67_rq("s8W-!
+s8W-!s8W-!s8W-!s8W,lq#%&1l)DbgX30_0bNc7Sl`\OuYg)L=c0N@&nG`Fes8W-!s8W-!s8W-!
+s8W-!s8W-!s8Drr\^Kl>_s!`0kFB?MRD.dK]]G<fjH$e1Mm_Q"Zf-SBi..ufI&u1LWSMZogi0(D
+Cn]QrT@mbFfO(&u<ftc87#1h*J,h]^!'Gf3s8W-!s8W-!s8W-!s8N']J,h]^!'Gc34Fg(S\:UpB
+KsK[/_<:jus8W-!s8W-!s8W-!s8W-!s8W,kq#$o*kbZ;_VoS&#aQ]_HlDr%lXNKh5c0P&tr;Zfs
+s8W-!s8W-!s8W-!s8W-!s8W-!s30?jTYfl`_<7<&k*WjDQ+Q+?\`Ag\j,:>)LpQ&nZ/C2:hgMT_
+H)f_DVql?hghie?BqX0kS_7G@fNjlr=d@PnDmB@*J,h]^!'Gc34FmJ3s8W-!s8W-!s8N']J,h]^
+!'GcA8W.hlgjcH`K!4+%^ZPRrs8W-!s8W-!s8W-!s8W-!s8W,kq#$c$kFofVU;Z8k`TX/<kbcAa
+VoS&YlM(>Ys8W-!s8W-!s8W-!s8W-!s8W-!s8V'EpR]4aSA=9T^?1cqjcmC<Oh'M4\)WCSieXr"
+KX'HdYMXc1hg2<ZG,X5;V;,s`gM<M:B:dddS(M&8f34Kk<g;-2O4">(M?#bh!'Gc34FmJ3s8W-!
+s8W*!4FdDoJ,h]^!'GcsGI)Onh0Z3ZJ$%Uq^#f:os8W-!s8W-!s8W-!s8W-!s8W,jq#$Sqk+'6L
+T#'T^_WRT0kFofV^t8&Ts8W-!s8W-!s8W-!s8W-!s8W-!s8W,ip\^c(kaK6JQbDLG]]>9fjH-n3
+NORr*[GltJiInJoJZms[Xl"H)hKPpSF/I`2UYBRXg1[,3A=V:[Rb(f2el\3f<0Ga-O4,RmXT1J6
+!'Gc34FdDoJH,ZLs8W*!4FdDoJ,h]^"@%NQS^hh[gj#gSH`Q"g]]K1ns8W-!s8W-!s8W-!s8W-!
+s8W,jp\^>ijd<aCRD.dO^ZM'%k,-/_p\Ojgs8W-!s8W-!s8W-!s8W-!s8W-!r;HVsbNkM.jd!L>
+PIfh;\`8a[j,CG+M6u8sZJgJ@i..ufIB;=PWnqruh/fIKE2;6)U"X1Pfk$`-@@GhSR+GK+el@pa
+;39:%NmgCNbQ:"]!'Gc34FdDoJH,ZLs8W*!4FdDoJ,h]^,@-mXU>'[agiTILGH'D]]&`nks8W-!
+s8W-!s8W-!s8W-!s8W,ip\^/aj-.(8Pe6"B]]GKnjl,S#s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+_:\4@]B#-djH7"5O14//[c31PieXr"KsBThYi(&7hgMT_HE,hFW82Nlgi0(DCnfWtTA!kIfjUB&
+?C9>JQI]*$eP_OZ:QNstN7(1Qd2#`N!'Gc34FdDoJH,ZLs8W*!4FdDoJ,h]^7")[^T\=7WgMs%D
+FJdiS\E!Vhs8W-!s8W-!s8W-!s8W-!s8W,ip\^#Zif:M.OLX>5\`:HUn,NFfs8W-!s8W-!s8W-!
+s8W-!s8W-!s4QT.Oh'M5\DrUYj,CG+MRDH"Zf-YEiInGnJZn!]Xl"N,hKc-WG,X5<VVH-dgMEV<
+BqX0kS_7JAfNsut>F*iAPgr]qe524T9T@IkMU=hJcmik=!'Gc34FdDoJH,ZL!'Gc34FdDoJ,qfa
+>a<`LT%RkOg23S=E2;6I[c7>es8W-!s8W-!s8W-!s8W-!s8W,hpAB`QiJP#%Mm_Q9_<:[mrr<#u
+s8W-!s8W-!s8W-!s8W-!s8VNZqieVPN4.`([Gm%MieXr"L9fckZ/C5;i.%oeIB;=PX58*#h0#XO
+Ei%Q0UYBUYg1d24AY%L`S(M)9f3=Tm=Hq?8P13<idnPhN8W2"cM:"VDcoHTt!Bku64FdDoJ,h]^
+!'Gc34FdDoJ.bV>@%,\WSChGFfkI,5CnfX?[,M&bs8W-!s8W-!s8W-!s8W-!s8W,hpA9NIi.\Gp
+M6u7(n+m"`s8W-!s8W-!s8W-!s8W-!s8W,rr;N;(kD6J'LU5roZJgMBi.J8lJZn!]Y2=Z/hg;E\
+H)f\DW82Qmgi91GDPPs%U"X1Pfk6o0LU5s9`TXAFl<0D&<0Ga/Ojm*cdn,JG7Z#MZLX85<cT6['
+$V?BZ4FdDoJ,h]^!'Gc34FdDoJ0\Nt>aO#KRFbo;fO^W,BV3t3ZJki`s8W-!s8W-!s8W-!s8W-!
+s8W,gpA9?Ahghle_:S/Us8W-!s8W-!s8W-!s8W-!s8W-!s8W,+cg6=ii.J8lK!=0aYMar6hgV]b
+IB;:PX58-%h05gRFf4#8V;-$cgMN\>C7s9nT@o76j6?+0s8W-!s8VfgrDo-4;39;Zk4O,'hF<@L
+6\j#QL!Mi4c8U9u'j%"-4FdDoJ,h]^!'Gc34FdDoJ22&J=I%E@Qe#N3f3t0$A=_A)Yi,Q]s8W-!
+s8W-!s8W-!s8W-!s8W,gp%s'9hO)"<rVlfrs8W-!s8W-!s8W-!s8W-!s8W-!d,FSHY2=`3hg_cc
+I]_LUXPS<)hKl3YGcBMBW82TogiB:IE2;6+UYBRXg1d25AtI\6[Gq,_rr<#us8W-!s8VfgrDJd-
+A";3Os8VfgrE#665D@EGK?cH,bqsmo*+>oK4FdDoJ,h]^!'Gc34FdDoJ3/%h<Kks8Q.9*)em=`q
+@%,\sXl'0Ys8W-!s8W-!s8W-!s8W-!s8W,fp%s-;hWsb/s8W-!s8W-!s8W-!s8W-!s8W-!s60"K
+JZn!YX583(hKl3YH)f\FWSMcsh0#XOFJdi6V;-$cgMWe@Cn]QtT\=%Mfk$`-@[l$-lhCGZs8N#t
+f]Ml,s8VfgrD/L'B:dfUrr<#us-pdc4G1p>J^--%bqXUi+_\:a4FdDoJ,h]^!'Gc34FdDoJ3\V&
+;39:,P13QteQS9i>aX)hX5<mVs8W-!s8W-!s8W-!s8W-!s8W,fp%u_^nGiOgs8W-!s8W-!s8W-!
+s8W-!s8VlkrJe8GGGs>@W82Wqh0#XOFJmo8VVH3ggi9.EDkl'(U>'LXg1m;7BV3shS_7MCfO:6$
+C7s;[s8W-!s-LF\?'s7Ds8VfgrC`-u7uG^Biq39Ns1QtN3J#I5J'B`rbV"4b,Ak*o4FdDoJ,h]^
+!'Gc34FdDoJ3nn19od\!OOI-ke5hd`=I%E]WSRUSs8W-!s8W-!s8W-!s8W-!s8W,srVlfrs8W-!
+s8W-!s8W-!s8W-!s8W-!s8Sq7k]3NTEi%Q3V;-'egi0(DDku-*UYBX[gMES;C7s9pTA!qLfk$`-
+A";1[S(M)9f3F]oDkl(es8W-!s';#C>*db>s8VfgrCDgn6\j$tdI$u6s1d.R2Lit,IEX<ib:@h[
+,B(Bu4FdDoJ,h]^!'Gc34FdDoJ3ek38W2"jNRCU`do)=X<0GaRVqh=Ps8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,mq>GW?hJK"AD5,d%U=sFXg2!D9CSBHsT\=+Pfk6o0
+AtI[dS_.GAfO:6$?^]MOR+GN-el\3f>aO%=rVliss,jkQ<g2)6s8VcfrBuIg9o[WcnG3+as/3p%
+14@A"HHRg`as_GT+`G6u4FdDoJ,h]^!'Gc34FdDoJ3AJ+7>]D_MpY1VdS>hO:ls.GV;2+Ns8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8Ud8okU8TBV3skT@mkKfk6o0
+AtI[eS_7PDfOLE'@@PnWRb(l6f3FZn>*d`AQ.8p"ePq^];N]JMh!tFEs8N#tf]Ml,s8VuorjpSH
+mIU2Ss8W-!s(@qV07(elGfhFXaWtuM*cAgp4FdDoJ,h]^!'Gc34FdDoJ2hts6&*`SLs\_Md7K8E
+9T@J<U>,_Js8W-!s8W-!s8W-!s8W-!s8W,hpA<n;q#CBos8W-!s8W-!s8W-!s8W-!s8W-!s1$ME
+A";1]SCh;?fOC?&@@PnWRb(o7f3Xls?'s5JQe#<*el\3f<g2'5P13Ble524T:6*e5SCm?(qu?]r
+s8W-!s8W-!s8W-!s8W-!s8T^\mOrn0.sT2bG0)"OaWY]G)J["e4FdDoJ,h]^!'Gc34FdDoJ1u/^
+4bV-HL<i5Bcp`f=8;bf0T\BGGs8W-!s8W-!s8W-!s8W-!s8W,coD3X/h>-sHs8W-!s8W-!s8W-!
+s8W-!s8W-!s8N&uPe6!_RFbc4f3Ocq>aX)HQe#?+ele<i=I%E<PgrctePhX\;N]I*O4-jadnGbL
+8W2"eMU>e!f@/dPs8W-!s8W-!s8W-!r;HVqb3Cg4bq"%]-[*TWFNG\Ha;o6?(1arU4FdDoJ,h]^
+!'Gc34FdDoJ1,9D3J#I<K?c]8cU!<46\s*%T%X/Ds8W-!s8W-!s8W-!s8W-!s8W,bo(l@MeXO>9
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!p\Oi2VqbF?el\3f=Hq?;PgrfueQ%g`;j,X.Ojm6idnc%R
+9od[qNRCCVdRT2B7>]DZLX8;@cp!-/?CBE!Z/L_Pj*I`^7>]DDH-7[^asVAS,]q-OEl]8>`u8g7
+&72XB4FdDoJ,h]^!'Gc34FdDoJ0&1$21Nk1JB^-,c96g+5D@EnSCmlAs8W-!s8W-!s8W-!s8W-!
+s8W,bo(l1Edo)=XaP?=cs8W-!s8W-!s8W-!s8W-!s8W-!s8W,[meC+Uf2Rp_;j#R-Ojm6ie527U
+:QNt!Nmg[]dRoJH8W2"eMU=kKd6i]96&*`MK[2c5c8pO%2h9.0Ia'WqbV+=d/:#DfGKM7TaWklJ
++E>ICDoWc5`YN@/$Wa2+4FdDoJ,h]^!'Gc34FdDoJ.kqT0mq2%I`s^"brL@#4+babRFhK=s8W-!
+s8W-!s8W-!s8W-!s8W,ao(l%>dS5_M>F*k+o(rCds8W-!s8W-!s8W-!s8W-!s8W-!s8U*nnPG:q
+:6*dtNmg[]dS#SJ8rV1iMpb+Qd:/Tt\C0cSdd=NkmC(F0[F"<Jd-S-cm'G"(ZHhgAc0V[Zl`\Ou
+Y06.5bNc.Nl:[)a*,ik8D8m?,`=lt(#>U`g4FdDoJ,h]^!'Gc34FdDoJ-\]+/U>MnHcn0lbVXdn
+2LitVQe)3:s8W-!s8W-!s8W-!s8W-!s8W,anbPb5d7B/B8W2#?W87FNrr<#us8W-!s8W-!s8W-!
+s8W-!s8W-!s.7'i8W2"gMpY(Qd79)A7>]D[LsSMEcu>f8s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s'qSO)/R;.CW-p#`"-Lu"%8+K4FdDoJ,h]^!'Gc34FdDoJ,qfa
+-?I-VGfhXbb:n:d14@AKQ.H!8s8W-!s8W-!s8W-!s8W-!s8W,`nbPS-cpNT87#92YLs`!:kl:\_
+s8W-!s8W-!s8W-!s8W-!s8W-!s8;ipG,X4bLsSMEcpEN76&*`NL!Mr9cYT?0s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s'V;I'l(]#BZ(En_[Bqf!'Pl54FdDoJ,h]^
+s8W*!4FdDoJ,h]^(h'WrG0)1Wat.e[/pb]@PL]^5s8W-!s8W-!s8W-!s8W-!s8W,`nbG>$cT[$.
+5D@EKL!N/Cd*gqGs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!n+HQYPLVjMcTQs-4G1p@K$HB-c;p.Z
+Z-DX>c0MRWl`\OuY06.5bNl7PlDr(mX3'Y,am,kHlDVbfVoS&!`p';<kWssM&ST)mB#>!e_?O#@
+!'Gc34FdDoJH,ZLs8W*!4FdDoJ,h]^$Vm'6F3#YLaX;8R.<ip3OOX=1s8W-!s8W-!s8W-!s8W-!
+s8W,_nG,(qc8pO%3eGX=K$HK2c;]tVo(W(^s8W-!s8W-!s8W-!s8W-!s8W-!s8W,LjRk`kcT$L$
+2h9.2J'Bj"bqjdl147;"Hd"*gb:S"_.sT2cGKM:UaWtuM,'(aIEQ9)<`uAp9(i72,CW-s$`"6S"
+%;!EaA&8IZ_#d/m!'Gc34FdDoJH,ZLs8W*!4FdDoJ,h]^!Bu)TD8IH:a<PcI-$77'Nmn%.s8W-!
+s8W-!s8W-!s8W-!s8W,_nG+nibVajo2Lit0J'Bp&br:0tH)fa$s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8T7FlSO(714@A$I*=9kb:e1b/U>MkH-7^_as_GU-?[EUFNG_Ja<5KD*cT.=DT3Q2`YWF0
+'PbT!BZ(En_[L(n$"LgV@DN%O]Dt*H!'Gc34FdDoJH,ZLs8W*!4FdDoJ,h]^!'GcB=/R$V`u]3?
++E>IpN7.b+s8W-!s8W-!s8W-!s8W-!s8W,^nG+_ab:n:d0mq2"I*=?obVFUj1O[KMbNo3.s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s*q3//pb\mH-7^_asqVXE2;7RnbVSBqK&Oh,'(c7dd>]Lp"8F"
+fB2bXjn76ep"&6tf&cSTjRq'aoLOnf"^o.K?GHP9UB!E,!'Gc34FdDoJH,ZLs8W-!s8N']J,h]^
+!'Gc66AQFn`#<L4*,ikeM:)A's8W-!s8W-!s8W-!s8W-!s8W,]n+eGXat%_Z/:#AiH-7dbb:\+a
+/pb]"JBcm6pAb0ms8W-!s8W-!s8W-!s8W-!s8W-!s7lHh<0G`ZG0)+SaX))OkOA<Is8W-!s7H*a
+*cT0Pk4ScSs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s&5'0!a`YB>eU2'L]BPf!'Gc34FmJ3s8W-!
+s8W-!s8N']J,h]^!'Gc34FdiAW"s0f(Mq&WLX?)$s8W-!s8W-!s8W-!s8W-!s8W,]n+e8PaX2/P
+-[*T[G0).UashPW.<io`GKNaDe+ie<s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!jR2e"Ia''Wa<>TF
+`nU%`s8W-!s3]iu)/[CFjn8ZRs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s%ng,!+!A?:Sn+SJ,h]^
+!'Gc34FmJ3s8W-!s8W-!s8W-!rr>03!'Gc34FdJuL(Iq3'5>B9H-;Ykk*s-JS&"0V^uh0&k+0?O
+S\aKM\Dn`Qa<GZG,'1gMF3#SIa<YlL,]q-RFNGeMa_[^*TYflb_WRT/kF]WST>Kc`_WRQ.kFTNQ
+T#'T%T%P-&`uK$<.sT3lZf-_Hi@/un'PbTqS(M_Vgi'"CDPPs'U>'LXg1m;7BqO*mT@mkLfcbCW
+!*d)95DB/#J,h]^!'Gf3s8W-!s8W-!s8W-!s8W-!rr>03!'Gc34FdDoJ-Jc=%VETiB>bEr`"Qk(
+'l(]'CW.-,`>NO4)K!J5DT3Z7`uT*=*H9%?E5s&>`uf<A+*#=CEQ92A`uf<A+*#=CEQ9/?`u]3?
+*cT.?DoWl:`uK!:)fEY6D8mE/`YWI1(2Ll'C;gj#`"?\$&8/okB#>$f_[9nj#\(XT@DN(R_#drY
+!+!A??,-GG^]7ZU!(r^\4FdDoJ,h]^!'Gf3s8W-!s8W-!s8W-!s8W-!s8W-!!'Gc34FdDoJ,h]_
+#[4MBAA\jf_[g@s&8/ooBZ(Qu`"Zt*'l(]'CW.*+`>EF2)/R;1D8mK2`Yr^6)K*P5DT3W5`Z&g8
+)K*P5DT3T3`Yr^6)/[A1CrR<.`><=/(2Ll(C;gm$`=lt(&ST)oB>b9l_[U1p$Y7*\A&8I[_$4;`
+"CJtH?GHPH^]7ZU!+!A??,-GG^]7B=!'Gf44FdDoJ,h]^s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+!'Gc34FdDoJ,h]^!C2DF?G$SR_?sei$tR6bA]#!i_[gCt&8/onBZ(Nt`"Qk''PYN#C;gp&`>*.,
+(2Ll)CW.')`>37.(2Ll)CW.$'`>*.,'PbT$BuLa"`"Hb%&ST)oB>b<m_[^:r%;!EbAAS[`_?aVf
+#@YFP@)2qP^]@cW!+!A??,-GG^]7ZU!+!A??,-GD])Y*O!'Gc34FdDoJ,h]^s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W*!4FdDoJ,h]^!'Gc47?I^[^BS)^#@YFS@_rI^_@'nk$tR6bA]#!h_[^:r
+%q`]jB>b?o`"6S"&ST)pBZ(Kr`"?\$&ST)pB>b?o`"6S"%qicjB#>*j_[U1p$t[<aAAS[`_?j_h
+#\(XU@DN+T_$",]!a`YC?,-GG^]7ZU!+!A??,-GG^]7ZU!+!A?>e^8,O8qCn!'Gc34FdDoJH,ZL
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8N']J,h]^!'Gc34FdE&QiUL.!a`YF?blnR_$4>a
+#@YFS@_rF\_?j_h$=gp\AAS^b_@0tm$tR6aA]"pf_[L+o$tR6aAA\dc_@'nk$Y7*]A&8O^_?aVf
+#\(XU@DN.U_$+5_"(/hF?GHSI^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!>>8=0B>J,h]^
+!'Gc34FmJ3s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!rr>03!'Gc34FdDoJ,i31
+!+!>>?,-JH^]IiX!a`YE?bceO_$+5_"^o.N@DN.V_$=Db#@YFR@DN1W_$=Db#@YFR@DN1W_$4>a
+#%>=O@)3"S_$",]"(/hF?GHSJ^]@`V!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZT
+!(r[[4FdDoJ,h]^!'Gf3s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!rr>03
+!'Gc34FdDoJ,h]^!(`IW>e^8E^]7ZU!+!A??,-GG^]@`V!F<JA?GHVK^]IiX!a`YD?GHVK^]IiX
+!a`YD?GHVK^]IiX!FEPB?,-JH^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU
+!+!A??,-GF^Apfl!'Gc34FdDoJ,h]^!'Gf3s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!!'Gc34FdDoJ,h]^!'Gc37$%CP])Z-P!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU
+!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU
+!+!A??,-GG^]7ZU!+!A?>.Xc&O8qCn!'Gc34FdDoJ,h]^s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W*!4FdDoJ,h]^!'Gc34FdDsLB(>Y!+!A??,-GG^]7ZU
+!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU
+!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!*-6'5_f>%J,h]^!'Gc34FdDoJH,ZLs8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8N']J,h]^!'Gc34FdDoJ,h]_
+!(r^\>J'rA^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU
+!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GE]DtQn!'Gf44FdDoJ,h]^!'Gc34FmJ3s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+!'Gc34FdDoJ,h]^!'Gc35DB/6V>sl8!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU
+!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!*m5<:Sn+VL&a>d!'Gc34FdDoJ,h]^
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W*!4FdDoJ,h]^!'Gc34FdDoJ,hij!)B9h>Isl@^]7ZU!+!A??,-GG^]7ZU
+!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GE])YU$!'l>?4FdDoJ,h]^
+!'Gc34FdDoJH,ZLs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8N']J,h]^!'Gc34FdDoJ,h]^!'Gc34b<Z(PlO^^
+!*d)9?,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7ZU!+!A??,-GG^]7TO!)ffs8!O';JcIo`
+!'Gc34FdDoJ,h]^!'Gc34FmJ3s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!!'Gc34FdDoJ,h]^
+!'Gc34FdDoJ,h]^!'Gf46Atn9RK--[!*$*$=0qs1\H#gF!*Zu7=h+N6ZiF(.!)KEk8X]WGMuYtk
+!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8N']J,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^
+!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FmJ3s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^
+!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!!'Gc34FdDoJ,h]^
+!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^!'Gc34FdDoJ,h]^s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!~>
+Q
+cleartomark end end pagesave restore showpage
+%%PageTrailer
+%%Trailer
+%%Pages: 1
diff --git a/src/kile/kile.cpp b/src/kile/kile.cpp
new file mode 100644
index 0000000..75f3b2a
--- /dev/null
+++ b/src/kile/kile.cpp
@@ -0,0 +1,2337 @@
+/****************************************************************************************
+ begin : sam jui 13 09:50:06 CEST 2002
+ copyright : (C) 2003 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
+ (C) 2007 by Michel Ludwig (michel.ludwig@kdemail.net)
+ (C) 2007 Holger Danielsson (holger.danielsson@versanet.de)
+ ****************************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// 2007-03-12 dani
+// - use KileDocument::Extensions
+
+#include "kile.h"
+
+#include <qtooltip.h>
+#include <qguardedptr.h>
+
+#include <kaction.h>
+#include <khelpmenu.h>
+#include <kmenubar.h>
+#include <kstatusbar.h>
+#include "kiledebug.h"
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <krun.h>
+#include <kkeydialog.h>
+#include <kedittoolbar.h>
+#include <kstandarddirs.h>
+#include <kmultitabbar.h>
+#include <ktabwidget.h>
+#include <ktip.h>
+#include <ktexteditor/configinterface.h>
+#include <dcopclient.h>
+
+#include "kileapplication.h"
+#include "kiledocumentinfo.h"
+#include "kileactions.h"
+#include "kilestdactions.h"
+#include "usermenudialog.h"
+#include "kileconfigdialog.h"
+#include "kileproject.h"
+#include "kileprojectview.h"
+#include "kileprojectdlgs.h"
+#include "kilelistselector.h"
+#include "kilelyxserver.h"
+#include "kilegrepdialog.h"
+#include "kiletool_enums.h"
+#include "kiletool.h"
+#include "kiletoolmanager.h"
+#include "kilestdtools.h"
+#include "kilelogwidget.h"
+#include "kileoutputwidget.h"
+#include "kilekonsolewidget.h"
+#include "quickdocumentdialog.h"
+#include "tabbingdialog.h"
+#include "kilestructurewidget.h"
+#include "convert.h"
+#include "includegraphicsdialog.h"
+#include "kiledocmanager.h"
+#include "kileviewmanager.h"
+#include "kileeventfilter.h"
+#include "kileconfig.h"
+#include "kileerrorhandler.h"
+#include "configcheckerdlg.h"
+#include "kilesidebar.h"
+#include "symbolview.h"
+#include "floatdialog.h"
+#include "mathenvdialog.h"
+#include "tabulardialog.h"
+#include "postscriptdialog.h"
+#include "latexcmd.h"
+#include "kileuntitled.h"
+#include "kilestatsdlg.h"
+#include "scriptsmanagementwidget.h"
+#include "kilejscript.h"
+#include "previewwidget.h"
+
+Kile::Kile( bool allowRestore, QWidget *parent, const char *name ) :
+ DCOPObject( "Kile" ),
+ KParts::MainWindow( parent, name),
+ KileInfo(this),
+ m_paPrint(0L)
+{
+ m_focusWidget = this;
+
+ m_config = KGlobal::config();
+ readUserSettings();
+ readRecentFileSettings();
+
+ m_jScriptManager = new KileJScript::Manager(this, m_config, actionCollection(), parent, "KileJScript::Manager");
+
+ setStandardToolBarMenuEnabled(true);
+
+ m_masterName = KileConfig::master();
+ m_singlemode = (m_masterName.isEmpty());
+
+ m_AutosaveTimer = new QTimer();
+ connect(m_AutosaveTimer,SIGNAL(timeout()),this,SLOT(autoSaveAll()));
+
+ m_latexCommands = new KileDocument::LatexCommands(m_config,this); // at first (dani)
+ m_edit = new KileDocument::EditorExtension(this);
+ m_help = new KileHelp::Help(m_edit);
+ m_partManager = new KParts::PartManager( this );
+ m_eventFilter = new KileEventFilter(m_edit);
+ m_errorHandler = new KileErrorHandler(this, this);
+ m_quickPreview = new KileTool::QuickPreview(this);
+ m_extensions = new KileDocument::Extensions();
+
+ connect( m_partManager, SIGNAL( activePartChanged( KParts::Part * ) ), this, SLOT(activePartGUI ( KParts::Part * ) ) );
+ connect(this,SIGNAL(configChanged()), m_eventFilter, SLOT(readConfig()));
+
+ readGUISettings();
+
+ KGlobal::dirs()->addResourceType( "app_symbols",KStandardDirs::kde_default("data") + "kile/mathsymbols/"); // needed for Symbolview
+
+
+ setXMLFile( "kileui.rc" );
+
+ // do initializations first
+ m_currentState = m_wantState = "Editor";
+ m_bWatchFile = m_logPresent = false;
+
+ viewManager()->setClient(this, this);
+
+ setupStatusBar();
+
+ m_topWidgetStack = new QWidgetStack( this );
+ m_topWidgetStack->setFocusPolicy(QWidget::NoFocus);
+
+ m_horizontalSplitter = new QSplitter(QSplitter::Horizontal,m_topWidgetStack, "horizontalSplitter" );
+
+ setupSideBar();
+
+ m_verticalSplitter=new QSplitter(QSplitter::Vertical, m_horizontalSplitter, "verticalSplitter");
+ viewManager()->createTabs(m_verticalSplitter);
+
+ connect(viewManager(), SIGNAL(activateView(QWidget*, bool)), this, SLOT(activateView(QWidget*, bool)));
+ connect(viewManager(), SIGNAL(prepareForPart(const QString& )), this, SLOT(prepareForPart(const QString& )));
+ connect(viewManager(), SIGNAL(startQuickPreview(int)), this, SLOT(slotQuickPreview(int)) );
+
+ setupBottomBar();
+ setupGraphicTools();
+ setupPreviewTools();
+ setupActions();
+ setupTools();
+
+ QValueList<int> sizes;
+ sizes << m_verSplitTop << m_verSplitBottom;
+ m_verticalSplitter->setSizes( sizes );
+ sizes.clear();
+ sizes << m_horSplitLeft << m_horSplitRight;
+ m_horizontalSplitter->setSizes( sizes );
+ if ( ! KileConfig::bottomBar() )
+ {
+ m_actionMessageView->activate();
+ m_bottomBar->setSize(KileConfig::bottomBarSize());
+ }
+
+ m_topWidgetStack->addWidget(m_horizontalSplitter , 0);
+ setCentralWidget(m_topWidgetStack);
+ newCaption();
+
+ m_partManager->setActivePart( 0L );
+
+ m_lyxserver = new KileLyxServer(KileConfig::runLyxServer());
+ connect(m_lyxserver, SIGNAL(insert(const KileAction::TagData &)), this, SLOT(insertTag(const KileAction::TagData &)));
+
+ applyMainWindowSettings(m_config, "KileMainWindow" );
+
+ m_manager = new KileTool::Manager(this, m_config, m_logWidget, m_outputWidget, m_partManager, m_topWidgetStack, m_paStop, 10000); //FIXME make timeout configurable
+ connect(m_manager, SIGNAL(requestGUIState(const QString &)), this, SLOT(prepareForPart(const QString &)));
+ connect(m_manager, SIGNAL(requestSaveAll(bool, bool)), docManager(), SLOT(fileSaveAll(bool, bool)));
+ connect(m_manager, SIGNAL(jumpToFirstError()), m_errorHandler, SLOT(jumpToFirstError()));
+ connect(m_manager, SIGNAL(toolStarted()), m_errorHandler, SLOT(reset()));
+ connect(m_manager, SIGNAL(previewDone()), this, SLOT(focusPreview()));
+
+ m_toolFactory = new KileTool::Factory(m_manager, m_config);
+ m_manager->setFactory(m_toolFactory);
+ m_help->setUserhelp(m_manager,menuBar()); // kile user help (dani)
+
+ connect(docManager(), SIGNAL(updateModeStatus()), this, SLOT(updateModeStatus()));
+ connect(docManager(), SIGNAL(updateStructure(bool, KileDocument::Info*)), viewManager(), SLOT(updateStructure(bool, KileDocument::Info*)));
+ connect(docManager(), SIGNAL(closingDocument(KileDocument::Info* )), m_kwStructure, SLOT(closeDocumentInfo(KileDocument::Info *)));
+ connect(docManager(), SIGNAL(documentInfoCreated(KileDocument::Info* )), m_kwStructure, SLOT(addDocumentInfo(KileDocument::Info* )));
+ connect(docManager(), SIGNAL(updateReferences(KileDocument::Info *)), m_kwStructure, SLOT(updateReferences(KileDocument::Info *)));
+
+ readConfig();
+
+ KileApplication::closeSplash();
+
+ resize(KileConfig::mainwindowWidth(), KileConfig::mainwindowHeight());
+ show();
+
+ if ( m_listUserTools.count() > 0 )
+ {
+ KMessageBox::information(0, i18n("You have defined some tools in the User menu. From now on these tools will be available from the Build->Other menu and can be configured in the configuration dialog (go to the Settings menu and choose Configure Kile). This has some advantages; your own tools can now be used in a QuickBuild command if you wish."), i18n("User Tools Detected"));
+ m_listUserTools.clear();
+ }
+
+ KTipDialog::showTip(this, "kile/tips");
+
+ restoreFilesAndProjects(allowRestore);
+ initMenu();
+ updateModeStatus();
+
+actionCollection()->readShortcutSettings("Shortcuts", m_config);
+}
+
+Kile::~Kile()
+{
+ KILE_DEBUG() << "cleaning up..." << endl;
+ delete m_extensions;
+ delete m_latexCommands;
+ delete m_quickPreview;
+ delete m_edit;
+ delete m_help;
+ delete m_AutosaveTimer;
+ delete m_lyxserver; //QObject without parent, have to delete it ourselves
+ delete m_outputInfo;
+ delete m_outputFilter;
+ delete m_eventFilter;
+}
+
+void Kile::showEvent(QShowEvent *)
+{
+ m_focusWidget->setFocus();
+}
+
+void Kile::hideEvent(QHideEvent *)
+{
+ m_focusWidget = focusWidget();
+}
+
+void Kile::setupStatusBar()
+{
+ statusBar()->removeItem(ID_LINE_COLUMN);
+ statusBar()->removeItem(ID_HINTTEXT);
+
+ statusBar()->insertItem(i18n("Line: 1 Col: 1"), ID_LINE_COLUMN, 0, true);
+ statusBar()->setItemAlignment( ID_LINE_COLUMN, AlignLeft|AlignVCenter );
+ statusBar()->insertItem(i18n("Normal Mode"), ID_HINTTEXT,10);
+ statusBar()->setItemAlignment( ID_HINTTEXT, AlignLeft|AlignVCenter );
+}
+
+void Kile::setupSideBar()
+{
+ m_sideBar = new KileSideBar(KileConfig::sideBarSize(), m_horizontalSplitter);
+
+ m_fileSelector= new KileFileSelect(m_extensions,m_sideBar,"File Selector");
+ m_sideBar->addTab(m_fileSelector, SmallIcon("fileopen"), i18n("Open File"));
+ connect(m_fileSelector,SIGNAL(fileSelected(const KFileItem*)), docManager(), SLOT(fileSelected(const KFileItem*)));
+ connect(m_fileSelector->comboEncoding(), SIGNAL(activated(int)),this,SLOT(changeInputEncoding()));
+ m_fileSelector->comboEncoding()->lineEdit()->setText(KileConfig::defaultEncoding());
+ m_fileSelector->readConfig();
+
+ setupProjectView();
+ setupStructureView();
+ setupSymbolViews();
+ setupScriptsManagementView();
+ setupAbbreviationView();
+
+ m_sideBar->showTab(KileConfig::selectedLeftView());
+ m_sideBar->setVisible(KileConfig::sideBar());
+ m_sideBar->setSize(KileConfig::sideBarSize());
+}
+
+void Kile::setupProjectView()
+{
+ KileProjectView *projectview = new KileProjectView(m_sideBar, this);
+// viewManager()->setProjectView(projectview);
+ m_sideBar->addTab(projectview, SmallIcon("relation"), i18n("Files and Projects"));
+ connect(projectview, SIGNAL(fileSelected(const KileProjectItem *)), docManager(), SLOT(fileSelected(const KileProjectItem *)));
+ connect(projectview, SIGNAL(fileSelected(const KURL &)), docManager(), SLOT(fileSelected(const KURL &)));
+ connect(projectview, SIGNAL(closeURL(const KURL&)), docManager(), SLOT(fileClose(const KURL&)));
+ connect(projectview, SIGNAL(closeProject(const KURL&)), docManager(), SLOT(projectClose(const KURL&)));
+ connect(projectview, SIGNAL(projectOptions(const KURL&)), docManager(), SLOT(projectOptions(const KURL&)));
+ connect(projectview, SIGNAL(projectArchive(const KURL&)), this, SLOT(runArchiveTool(const KURL&)));
+ connect(projectview, SIGNAL(removeFromProject(const KileProjectItem *)), docManager(), SLOT(removeFromProject(const KileProjectItem *)));
+ connect(projectview, SIGNAL(addFiles(const KURL &)), docManager(), SLOT(projectAddFiles(const KURL &)));
+ connect(projectview, SIGNAL(openAllFiles(const KURL &)), docManager(), SLOT(projectOpenAllFiles(const KURL &)));
+ connect(projectview, SIGNAL(toggleArchive(KileProjectItem *)), docManager(), SLOT(toggleArchive(KileProjectItem *)));
+ connect(projectview, SIGNAL(addToProject(const KURL &)), docManager(), SLOT(addToProject(const KURL &)));
+ connect(projectview, SIGNAL(saveURL(const KURL &)), docManager(), SLOT(saveURL(const KURL &)));
+ connect(projectview, SIGNAL(buildProjectTree(const KURL &)), docManager(), SLOT(buildProjectTree(const KURL &)));
+ connect(docManager(), SIGNAL(projectTreeChanged(const KileProject *)), projectview, SLOT(refreshProjectTree(const KileProject *)));
+ connect(docManager(), SIGNAL(removeFromProjectView(const KURL &)),projectview,SLOT(remove(const KURL &)));
+ connect(docManager(), SIGNAL(removeFromProjectView(const KileProject *)),projectview,SLOT(remove(const KileProject *)));
+ connect(docManager(), SIGNAL(addToProjectView(const KURL &)),projectview,SLOT(add(const KURL &)));
+ connect(docManager(), SIGNAL(addToProjectView(const KileProject *)),projectview,SLOT(add(const KileProject *)));
+ connect(docManager(),SIGNAL(removeItemFromProjectView(const KileProjectItem *, bool)),projectview,SLOT(removeItem(const KileProjectItem *, bool)));
+ connect(docManager(),SIGNAL(addToProjectView(KileProjectItem *)),projectview,SLOT(add(KileProjectItem *)));
+}
+
+void Kile::setupStructureView()
+{
+ m_kwStructure = new KileWidget::Structure(this, m_sideBar);
+ m_sideBar->addTab(m_kwStructure, SmallIcon("view_tree"), i18n("Structure"));
+ m_kwStructure->setFocusPolicy(QWidget::ClickFocus);
+ connect(this, SIGNAL(configChanged()), m_kwStructure, SIGNAL(configChanged()));
+ connect(m_kwStructure, SIGNAL(setCursor(const KURL &,int,int)), this, SLOT(setCursor(const KURL &,int,int)));
+ connect(m_kwStructure, SIGNAL(fileOpen(const KURL&, const QString & )), docManager(), SLOT(fileOpen(const KURL&, const QString& )));
+ connect(m_kwStructure, SIGNAL(fileNew(const KURL&)), docManager(), SLOT(fileNew(const KURL&)));
+ connect(m_kwStructure, SIGNAL(sendText(const QString &)), this, SLOT(insertText(const QString &)));
+ connect(m_kwStructure, SIGNAL(sectioningPopup(KileListViewItem *,int)), m_edit, SLOT(sectioningCommand(KileListViewItem *,int)));
+}
+
+void Kile::setupScriptsManagementView()
+{
+ m_scriptsManagementWidget = new KileWidget::ScriptsManagement(this, m_sideBar);
+ connect((QObject*)editorKeySequenceManager(), SIGNAL(watchedKeySequencesChanged()), m_scriptsManagementWidget, SLOT(updateListView()));
+ m_sideBar->addTab(m_scriptsManagementWidget, SmallIcon("jspage"), i18n("Scripts"));
+}
+
+void Kile::enableSymbolViewMFUS()
+{
+ m_toolBox->setItemEnabled(m_toolBox->indexOf(m_symbolViewMFUS),true);
+ m_toolBox->setItemToolTip(m_toolBox->indexOf(m_symbolViewMFUS),
+ i18n("Move the mouse over an icon to see the corresponding LaTeX command.\n \
+ Click on an icon to insert the command, additionally pressing SHIFT inserts it in math mode,\
+ pressing CTRL in curly brackets."));
+
+ connect(m_symbolViewRelation,SIGNAL(addToList(const QIconViewItem *)),m_symbolViewMFUS,SLOT(slotAddToList(const QIconViewItem *)));
+ connect(m_symbolViewOperators,SIGNAL(addToList(const QIconViewItem *)),m_symbolViewMFUS,SLOT(slotAddToList(const QIconViewItem *)));
+ connect(m_symbolViewArrows,SIGNAL(addToList(const QIconViewItem *)),m_symbolViewMFUS,SLOT(slotAddToList(const QIconViewItem *)));
+ connect(m_symbolViewMiscMath,SIGNAL(addToList(const QIconViewItem *)),m_symbolViewMFUS,SLOT(slotAddToList(const QIconViewItem *)));
+ connect(m_symbolViewMiscText,SIGNAL(addToList(const QIconViewItem *)),m_symbolViewMFUS,SLOT(slotAddToList(const QIconViewItem *)));
+ connect(m_symbolViewDelimiters,SIGNAL(addToList(const QIconViewItem *)),m_symbolViewMFUS,SLOT(slotAddToList(const QIconViewItem *)));
+ connect(m_symbolViewGreek,SIGNAL(addToList(const QIconViewItem *)),m_symbolViewMFUS,SLOT(slotAddToList(const QIconViewItem *)));
+ connect(m_symbolViewSpecial,SIGNAL(addToList(const QIconViewItem *)),m_symbolViewMFUS,SLOT(slotAddToList(const QIconViewItem *)));
+ connect(m_symbolViewCyrillic,SIGNAL(addToList(const QIconViewItem *)),m_symbolViewMFUS,SLOT(slotAddToList(const QIconViewItem *)));
+ connect(m_symbolViewUser,SIGNAL(addToList(const QIconViewItem *)),m_symbolViewMFUS,SLOT(slotAddToList(const QIconViewItem *)));
+}
+
+void Kile::disableSymbolViewMFUS()
+{
+ m_toolBox->setItemEnabled(m_toolBox->indexOf(m_symbolViewMFUS),false);
+ m_toolBox->setItemToolTip(m_toolBox->indexOf(m_symbolViewMFUS),QString());
+ disconnect(m_symbolViewMFUS,SIGNAL(addtoList(const QIconViewItem *)));
+}
+
+
+
+void Kile::setupSymbolViews()
+{
+ m_toolBox = new QToolBox(m_sideBar);
+ m_sideBar->addTab(m_toolBox,SmallIcon("math0"),i18n("Symbols"));
+
+ m_symbolViewMFUS = new SymbolView(m_toolBox,SymbolView::MFUS);
+ m_toolBox->addItem(m_symbolViewMFUS,i18n("Most Frequently Used"));
+ m_toolBox->setItemEnabled(m_toolBox->indexOf(m_symbolViewMFUS),false);
+ connect(m_symbolViewMFUS, SIGNAL(insertText(const QString& ,const QStringList&)),
+ this, SLOT(insertText(const QString& ,const QStringList&)));
+
+ m_symbolViewRelation = new SymbolView(m_toolBox,SymbolView::Relation);
+ m_toolBox->addItem(m_symbolViewRelation,SmallIcon("math1"),i18n("Relation"));
+ connect(m_symbolViewRelation, SIGNAL(insertText(const QString& ,const QStringList&)),
+ this, SLOT(insertText(const QString& ,const QStringList&)));
+
+ m_symbolViewOperators = new SymbolView(m_toolBox,SymbolView::Operator);
+ m_toolBox->addItem(m_symbolViewOperators,SmallIcon("math2"),i18n("Operators"));
+ connect(m_symbolViewOperators, SIGNAL(insertText(const QString& ,const QStringList&)),
+ this, SLOT(insertText(const QString& ,const QStringList&)));
+
+ m_symbolViewArrows = new SymbolView(m_toolBox,SymbolView::Arrow);
+ m_toolBox->addItem(m_symbolViewArrows,SmallIcon("math3"),i18n("Arrows"));
+ connect(m_symbolViewArrows, SIGNAL(insertText(const QString& ,const QStringList&)),
+ this, SLOT(insertText(const QString& ,const QStringList&)));
+
+ m_symbolViewMiscMath = new SymbolView(m_toolBox,SymbolView::MiscMath);
+ m_toolBox->addItem(m_symbolViewMiscMath,SmallIcon("math4"),i18n("Miscellaneous Math"));
+ connect(m_symbolViewMiscMath, SIGNAL(insertText(const QString& ,const QStringList&)),
+ this, SLOT(insertText(const QString& ,const QStringList&)));
+
+ m_symbolViewMiscText = new SymbolView(m_toolBox,SymbolView::MiscText);
+ m_toolBox->addItem(m_symbolViewMiscText,SmallIcon("math5"),i18n("Miscellaneous Text"));
+ connect(m_symbolViewMiscText, SIGNAL(insertText(const QString& ,const QStringList&)),
+ this, SLOT(insertText(const QString& ,const QStringList&)));
+
+ m_symbolViewDelimiters= new SymbolView(m_toolBox,SymbolView::Delimiters);
+ m_toolBox->addItem(m_symbolViewDelimiters,SmallIcon("math6"),i18n("Delimiters"));
+ connect(m_symbolViewDelimiters, SIGNAL(insertText(const QString& ,const QStringList&)),
+ this, SLOT(insertText(const QString& ,const QStringList&)));
+
+ m_symbolViewGreek = new SymbolView(m_toolBox,SymbolView::Greek);
+ m_toolBox->addItem(m_symbolViewGreek,SmallIcon("math7"),i18n("Greek"));
+ connect(m_symbolViewGreek, SIGNAL(insertText(const QString&, const QStringList&)),
+ this, SLOT(insertText(const QString&, const QStringList&)));
+
+ m_symbolViewSpecial = new SymbolView(m_toolBox,SymbolView::Special);
+ m_toolBox->addItem(m_symbolViewSpecial,SmallIcon("math8"),i18n("Special Characters"));
+ connect(m_symbolViewSpecial, SIGNAL(insertText(const QString& ,const QStringList&)),
+ this, SLOT(insertText(const QString&, const QStringList&)));
+
+ m_symbolViewCyrillic = new SymbolView(m_toolBox,SymbolView::Cyrillic);
+ m_toolBox->addItem(m_symbolViewCyrillic,SmallIcon("math10"),i18n("Cyrillic Characters"));
+ connect(m_symbolViewCyrillic, SIGNAL(insertText(const QString& ,const QStringList&)),
+ this, SLOT(insertText(const QString&, const QStringList&)));
+
+ m_symbolViewUser = new SymbolView(m_toolBox,SymbolView::User);
+ m_toolBox->addItem(m_symbolViewUser,SmallIcon("math9"),i18n("User Defined"));
+ connect(m_symbolViewUser, SIGNAL(insertText(const QString&, const QStringList&)),
+ this, SLOT(insertText(const QString&, const QStringList& )));
+
+ for (int i=0; i< m_toolBox->count(); i++)
+ m_toolBox->setItemToolTip(i, i18n("Move the mouse over the icons to see the corresponding LaTeX commands.\nClick on the images to insert the command, additionally pressing SHIFT inserts it in math mode, pressing CTRL in curly brackets."));
+}
+
+void Kile::setupAbbreviationView()
+{
+ m_kileAbbrevView = new KileAbbrevView( m_sideBar );
+ m_edit->complete()->setAbbreviationListview(m_kileAbbrevView);
+ m_sideBar->addTab(m_kileAbbrevView, SmallIcon("complete3"), i18n("Abbreviation"));
+
+ connect(m_kileAbbrevView, SIGNAL(sendText(const QString& )), this, SLOT(insertText(const QString& )));
+}
+
+void Kile::setupBottomBar()
+{
+ m_bottomBar = new KileBottomBar(KileConfig::bottomBarSize(), m_verticalSplitter);
+ m_bottomBar->setFocusPolicy(QWidget::ClickFocus);
+
+ m_logWidget = new KileWidget::LogMsg( this, m_bottomBar );
+ connect(m_logWidget, SIGNAL(showingErrorMessage(QWidget* )), m_bottomBar, SLOT(showPage(QWidget* )));
+ connect(m_logWidget, SIGNAL(fileOpen(const KURL&, const QString & )), docManager(), SLOT(fileOpen(const KURL&, const QString& )));
+ connect(m_logWidget, SIGNAL(setLine(const QString& )), this, SLOT(setLine(const QString& )));
+ connect(m_docManager,SIGNAL(printMsg(int, const QString &, const QString &)),m_logWidget,SLOT(printMsg(int, const QString &, const QString &)));
+
+ m_logWidget->setFocusPolicy(QWidget::ClickFocus);
+ m_logWidget->setMinimumHeight(40);
+ m_logWidget->setReadOnly(true);
+ m_bottomBar->addTab(m_logWidget, SmallIcon("viewlog"), i18n("Log and Messages"));
+
+ m_outputWidget = new KileWidget::Output(m_bottomBar);
+ m_outputWidget->setFocusPolicy(QWidget::ClickFocus);
+ m_outputWidget->setMinimumHeight(40);
+ m_outputWidget->setReadOnly(true);
+ m_bottomBar->addTab(m_outputWidget, SmallIcon("output_win"), i18n("Output"));
+
+ m_outputInfo=new LatexOutputInfoArray();
+ m_outputFilter=new LatexOutputFilter(m_outputInfo,m_extensions);
+ connect(m_outputFilter, SIGNAL(problem(int, const QString& )), m_logWidget, SLOT(printProblem(int, const QString& )));
+
+ m_texKonsole=new KileWidget::Konsole(this, m_bottomBar,"konsole");
+ m_bottomBar->addTab(m_texKonsole, SmallIcon("konsole"),i18n("Konsole"));
+ connect(viewManager()->tabs(), SIGNAL( currentChanged( QWidget * ) ), m_texKonsole, SLOT(sync()));
+
+ m_previewView = new QScrollView (m_bottomBar);
+ m_previewWidget = new KileWidget::PreviewWidget (this, m_previewView);
+ m_previewView->viewport()->setPaletteBackgroundColor (QColor (0xff, 0xff, 0xff));
+ m_previewView->addChild(m_previewWidget, 0, 0);
+ m_bottomBar->addTab (m_previewView, SmallIcon ("edu_mathematics"), i18n ("Preview"));
+
+ m_bottomBar->setVisible(true);
+ m_bottomBar->setSize(KileConfig::bottomBarSize());
+}
+
+void Kile::setupGraphicTools()
+{
+ KileConfig::setImagemagick(!(KStandardDirs::findExe("identify").isNull()));
+}
+
+void Kile::setupPreviewTools()
+{
+ // search for tools
+ bool dvipng = !(KStandardDirs::findExe("dvipng").isNull());
+ bool convert = !(KStandardDirs::findExe("convert").isNull());
+
+ KileConfig::setDvipng(dvipng);
+ KileConfig::setConvert(convert);
+
+ // disable some previews, if tools are missing
+ if ( ! dvipng )
+ {
+ KileConfig::setMathgroupPreviewInWidget(false); // no mathgroup preview in bottom bar
+ if ( ! convert )
+ {
+ KileConfig::setEnvPreviewInWidget(false); // no preview in bottom bar at all
+ KileConfig::setSelPreviewInWidget(false);
+ }
+ }
+}
+
+void Kile::setupActions()
+{
+ m_paPrint = KStdAction::print(0,0, actionCollection(), "file_print");
+ (void) KStdAction::openNew(docManager(), SLOT(fileNew()), actionCollection(), "file_new" );
+ (void) KStdAction::open(docManager(), SLOT(fileOpen()), actionCollection(),"file_open" );
+ m_actRecentFiles = KStdAction::openRecent(docManager(), SLOT(fileOpen(const KURL&)), actionCollection(), "file_open_recent");
+ connect(docManager(), SIGNAL(addToRecentFiles(const KURL& )), m_actRecentFiles, SLOT(addURL(const KURL& )));
+ m_actRecentFiles->loadEntries(m_config, "Recent Files");
+
+ (void) KStdAction::save(docManager(), SLOT(fileSave()), actionCollection(),"kile_file_save" );
+ (void) KStdAction::saveAs(docManager(), SLOT(fileSaveAs()), actionCollection(),"kile_file_save_as" );
+
+ (void) new KAction(i18n("Save All"),"save_all", 0, docManager(), SLOT(fileSaveAll()), actionCollection(),"file_save_all");
+ (void) new KAction(i18n("Save Copy As..."),"save_copy_as", 0, docManager(), SLOT(fileSaveCopyAs()), actionCollection(),"file_save_copy_as");
+ (void) new KAction(i18n("Create Template From Document..."), 0, docManager(), SLOT(createTemplate()), actionCollection(),"template_create");
+ (void) new KAction(i18n("&Remove Template..."),0, docManager(), SLOT(removeTemplate()), actionCollection(), "template_remove");
+ (void) KStdAction::close(docManager(), SLOT(fileClose()), actionCollection(),"file_close" );
+ (void) new KAction(i18n("Close All"), 0, docManager(), SLOT(fileCloseAll()), actionCollection(),"file_close_all" );
+ (void) new KAction(i18n("Close All Ot&hers"), 0, docManager(), SLOT(fileCloseAllOthers()), actionCollection(),"file_close_all_others" );
+ (void) new KAction(i18n("S&tatistics"), 0, this, SLOT(showDocInfo()), actionCollection(), "Statistics" );
+ (void) new KAction(i18n("&ASCII"), 0, this, SLOT(convertToASCII()), actionCollection(), "file_export_ascii" );
+ (void) new KAction(i18n("Latin-&1 (iso 8859-1)"), 0, this, SLOT(convertToEnc()), actionCollection(), "file_export_latin1" );
+ (void) new KAction(i18n("Latin-&2 (iso 8859-2)"), 0, this, SLOT(convertToEnc()), actionCollection(), "file_export_latin2" );
+ (void) new KAction(i18n("Latin-&3 (iso 8859-3)"), 0, this, SLOT(convertToEnc()), actionCollection(), "file_export_latin3" );
+ (void) new KAction(i18n("Latin-&4 (iso 8859-4)"), 0, this, SLOT(convertToEnc()), actionCollection(), "file_export_latin4" );
+ (void) new KAction(i18n("Latin-&5 (iso 8859-5)"), 0, this, SLOT(convertToEnc()), actionCollection(), "file_export_latin5" );
+ (void) new KAction(i18n("Latin-&9 (iso 8859-9)"), 0, this, SLOT(convertToEnc()), actionCollection(), "file_export_latin9" );
+ (void) new KAction(i18n("&Central European (cp-1250)"), 0, this, SLOT(convertToEnc()), actionCollection(), "file_export_cp1250" );
+ (void) new KAction(i18n("&Western European (cp-1252)"), 0, this, SLOT(convertToEnc()), actionCollection(), "file_export_cp1252" );
+ (void) KStdAction::quit(this, SLOT(close()), actionCollection(),"file_quit" );
+
+ (void) KStdAction::gotoLine(m_edit, SLOT(gotoLine()), actionCollection(),"edit_goto_line" );
+ (void) new KAction(i18n("Next section"), "nextsection", ALT+Key_Down, m_edit, SLOT(gotoNextSectioning()), actionCollection(),"edit_next_section" );
+ (void) new KAction(i18n("Prev section"), "prevsection", ALT+Key_Up, m_edit, SLOT(gotoPrevSectioning()), actionCollection(),"edit_prev_section" );
+ (void) new KAction(i18n("Next paragraph"), "nextparagraph", ALT+SHIFT+Key_Down, m_edit, SLOT(gotoNextParagraph()), actionCollection(),"edit_next_paragraph" );
+ (void) new KAction(i18n("Prev paragraph"), "prevparagraph", ALT+SHIFT+Key_Up, m_edit, SLOT(gotoPrevParagraph()), actionCollection(),"edit_prev_paragraph" );
+
+ (void) new KAction(i18n("Find &in Files..."), "filegrep", ALT+SHIFT+Key_F, this, SLOT(findInFiles()), actionCollection(),"FindInFiles" );
+
+ (void) new KAction(i18n("Refresh Str&ucture"), "refreshstructure", Key_F12, this, SLOT(refreshStructure()), actionCollection(),"RefreshStructure" );
+
+ //project actions
+ (void) new KAction(i18n("&New Project..."), "window_new", 0, docManager(), SLOT(projectNew()), actionCollection(), "project_new");
+ (void) new KAction(i18n("&Open Project..."), "project_open", 0, docManager(), SLOT(projectOpen()), actionCollection(), "project_open");
+ m_actRecentProjects = new KRecentFilesAction(i18n("Open &Recent Project"), 0, docManager(), SLOT(projectOpen(const KURL &)), actionCollection(), "project_openrecent");
+ connect(docManager(), SIGNAL(removeFromRecentProjects(const KURL& )), m_actRecentProjects, SLOT(removeURL(const KURL& )));
+ connect(docManager(), SIGNAL(addToRecentProjects(const KURL& )), m_actRecentProjects, SLOT(addURL(const KURL& )));
+ m_actRecentProjects->loadEntries(m_config, "Projects");
+
+ (void) new KAction(i18n("A&dd Files to Project..."),"project_add", 0, docManager(), SLOT(projectAddFiles()), actionCollection(), "project_add");
+ (void) new KAction(i18n("Refresh Project &Tree"), "rebuild", 0, docManager(), SLOT(buildProjectTree()), actionCollection(), "project_buildtree");
+ (void) new KAction(i18n("&Archive"), "package", 0, this, SLOT(runArchiveTool()), actionCollection(), "project_archive");
+ (void) new KAction(i18n("Project &Options"), "configure_project", 0, docManager(), SLOT(projectOptions()), actionCollection(), "project_options");
+ (void) new KAction(i18n("&Close Project"), "fileclose", 0, docManager(), SLOT(projectClose()), actionCollection(), "project_close");
+
+ // new project actions (dani)
+ (void) new KAction(i18n("&Show Projects..."), 0, docManager(), SLOT(projectShow()), actionCollection(), "project_show");
+ (void) new KAction(i18n("Re&move Files From Project..."),"project_remove", 0, docManager(), SLOT(projectRemoveFiles()), actionCollection(), "project_remove");
+ (void) new KAction(i18n("Show Project &Files..."),"project_show", 0, docManager(), SLOT(projectShowFiles()), actionCollection(), "project_showfiles");
+ // tbraun
+ (void) new KAction(i18n("Open All &Project Files"), 0, docManager(), SLOT(projectOpenAllFiles()), actionCollection(), "project_openallfiles");
+ (void) new KAction(i18n("Find in &Project..."), "projectgrep", 0, this, SLOT(findInProjects()), actionCollection(),"project_findfiles" );
+
+ //build actions
+ (void) new KAction(i18n("Clean"),"trashcan_full",0 , this, SLOT(cleanAll()), actionCollection(),"CleanAll" );
+ (void) new KAction(i18n("View Log File"),"viewlog", ALT+Key_0, m_errorHandler, SLOT(ViewLog()), actionCollection(),"ViewLog" );
+ (void) new KAction(i18n("Previous LaTeX Error"),"errorprev", 0, m_errorHandler, SLOT(PreviousError()), actionCollection(),"PreviousError" );
+ (void) new KAction(i18n("Next LaTeX Error"),"errornext", 0, m_errorHandler, SLOT(NextError()), actionCollection(),"NextError" );
+ (void) new KAction(i18n("Previous LaTeX Warning"),"warnprev", 0, m_errorHandler, SLOT(PreviousWarning()), actionCollection(),"PreviousWarning" );
+ (void) new KAction(i18n("Next LaTeX Warning"),"warnnext", 0, m_errorHandler, SLOT(NextWarning()), actionCollection(),"NextWarning" );
+ (void) new KAction(i18n("Previous LaTeX BadBox"),"bboxprev", 0, m_errorHandler, SLOT(PreviousBadBox()), actionCollection(),"PreviousBadBox" );
+ (void) new KAction(i18n("Next LaTeX BadBox"),"bboxnext", 0, m_errorHandler, SLOT(NextBadBox()), actionCollection(),"NextBadBox" );
+ m_paStop = new KAction(i18n("&Stop"),"stop",Key_Escape,0,0,actionCollection(),"Stop");
+ m_paStop->setEnabled(false);
+
+ (void) new KAction(i18n("Editor View"),"edit",CTRL+Key_E , this, SLOT(showEditorWidget()), actionCollection(),"EditorView" );
+ (void) new KAction(i18n("Next Document"),"forward",ALT+Key_Right, viewManager(), SLOT(gotoNextView()), actionCollection(), "gotoNextDocument" );
+ (void) new KAction(i18n("Previous Document"),"back",ALT+Key_Left, viewManager(), SLOT(gotoPrevView()), actionCollection(), "gotoPrevDocument" );
+ (void) new KAction(i18n("Focus Log/Messages View"), CTRL+ALT+Key_M, this, SLOT(focusLog()), actionCollection(), "focus_log");
+ (void) new KAction(i18n("Focus Output View"), CTRL+ALT+Key_O, this, SLOT(focusOutput()), actionCollection(), "focus_output");
+ (void) new KAction(i18n("Focus Konsole View"), CTRL+ALT+Key_K, this, SLOT(focusKonsole()), actionCollection(), "focus_konsole");
+ (void) new KAction(i18n("Focus Editor View"), CTRL+ALT+Key_E, this, SLOT(focusEditor()), actionCollection(), "focus_editor");
+
+ // CodeCompletion (dani)
+ (void) new KAction(i18n("(La)TeX Command"),"complete1",CTRL+Key_Space, m_edit, SLOT(completeWord()), actionCollection(), "edit_complete_word");
+ (void) new KAction(i18n("Environment"),"complete2",ALT+Key_Space, m_edit, SLOT(completeEnvironment()), actionCollection(), "edit_complete_env");
+ (void) new KAction(i18n("Abbreviation"),"complete3",CTRL+ALT+Key_Space, m_edit, SLOT(completeAbbreviation()), actionCollection(), "edit_complete_abbrev");
+
+ (void) new KAction(i18n("Next Bullet"),"nextbullet",CTRL+ALT+Key_Right, m_edit, SLOT(nextBullet()), actionCollection(), "edit_next_bullet");
+ (void) new KAction(i18n("Prev Bullet"),"prevbullet",CTRL+ALT+Key_Left, m_edit, SLOT(prevBullet()), actionCollection(), "edit_prev_bullet");
+
+ // advanced editor (dani)
+ (void) new KAction(i18n("Environment (inside)"),"selenv_i",KShortcut("CTRL+Alt+S,E"), m_edit, SLOT(selectEnvInside()), actionCollection(), "edit_select_inside_env");
+ (void) new KAction(i18n("Environment (outside)"),"selenv_o",KShortcut("CTRL+Alt+S,F"), m_edit, SLOT(selectEnvOutside()), actionCollection(), "edit_select_outside_env");
+ (void) new KAction(i18n("TeX Group (inside)"),"selgroup_i",KShortcut("CTRL+Alt+S,T"), m_edit, SLOT(selectTexgroupInside()), actionCollection(), "edit_select_inside_group");
+ (void) new KAction(i18n("TeX Group (outside)"), "selgroup_o",KShortcut("CTRL+Alt+S,U"),m_edit, SLOT(selectTexgroupOutside()), actionCollection(), "edit_select_outside_group");
+ (void) new KAction(i18n("Math Group"), "selmath",KShortcut("CTRL+Alt+S,M"),m_edit, SLOT(selectMathgroup()), actionCollection(), "edit_select_mathgroup");
+ (void) new KAction(i18n("Paragraph"),"selpar",KShortcut("CTRL+Alt+S,P"),m_edit, SLOT(selectParagraph()), actionCollection(), "edit_select_paragraph");
+ (void) new KAction(i18n("Line"),"selline",KShortcut("CTRL+Alt+S,L"),m_edit, SLOT(selectLine()), actionCollection(), "edit_select_line");
+ (void) new KAction(i18n("TeX Word"),"selword",KShortcut("CTRL+Alt+S,W"),m_edit, SLOT(selectWord()), actionCollection(), "edit_select_word");
+
+ (void) new KAction(i18n("Environment (inside)"),"delenv_i",KShortcut("CTRL+Alt+T,E"), m_edit, SLOT(deleteEnvInside()), actionCollection(), "edit_delete_inside_env");
+ (void) new KAction(i18n("Environment (outside)"),"delenv_o",KShortcut("CTRL+Alt+T,F"),m_edit, SLOT(deleteEnvOutside()), actionCollection(), "edit_delete_outside_env");
+ (void) new KAction(i18n("TeX Group (inside)"),"delgroup_i",KShortcut("CTRL+Alt+T,T"), m_edit, SLOT(deleteTexgroupInside()), actionCollection(),"edit_delete_inside_group");
+ (void) new KAction(i18n("TeX Group (outside)"),"delgroup_o",KShortcut("CTRL+Alt+T,U"),m_edit, SLOT(deleteTexgroupInside()), actionCollection(), "edit_delete_outside_group");
+ (void) new KAction(i18n("Math Group"),"delmath",KShortcut("CTRL+Alt+T,M"),m_edit, SLOT(deleteMathgroup()), actionCollection(), "edit_delete_mathgroup");
+ (void) new KAction(i18n("Paragraph"),"delpar",KShortcut("CTRL+Alt+T,P"),m_edit, SLOT(deleteParagraph()), actionCollection(), "edit_delete_paragraph");
+ (void) new KAction(i18n("To End of Line"),"deleol",KShortcut("CTRL+Alt+T,I"),m_edit, SLOT(deleteEndOfLine()), actionCollection(), "edit_delete_eol");
+ (void) new KAction(i18n("TeX Word"),"delword",KShortcut("CTRL+Alt+T,W"),m_edit, SLOT(deleteWord()), actionCollection(), "edit_delete_word");
+
+ (void) new KAction(i18n("Goto Begin"),"gotobeginenv",KShortcut("CTRL+Alt+E,B"), m_edit, SLOT(gotoBeginEnv()), actionCollection(), "edit_begin_env");
+ (void) new KAction(i18n("Goto End"),"gotoendenv",KShortcut("CTRL+Alt+E,E"), m_edit, SLOT(gotoEndEnv()), actionCollection(), "edit_end_env");
+ (void) new KAction(i18n("Match"),"matchenv",KShortcut("CTRL+Alt+E,M"), m_edit, SLOT(matchEnv()), actionCollection(), "edit_match_env");
+ (void) new KAction(i18n("Close"),"closeenv",KShortcut("CTRL+Alt+E,C"), m_edit, SLOT(closeEnv()), actionCollection(), "edit_close_env");
+ (void) new KAction(i18n("Close All"),"closeallenv",KShortcut("CTRL+Alt+E,A"), m_edit, SLOT(closeAllEnv()), actionCollection(), "edit_closeall_env");
+
+ (void) new KAction(i18n("Goto Begin"),"gotobegingroup",KShortcut("CTRL+Alt+G,B"), m_edit, SLOT(gotoBeginTexgroup()), actionCollection(), "edit_begin_group");
+ (void) new KAction(i18n("Goto End"),"gotoendgroup",KShortcut("CTRL+Alt+G,E"), m_edit, SLOT(gotoEndTexgroup()), actionCollection(), "edit_end_group");
+ (void) new KAction(i18n("Match"),"matchgroup",KShortcut("CTRL+Alt+G,M"), m_edit, SLOT(matchTexgroup()), actionCollection(), "edit_match_group");
+ (void) new KAction(i18n("Close"),"closegroup",KShortcut("CTRL+Alt+G,C"), m_edit, SLOT(closeTexgroup()), actionCollection(), "edit_close_group");
+
+ (void) new KAction(i18n("Selection"),"preview_sel",KShortcut("CTRL+Alt+P,S"), this, SLOT(quickPreviewSelection()), actionCollection(),"quickpreview_selection" );
+ (void) new KAction(i18n("Environment"),"preview_env",KShortcut("CTRL+Alt+P,E"), this, SLOT(quickPreviewEnvironment()), actionCollection(),"quickpreview_environment" );
+ (void) new KAction(i18n("Subdocument"),"preview_subdoc",KShortcut("CTRL+Alt+P,D"), this, SLOT(quickPreviewSubdocument()), actionCollection(),"quickpreview_subdocument" );
+ (void) new KAction (i18n ("Mathgroup"), "edu_mathematics", KShortcut("CTRL+Alt+P,M"), this, SLOT(quickPreviewMathgroup()), actionCollection(), "quickpreview_math");
+
+ KileStdActions::setupStdTags(this,this);
+ KileStdActions::setupMathTags(this);
+ KileStdActions::setupBibTags(this);
+
+ (void) new KAction(i18n("Quick Start"),"quickwizard",0 , this, SLOT(quickDocument()), actionCollection(),"wizard_document" );
+ connect(docManager(), SIGNAL(startWizard()), this, SLOT(quickDocument()));
+ (void) new KAction(i18n("Tabular"),"wizard_tabular",0 , this, SLOT(quickTabular()), actionCollection(),"wizard_tabular" );
+ (void) new KAction(i18n("Array"),"wizard_array",0 , this, SLOT(quickArray()), actionCollection(),"wizard_array" );
+ (void) new KAction(i18n("Tabbing"),"wizard_tabbing",0 , this, SLOT(quickTabbing()), actionCollection(),"wizard_tabbing" );
+ (void) new KAction(i18n("Floats"),"wizard_float",0, this, SLOT(quickFloat()), actionCollection(),"wizard_float" );
+ (void) new KAction(i18n("Math"),"wizard_math",0, this, SLOT(quickMathenv()), actionCollection(),"wizard_mathenv" );
+ (void) new KAction(i18n("Postscript Tools"),"wizard_pstools",0 , this, SLOT(quickPostscript()), actionCollection(),"wizard_postscript" );
+
+ (void) new KAction(i18n("Clean"),0 , this, SLOT(cleanBib()), actionCollection(),"CleanBib" );
+
+ ModeAction=new KToggleAction(i18n("Define Current Document as '&Master Document'"),"master",0 , this, SLOT(toggleMode()), actionCollection(),"Mode" );
+
+ KToggleAction *tact = new KToggleAction(i18n("Show S&ide Bar"), 0, 0, 0, actionCollection(),"StructureView" );
+ tact->setChecked(KileConfig::sideBar());
+ connect(tact, SIGNAL(toggled(bool)), m_sideBar, SLOT(setVisible(bool)));
+ connect(m_sideBar, SIGNAL(visibilityChanged(bool )), tact, SLOT(setChecked(bool)));
+ connect(m_sideBar, SIGNAL(visibilityChanged(bool )), this, SLOT(sideOrBottomBarChanged(bool)));
+
+ m_actionMessageView = new KToggleAction(i18n("Show Mess&ages Bar"), 0, 0, 0, actionCollection(),"MessageView" );
+ m_actionMessageView->setChecked(true);
+ connect(m_actionMessageView, SIGNAL(toggled(bool)), m_bottomBar, SLOT(setVisible(bool)));
+ connect(m_bottomBar, SIGNAL(visibilityChanged(bool )), m_actionMessageView, SLOT(setChecked(bool)));
+ connect(m_bottomBar, SIGNAL(visibilityChanged(bool )), this, SLOT(sideOrBottomBarChanged(bool)));
+
+ if (m_singlemode) {ModeAction->setChecked(false);}
+ else {ModeAction->setChecked(true);}
+
+ WatchFileAction=new KToggleAction(i18n("Watch File Mode"),"watchfile",0 , this, SLOT(toggleWatchFile()), actionCollection(), "WatchFile");
+ if (m_bWatchFile) {WatchFileAction->setChecked(true);}
+ else {WatchFileAction->setChecked(false);}
+
+ setHelpMenuEnabled(false);
+ const KAboutData *aboutData = KGlobal::instance()->aboutData();
+ KHelpMenu *help_menu = new KHelpMenu( this, aboutData);
+
+ KStdAction::tipOfDay(this, SLOT(showTip()), actionCollection(), "help_tipofday");
+
+ (void) new KAction(i18n("TeX Guide"),KShortcut("CTRL+Alt+H,G"), m_help, SLOT(helpTexGuide()), actionCollection(), "help_tex_guide");
+ (void) new KAction(i18n("LaTeX"),KShortcut("CTRL+Alt+H,L"), m_help, SLOT(helpLatexIndex()), actionCollection(), "help_latex_index");
+ (void) new KAction(i18n("LaTeX Command"),KShortcut("CTRL+Alt+H,C"), m_help, SLOT(helpLatexCommand()), actionCollection(), "help_latex_command");
+ (void) new KAction(i18n("LaTeX Subject"),KShortcut("CTRL+Alt+H,S"), m_help, SLOT(helpLatexSubject()), actionCollection(), "help_latex_subject");
+ (void) new KAction(i18n("LaTeX Env"),KShortcut("CTRL+Alt+H,E"), m_help, SLOT(helpLatexEnvironment()), actionCollection(), "help_latex_env");
+ (void) new KAction(i18n("Context Help"),KShortcut("CTRL+Alt+H,K"), m_help, SLOT(helpKeyword()), actionCollection(), "help_context");
+ (void) new KAction(i18n("Documentation Browser"),KShortcut("CTRL+Alt+H,B"), m_help, SLOT(helpDocBrowser()), actionCollection(), "help_docbrowser");
+
+ (void) new KAction(i18n("LaTeX Reference"),"help",0 , this, SLOT(helpLaTex()), actionCollection(),"help_latex_reference" );
+ (void) KStdAction::helpContents(help_menu, SLOT(appHelpActivated()), actionCollection(), "help_handbook");
+ (void) KStdAction::reportBug (help_menu, SLOT(reportBug()), actionCollection(), "report_bug");
+ (void) KStdAction::aboutApp(help_menu, SLOT(aboutApplication()), actionCollection(),"help_aboutKile" );
+ (void) KStdAction::aboutKDE(help_menu, SLOT(aboutKDE()), actionCollection(),"help_aboutKDE" );
+ KAction *kileconfig = KStdAction::preferences(this, SLOT(generalOptions()), actionCollection(),"settings_configure" );
+ kileconfig->setIcon("configure_kile");
+
+ (void) KStdAction::keyBindings(this, SLOT(configureKeys()), actionCollection(),"settings_keys" );
+ (void) KStdAction::configureToolbars(this, SLOT(configureToolbars()), actionCollection(),"settings_toolbars" );
+ new KAction(i18n("&System Check..."), 0, this, SLOT(slotPerformCheck()), actionCollection(), "settings_perform_check");
+
+ m_menuUserTags = new KActionMenu(i18n("User Tags"), SmallIcon("label"), actionCollection(),"menuUserTags");
+ m_menuUserTags->setDelayed(false);
+ setupUserTagActions();
+
+ actionCollection()->readShortcutSettings();
+
+ m_pFullScreen = KStdAction::fullScreen(this, SLOT(slotToggleFullScreen()), actionCollection(), this);
+}
+
+void Kile::setupTools()
+{
+ KILE_DEBUG() << "==Kile::setupTools()===================" << endl;
+ QStringList tools = KileTool::toolList(m_config);
+ QString toolMenu;
+ QPtrList<KAction> *pl;
+
+ unplugActionList("list_compilers");
+ unplugActionList("list_converters");
+ unplugActionList("list_quickies");
+ unplugActionList("list_viewers");
+ unplugActionList("list_other");
+
+ for ( uint i = 0; i < tools.count(); ++i)
+ {
+ QString grp = KileTool::groupFor(tools[i], m_config);
+ KILE_DEBUG() << tools[i] << " is using group: " << grp << endl;
+ m_config->setGroup(KileTool::groupFor(tools[i], m_config));
+ toolMenu = KileTool::menuFor(tools[i], m_config);
+
+ if ( toolMenu == "none" ) continue;
+
+ if ( toolMenu == "Compile" )
+ pl = &m_listCompilerActions;
+ else if ( toolMenu == "View" )
+ pl = &m_listViewerActions;
+ else if ( toolMenu == "Convert" )
+ pl = &m_listConverterActions;
+ else if ( toolMenu == "Quick" )
+ pl = &m_listQuickActions;
+ else
+ pl = &m_listOtherActions;
+
+ KILE_DEBUG() << "\tadding " << tools[i] << " " << toolMenu << " #" << pl->count() << endl;
+
+ if ( action(QString("tool_"+tools[i]).ascii()) == 0L )
+ {
+ KAction *act = new KAction(tools[i], KileTool::iconFor(tools[i], m_config), KShortcut(), this, SLOT(runTool()), actionCollection(), QString("tool_"+tools[i]).ascii());
+ pl->append(act);
+ }
+ }
+
+ cleanUpActionList(m_listCompilerActions, tools);
+ cleanUpActionList(m_listViewerActions, tools);
+ cleanUpActionList(m_listConverterActions, tools);
+ cleanUpActionList(m_listQuickActions, tools);
+ cleanUpActionList(m_listOtherActions, tools);
+
+ plugActionList("list_compilers", m_listCompilerActions);
+ plugActionList("list_viewers", m_listViewerActions);
+ plugActionList("list_converters", m_listConverterActions);
+ plugActionList("list_quickies", m_listQuickActions);
+ plugActionList("list_other", m_listOtherActions);
+
+ actionCollection()->readShortcutSettings("Shortcuts", m_config);
+}
+
+void Kile::cleanUpActionList(QPtrList<KAction> &list, const QStringList & tools)
+{
+ for ( KAction *act = list.first(); act; act = list.next() )
+ {
+ if ( action(act->name()) != 0L && !tools.contains(QString(act->name()).mid(5)) )
+ {
+ list.remove(act);
+ if ( act->isPlugged(toolBar("toolsToolBar")) ) act->unplug(toolBar("toolsToolBar"));
+ }
+ }
+}
+
+void Kile::setupUserTagActions()
+{
+ KShortcut tagaccels[10] = {CTRL+SHIFT+Key_1, CTRL+SHIFT+Key_2,CTRL+SHIFT+Key_3,CTRL+SHIFT+Key_4,CTRL+SHIFT+Key_5,CTRL+SHIFT+Key_6,CTRL+SHIFT+Key_7,
+ CTRL+SHIFT+Key_8,CTRL+SHIFT+Key_9,CTRL+SHIFT+Key_0};
+
+ m_actionEditTag = new KAction(i18n("Edit User Tags..."),0 , this, SLOT(editUserMenu()), m_menuUserTags,"EditUserMenu" );
+ m_menuUserTags->insert(m_actionEditTag);
+ if ( m_listUserTags.size() > 0 ) {
+ m_actionEditSeparator = new KActionSeparator();
+ m_menuUserTags->insert(m_actionEditSeparator);
+ }
+ for (uint i=0; i<m_listUserTags.size(); ++i)
+ {
+ KShortcut sc; if (i<10) { sc = tagaccels[i]; } else { sc = 0; }
+ QString name = QString::number(i+1)+": "+m_listUserTags[i].text;
+ KileAction::Tag *menuItem = new KileAction::Tag(name, sc, this, SLOT(insertTag(const KileAction::TagData &)), actionCollection(), QString("tag_user_" + m_listUserTags[i].text).ascii(), m_listUserTags[i]);
+ m_listUserTagsActions.append(menuItem);
+ m_menuUserTags->insert(menuItem);
+ }
+
+ actionCollection()->readShortcutSettings("Shortcuts", m_config);
+}
+
+void Kile::restoreFilesAndProjects(bool allowRestore)
+{
+ if (! (allowRestore && KileConfig::restore()) )
+ return;
+
+ QFileInfo fi;
+
+ KURL url;
+ for (uint i=0; i < m_listProjectsOpenOnStart.count(); ++i)
+ {
+ fi.setFile(m_listProjectsOpenOnStart[i]);
+ // don't open project files as they will be opened later in this method
+ if (fi.isReadable()) docManager()->projectOpen(KURL::fromPathOrURL(m_listProjectsOpenOnStart[i]), i, m_listProjectsOpenOnStart.count(), false);
+ }
+
+ for (uint i=0; i < m_listDocsOpenOnStart.count(); ++i)
+ {
+ fi.setFile(m_listDocsOpenOnStart[i]);
+ if (fi.isReadable())
+ docManager()->fileOpen(KURL::fromPathOrURL(m_listDocsOpenOnStart[i]));
+ }
+
+ if (ModeAction) ModeAction->setChecked(!m_singlemode);
+ updateModeStatus();
+
+ m_listProjectsOpenOnStart.clear();
+ m_listDocsOpenOnStart.clear();
+
+ KILE_DEBUG() << "lastDocument=" << KileConfig::lastDocument() << endl;
+ Kate::Document *doc = docManager()->docFor(KURL::fromPathOrURL(KileConfig::lastDocument()));
+ if (doc) viewManager()->switchToTextView(doc->url(), true); // request the focus on the view
+}
+
+void Kile::setActive()
+{
+ KILE_DEBUG() << "ACTIVATING" << endl;
+ kapp->mainWidget()->raise();
+ kapp->mainWidget()->setActiveWindow();
+}
+
+void Kile::showTip()
+{
+ KTipDialog::showTip(this, "kile/tips", true);
+}
+
+void Kile::setLine( const QString &line )
+{
+ bool ok;
+ uint l=line.toUInt(&ok,10);
+ Kate::View *view = viewManager()->currentTextView();
+ if (view && ok)
+ {
+ this->show();
+ this->raise();
+ view->setFocus();
+ view->gotoLineNumber(l-1);
+
+ showEditorWidget();
+ newStatus();
+ }
+}
+
+void Kile::setCursor(const KURL &url, int parag, int index)
+{
+ Kate::Document *doc = docManager()->docFor(url);
+ if (doc)
+ {
+ Kate::View *view = (Kate::View*)doc->views().first();
+ if (view)
+ {
+ view->setCursorPositionReal(parag, index);
+ view->setFocus();
+ }
+ }
+}
+
+void Kile::runArchiveTool()
+{
+ this->run("Archive");
+}
+
+void Kile::runArchiveTool(const KURL &url)
+{
+ KileTool::Archive *tool = new KileTool::Archive("Archive", m_manager, false);
+ tool->setSource(url.path());
+ tool->prepareToRun();
+ m_manager->run(tool);
+}
+
+
+int Kile::run(const QString & tool)
+{
+ return m_manager->runBlocking(tool);
+}
+
+int Kile::runWith(const QString &tool, const QString &config)
+{
+ return m_manager->runBlocking(tool, config);
+}
+
+//TODO: move to KileView::Manager
+void Kile::activateView(QWidget* w, bool updateStruct /* = true */ ) //Needs to be QWidget because of QTabWidget::currentChanged
+{
+ //KILE_DEBUG() << "==Kile::activateView==========================" << endl;
+ if (!w->inherits("Kate::View"))
+ return;
+
+ //disable gui updates to avoid flickering of toolbars
+ setUpdatesEnabled(false);
+ Kate::View* view = (Kate::View*)w;
+ if (view->isActive()) return;
+
+ for (uint i=0; i< viewManager()->textViews().count(); ++i)
+ {
+ guiFactory()->removeClient(viewManager()->textView(i));
+ viewManager()->textView(i)->setActive(false);
+ }
+
+ guiFactory()->addClient(view);
+ view->setActive( true );
+
+ // remove menu entry to config Kate
+ checkKateSettings();
+
+ setUpdatesEnabled(true);
+
+ if (updateStruct) viewManager()->updateStructure();
+}
+
+void Kile::updateModeStatus()
+{
+ KILE_DEBUG() << "==Kile::updateModeStatus()==========" << endl;
+ KileProject *project = docManager()->activeProject();
+ QString shortName = m_masterName;
+ int pos = shortName.findRev('/');
+ shortName.remove(0,pos+1);
+
+ if (project)
+ {
+ if (m_singlemode)
+ statusBar()->changeItem(i18n("Project: %1").arg(project->name()), ID_HINTTEXT);
+ else
+ statusBar()->changeItem(i18n("Project: %1 (Master document: %2)").arg(project->name()).arg(shortName), ID_HINTTEXT);
+ }
+ else
+ {
+ if (m_singlemode)
+ statusBar()->changeItem(i18n("Normal mode"), ID_HINTTEXT);
+ else
+ statusBar()->changeItem(i18n("Master document: %1").arg(shortName), ID_HINTTEXT);
+ }
+
+ if (m_singlemode)
+ {
+ ModeAction->setText(i18n("Define Current Document as 'Master Document'"));
+ ModeAction->setChecked(false);
+ }
+ else
+ {
+ ModeAction->setText(i18n("Normal mode (current master document: %1)").arg(shortName));
+ ModeAction->setChecked(true);
+ }
+
+ // enable or disable entries in Kile'S menu
+ updateMenu();
+}
+
+void Kile::openDocument(const QString & url)
+{
+ KILE_DEBUG() << "==Kile::openDocument(" << url << ")==========" << endl;
+ docManager()->fileSelected(KURL::fromPathOrURL(url));
+}
+
+void Kile::closeDocument()
+{
+ docManager()->fileClose();
+}
+
+void Kile::autoSaveAll()
+{
+ docManager()->fileSaveAll(true);
+}
+
+void Kile::enableAutosave(bool as)
+{
+ if (as)
+ {
+ //paranoia pays, we're really screwed if somehow autosaveinterval equals zero
+ int interval = KileConfig::autosaveInterval();
+ if ( interval < 1 || interval > 99 ) interval = 10;
+ m_AutosaveTimer->start(interval * 60000);
+ }
+ else m_AutosaveTimer->stop();
+}
+
+void Kile::openProject(const QString& proj)
+{
+ docManager()->projectOpen(KURL::fromPathOrURL(proj));
+}
+
+void Kile::focusPreview()
+{
+ m_bottomBar->showPage(m_previewView);
+}
+
+void Kile::focusLog()
+{
+ m_bottomBar->showPage(m_logWidget);
+}
+
+void Kile::focusOutput()
+{
+ m_bottomBar->showPage(m_outputWidget);
+}
+
+void Kile::focusKonsole()
+{
+ m_bottomBar->showPage(m_texKonsole);
+}
+
+void Kile::focusEditor()
+{
+ Kate::View *view = viewManager()->currentTextView();
+ if (view) view->setFocus();
+}
+
+void Kile::sideOrBottomBarChanged(bool visible)
+{
+ if ( ! visible )
+ {
+ focusEditor();
+ }
+}
+
+bool Kile::queryExit()
+{
+ saveSettings();
+ return true;
+}
+
+bool Kile::queryClose()
+{
+ Kate::View *view = viewManager()->currentTextView();
+ if (view) KileConfig::setLastDocument(view->getDoc()->url().path());
+ else KileConfig::setLastDocument("");
+
+ //don't close Kile if embedded viewers are present
+ KILE_DEBUG() << "==bool Kile::queryClose(" << m_currentState << ")==========" << endl;
+ if ( m_currentState != "Editor" )
+ {
+ resetPart();
+ return false;
+ }
+
+ m_listProjectsOpenOnStart.clear();
+ m_listDocsOpenOnStart.clear();
+
+ for (uint i=0; i < viewManager()->textViews().count(); ++i)
+ {
+ m_listDocsOpenOnStart.append(viewManager()->textView(i)->getDoc()->url().path());
+ }
+
+ KILE_DEBUG() << "#projects = " << docManager()->projects()->count() << endl;
+ for (uint i=0; i < docManager()->projects()->count(); ++i)
+ {
+ m_listProjectsOpenOnStart.append(docManager()->projects()->at(i)->url().path());
+ }
+
+ bool stage1 = docManager()->projectCloseAll();
+ bool stage2 = true;
+
+ if (stage1)
+ {
+ stage2 = docManager()->fileCloseAll();
+ }
+
+ return stage1 && stage2;
+}
+
+void Kile::showDocInfo(Kate::Document *doc)
+{
+ if (doc == 0L)
+ {
+ Kate::View *view = viewManager()->currentTextView();
+
+ if (view)
+ doc = view->getDoc();
+ else
+ return;
+ }
+
+ KileDocument::TextInfo *docinfo = docManager()->textInfoFor(doc);
+ KileProject *project = KileInfo::docManager()->activeProject();
+ if (docinfo) // we have to ensure that we always get a _valid_ docinfo object
+ {
+ KileStatsDlg *dlg = new KileStatsDlg( project,docinfo, this, 0, "");
+ dlg->exec();
+ delete dlg;
+ }
+ else
+ kdWarning() << "There is no KileDocument::Info object belonging to this document!" << endl;
+}
+
+void Kile::convertToASCII(Kate::Document *doc)
+{
+ if (doc == 0)
+ {
+ Kate::View *view = viewManager()->currentTextView();
+
+ if (view) doc = view->getDoc();
+ else return;
+ }
+
+ ConvertIO io(doc);
+ ConvertEncToASCII conv = ConvertEncToASCII(doc->encoding(), &io);
+ doc->setEncoding("ISO 8859-1");
+ conv.convert();
+}
+
+void Kile::convertToEnc(Kate::Document *doc)
+{
+ if (doc == 0)
+ {
+ Kate::View *view = viewManager()->currentTextView();
+
+ if (view) doc = view->getDoc();
+ else return;
+ }
+
+ if (sender())
+ {
+ ConvertIO io(doc);
+ QString name = QString(sender()->name()).section('_', -1);
+ ConvertASCIIToEnc conv = ConvertASCIIToEnc(name, &io);
+ conv.convert();
+ doc->setEncoding(ConvertMap::encodingNameFor(name));
+ }
+}
+
+////////////////// GENERAL SLOTS //////////////
+void Kile::newStatus(const QString & msg)
+{
+ statusBar()->changeItem(msg,ID_LINE_COLUMN);
+}
+
+int Kile::lineNumber()
+{
+ Kate::View *view = viewManager()->currentTextView();
+
+ int para = 0;
+
+ if (view)
+ {
+ para = view->cursorLine();
+ }
+
+ return para;
+}
+
+void Kile::newCaption()
+{
+ Kate::View *view = viewManager()->currentTextView();
+ if (view)
+ {
+ setCaption( getShortName( view->getDoc() ) );
+ if (m_bottomBar->currentPage()->inherits("KileWidget::Konsole"))
+ m_texKonsole->sync();
+ }
+ else
+ setCaption("");
+}
+
+void Kile::grepItemSelected(const QString &abs_filename, int line)
+{
+ KILE_DEBUG() << "Open file: "
+ << abs_filename << " (" << line << ")" << endl;
+ docManager()->fileOpen(KURL::fromPathOrURL(abs_filename));
+ setLine(QString::number(line));
+}
+
+void Kile::findInFiles()
+{
+ static QGuardedPtr<KileGrepDialog> dlg = 0;
+
+ if ( ! dlg )
+ {
+ KILE_DEBUG() << "grep guard: create findInFiles dlg" << endl;
+ dlg = new KileGrepDialog(0L,this,KileGrep::Directory);
+ dlg->show();
+ connect(dlg, SIGNAL(itemSelected(const QString &, int)),
+ this, SLOT(grepItemSelected(const QString &, int)));
+ }
+ else
+ {
+ KILE_DEBUG() << "grep guard: show findInFiles dlg" << endl;
+ dlg->setActiveWindow();
+ dlg->raise();
+ }
+}
+
+void Kile::findInProjects()
+{
+ static QGuardedPtr<KileGrepDialog> project_dlg = 0;
+
+ if ( ! project_dlg )
+ {
+ KILE_DEBUG() << "grep guard: create findInProjects dlg" << endl;
+ project_dlg = new KileGrepDialog(0L,this,KileGrep::Project);
+ project_dlg->show();
+ connect(project_dlg, SIGNAL(itemSelected(const QString &, int)),
+ this, SLOT(grepItemSelected(const QString &, int)));
+ }
+ else
+ {
+ KILE_DEBUG() << "grep guard: show findInProjects dlg" << endl;
+ project_dlg->setActiveWindow();
+ project_dlg->raise();
+ }
+}
+
+/////////////////// PART & EDITOR WIDGET //////////
+void Kile::showEditorWidget()
+{
+ if(!resetPart())
+ return;
+ setCentralWidget(m_topWidgetStack);
+ m_topWidgetStack->show();
+ m_horizontalSplitter->show();
+ m_verticalSplitter->show();
+
+ Kate::View *view = viewManager()->currentTextView();
+ if (view) view->setFocus();
+
+ setupStatusBar();
+ updateModeStatus();
+ newCaption();
+}
+
+
+bool Kile::resetPart()
+{
+ KILE_DEBUG() << "==Kile::resetPart()=============================" << endl;
+ KILE_DEBUG() << "\tcurrent state " << m_currentState << endl;
+ KILE_DEBUG() << "\twant state " << m_wantState << endl;
+
+ KParts::ReadOnlyPart *part = (KParts::ReadOnlyPart*)m_partManager->activePart();
+
+ if (part && m_currentState != "Editor")
+ {
+ if(part->closeURL())
+ {
+ m_partManager->removePart(part);
+ m_topWidgetStack->removeWidget(part->widget());
+ delete part;
+ }
+ else
+ return false;
+ }
+
+ setupStatusBar();
+ updateModeStatus();
+ newCaption();
+
+ m_currentState = "Editor";
+ m_wantState = "Editor";
+ m_partManager->setActivePart( 0L);
+ return true;
+}
+
+void Kile::activePartGUI(KParts::Part * part)
+{
+ KILE_DEBUG() << "==Kile::activePartGUI()=============================" << endl;
+ KILE_DEBUG() << "\tcurrent state " << m_currentState << endl;
+ KILE_DEBUG() << "\twant state " << m_wantState << endl;
+
+ createGUI(part);
+ unplugActionList("list_quickies"); plugActionList("list_quickies", m_listQuickActions);
+ unplugActionList("list_compilers"); plugActionList("list_compilers", m_listCompilerActions);
+ unplugActionList("list_converters"); plugActionList("list_converters", m_listConverterActions);
+ unplugActionList("list_viewers"); plugActionList("list_viewers", m_listViewerActions);
+ unplugActionList("list_other"); plugActionList("list_other", m_listOtherActions);
+
+ showToolBars(m_wantState);
+
+ //manually plug the print action into the toolbar for
+ //kghostview (which has the print action defined in
+ //a KParts::BrowserExtension)
+ KParts::BrowserExtension *ext = KParts::BrowserExtension::childObject(part);
+ if (ext && ext->metaObject()->slotNames().contains( "print()" ) ) //part is a BrowserExtension, connect printAction()
+ {
+ connect(m_paPrint, SIGNAL(activated()), ext, SLOT(print()));
+ m_paPrint->plug(toolBar("mainToolBar"),3); //plug this action into its default location
+ m_paPrint->setEnabled(true);
+ }
+ else
+ {
+ if (m_paPrint->isPlugged(toolBar("mainToolBar")))
+ m_paPrint->unplug(toolBar("mainToolBar"));
+
+ m_paPrint->setEnabled(false);
+ }
+
+ //set the current state
+ m_currentState = m_wantState;
+ m_wantState = "Editor";
+}
+
+void Kile::showToolBars(const QString & wantState)
+{
+ // save state of all toolbars
+ static bool mainToolBar = true;
+ static bool buildToolBar = true;
+ static bool errorToolBar = true;
+ static bool toolsToolBar = true;
+ static bool editToolBar = true;
+ static bool mathToolBar = true;
+
+ if ( m_currentState == "Editor" )
+ {
+ mainToolBar = toolBar("mainToolBar")->isShown();
+ buildToolBar = toolBar("buildToolBar")->isShown();
+ errorToolBar = toolBar("errorToolBar")->isShown();
+ toolsToolBar = toolBar("toolsToolBar")->isShown();
+ editToolBar = toolBar("editToolBar")->isShown();
+ mathToolBar = toolBar("mathToolBar")->isShown();
+ }
+
+ if ( wantState == "HTMLpreview" )
+ {
+ stateChanged( "HTMLpreview");
+ setViewerToolBars();
+ enableKileGUI(false);
+ }
+ else if ( wantState == "Viewer" )
+ {
+ stateChanged( "Viewer" );
+ setViewerToolBars();
+ enableKileGUI(false);
+ }
+ else
+ {
+ stateChanged( "Editor" );
+ m_wantState="Editor";
+ m_topWidgetStack->raiseWidget(0);
+ if ( ! mainToolBar ) toolBar("mainToolBar")->hide();
+ if ( buildToolBar ) toolBar("buildToolBar")->show();
+ if ( errorToolBar ) toolBar("errorToolBar")->show();
+ if ( toolsToolBar ) toolBar("toolsToolBar")->show();
+ if ( editToolBar ) toolBar("editToolBar")->show();
+ if ( mathToolBar ) toolBar("mathToolBar")->show();
+ toolBar("extraToolBar")->hide();
+ enableKileGUI(true);
+ }
+}
+
+void Kile::setViewerToolBars()
+{
+ toolBar("mainToolBar")->show();
+ toolBar("buildToolBar")->hide();
+ toolBar("errorToolBar")->hide();
+ toolBar("toolsToolBar")->hide();
+ toolBar("editToolBar")->hide();
+ toolBar("mathToolBar")->hide();
+ toolBar("extraToolBar")->show();
+}
+
+void Kile::enableKileGUI(bool enable)
+{
+ int id;
+ QString text;
+
+ QMenuBar *menubar = menuBar();
+ for (uint i=0; i<menubar->count(); ++i) {
+ id = menubar->idAt(i);
+ QPopupMenu *popup = menubar->findItem(id)->popup();
+ if ( popup ) {
+ text = popup->name();
+ if ( text == "menu_build" ||
+ text == "menu_project" ||
+ text == "menu_latex" ||
+ text == "wizard" ||
+ text == "tools"
+ )
+ menubar->setItemEnabled(id, enable);
+ }
+ }
+
+ // enable or disable userhelp entries
+ m_help->enableUserhelpEntries(enable);
+}
+
+// adds action names to their lists
+
+void Kile::initMenu()
+{
+ QStringList projectlist,filelist,actionlist;
+
+ projectlist
+ << "project_add" << "project_remove"
+ << "project_showfiles"
+ << "project_buildtree" << "project_options" << "project_findfiles"
+ << "project_archive" << "project_close" << "project_openallfiles"
+ ;
+
+ filelist
+ // file
+ << "convert"
+ // edit
+ << "goto" << "complete" << "bullet" << "select"
+ << "delete" << "environment" << "texgroup"
+ // build
+ << "quickpreview" << "menu_compile" << "menu_convert"
+ << "menu_viewers" << "menu_other"
+ // latex
+ << "menu_preamble" << "menu_lists" << "menu_sectioning" << "references"
+ << "menu_environment" << "menu_listenv" << "menu_tabularenv" << "menu_floatenv"
+ << "menu_code" << "menu_math" << "menu_mathenv" << "menu_mathamsenv"
+ << "menu_bibliography" << "menu_fontstyles" << "menu_spacing"
+ ;
+
+ actionlist
+ // file
+ << "file_save_copy_as" << "file_save_all" << "template_create" << "Statistics"
+ << "file_close" << "file_close_all" << "file_close_all_others"
+ // edit
+ << "RefreshStructure"
+ // view
+ << "gotoPrevDocument" << "gotoNextDocument"
+ // build
+ << "quickpreview_selection" << "quickpreview_environment"
+ << "quickpreview_subdocument" << "quickpreview_math"
+ << "WatchFile" << "ViewLog" << "PreviousError" << "NextError" << "PreviousWarning"
+ << "NextWarning" << "PreviousBadBox" << "NextBadBox" << "CleanAll"
+ // latex
+ << "tag_documentclass" << "tag_usepackage" << "tag_amspackages" << "tag_env_document"
+ << "tag_author" << "tag_title" << "tag_maketitle" << "tag_titlepage" << "tag_env_abstract"
+ << "tag_tableofcontents" << "tag_listoffigures" << "tag_listoftables"
+ << "tag_makeindex" << "tag_printindex" << "tag_makeglossary" << "tag_env_thebibliography"
+ << "tag_part" << "tag_chapter" << "tag_section" << "tag_subsection" << "tag_subsubsection"
+ << "tag_paragraph" << "tag_subparagraph" << "tag_label"
+ << "tag_ref" << "tag_pageref" << "tag_index" << "tag_footnote" << "tag_cite" << "citeViewBib"
+ << "tag_center" << "tag_flushleft" << "tag_flushright"
+ << "tag_env_minipage" << "tag_quote" << "tag_quotation" << "tag_verse"
+ << "tag_env_itemize" << "tag_env_enumerate" << "tag_env_description" << "tag_item"
+ << "tag_env_tabular" << "tag_env_tabular*" << "tag_env_tabbing"
+ << "tag_multicolumn" << "tag_hline" << "tag_vline" << "tag_cline"
+ << "tag_figure" << "tag_table"
+ << "tag_verbatim" << "tag_env_verbatim*" << "tag_verb" << "tag_verb*"
+ << "tag_mathmode" << "tag_equation" << "tag_subscript" << "tag_superscript"
+ << "tag_sqrt" << "tag_nroot" << "tag_left" << "tag_right" << "tag_leftright"
+ << "tag_bigl" << "tag_bigr" << "tag_Bigl" << "tag_Bigr"
+ << "tag_biggl" << "tag_biggr" << "tag_Biggl" << "tag_Biggr"
+ << "tag_text" << "tag_intertext" << "tag_boxed"
+ << "tag_frac" << "tag_dfrac" << "tag_tfrac"
+ << "tag_binom" << "tag_dbinom" << "tag_tbinom"
+ << "tag_xleftarrow" << "tag_xrightarrow"
+ << "tag_mathrm" << "tag_mathit" << "tag_mathbf" << "tag_mathsf"
+ << "tag_mathtt" << "tag_mathcal" << "tag_mathbb" << "tag_mathfrak"
+ << "tag_acute" << "tag_grave" << "tag_tilde" << "tag_bar" << "tag_vec"
+ << "tag_hat" << "tag_check" << "tag_breve" << "tag_dot" << "tag_ddot"
+ << "tag_space_small" << "tag_space_medium" << "tag_space_large"
+ << "tag_quad" << "tag_qquad" << "tag_enskip"
+ << "tag_env_displaymath" << "tag_env_equation" << "tag_env_equation*"
+ << "tag_env_array"
+ << "tag_env_multline" << "tag_env_multline*" << "tag_env_split"
+ << "tag_env_gather" << "tag_env_gather*" << "tag_env_align" << "tag_env_align*"
+ << "tag_env_flalign" << "tag_env_flalign*" << "tag_env_alignat" << "tag_env_alignat*"
+ << "tag_env_aligned" << "tag_env_gathered" << "tag_env_alignedat" << "tag_env_cases"
+ << "tag_bibliographystyle" << "tag_bibliography" << "tag_bib_article" << "tag_bib_inproc"
+ << "tag_bib_incol" << "tag_bib_inbook" << "tag_bib_proceedings" << "tag_bib_book"
+ << "tag_bib_booklet" << "tag_bib_phdthesis" << "tag_bib_masterthesis" << "tag_bib_techreport"
+ << "tag_bib_manual" << "tag_bib_unpublished" << "tag_bib_misc" << "CleanBib"
+ << "tag_textit" << "tag_textsl" << "tag_textbf" << "tag_underline"
+ << "tag_texttt" << "tag_textsc" << "tag_emph" << "tag_strong"
+ << "tag_rmfamily" << "tag_sffamily" << "tag_ttfamily"
+ << "tag_mdseries" << "tag_bfseries" << "tag_upshape"
+ << "tag_itshape" << "tag_slshape" << "tag_scshape"
+ << "tag_newline" << "tag_newpage" << "tag_linebreak" << "tag_pagebreak"
+ << "tag_bigskip" << "tag_medskip" << "tag_smallskip"
+ << "tag_hspace" << "tag_hspace*" << "tag_vspace" << "tag_vspace*"
+ << "tag_hfill" << "tag_hrulefill" << "tag_dotfill" << "tag_vfill"
+ << "tag_includegraphics" << "tag_include" << "tag_input"
+ << "menuUserTags"
+ // wizard
+ << "wizard_tabular" << "wizard_array" << "wizard_tabbing"
+ << "wizard_float" << "wizard_mathenv"
+ // settings
+ << "Mode" << "settings_keys"
+ // help
+ << "help_context"
+ // action lists
+ << "structure_list" << "size_list" << "other_list"
+ << "left_list" << "right_list"
+ ;
+
+ setMenuItems(projectlist,m_dictMenuProject);
+ setMenuItems(filelist,m_dictMenuFile);
+ setMenuItems(actionlist,m_dictMenuAction);
+}
+
+void Kile::setMenuItems(QStringList &list, QMap<QString,bool> &dict)
+{
+ for ( QStringList::Iterator it=list.begin(); it!=list.end(); ++it ) {
+ dict[(*it)] = true;
+ }
+}
+
+void Kile::updateMenu()
+{
+ KILE_DEBUG() << "==Kile::updateKileMenu()====================" << endl;
+ KAction *a;
+ QMap<QString,bool>::Iterator it;
+
+ // update project menus
+ m_actRecentProjects->setEnabled( m_actRecentProjects->items().count() > 0 );
+ bool project_open = ( docManager()->isProjectOpen() ) ;
+
+ for ( it=m_dictMenuProject.begin(); it!=m_dictMenuProject.end(); ++it ) {
+ a = actionCollection()->action(it.key().ascii());
+ if ( a )
+ a->setEnabled(project_open);
+ }
+
+ // project_show is only enabled, when more than 1 project is opened
+ a = actionCollection()->action("project_show");
+ if ( a )
+ a->setEnabled( project_open && docManager()->projects()->count()>1 );
+
+ // update file menus
+ m_actRecentFiles->setEnabled( m_actRecentFiles->items().count() > 0 );
+ bool file_open = ( viewManager()->currentTextView() );
+ KILE_DEBUG() << "\tprojectopen=" << project_open << " fileopen=" << file_open << endl;
+
+ QMenuBar *menubar = menuBar();
+ for ( uint i=0; i<menubar->count(); ++i ) {
+ int menu_id = menubar->idAt(i);
+ QPopupMenu *menu = menubar->findItem(menu_id)->popup();
+ if ( menu ) {
+ QString menu_name = menu->name();
+ for ( uint j=0; j<menu->count(); ++j ) {
+ int sub_id = menu->idAt(j);
+ QPopupMenu *submenu = menu->findItem(sub_id)->popup();
+ if ( submenu ) {
+ QString submenu_name = submenu->name();
+ if ( m_dictMenuFile.contains(submenu_name) ) {
+// if ( m_menuFileList.findIndex( submenu_name ) >= 0 ) {
+ menu->setItemEnabled(sub_id, file_open);
+ }
+ }
+ }
+ }
+ }
+
+ // update action lists
+ KActionPtrList actions = actionCollection()->actions();
+ KActionPtrList::Iterator itact;
+ for ( itact=actions.begin(); itact!=actions.end(); ++itact )
+ {
+ if ( m_dictMenuAction.contains( (*itact)->name() ) )
+ (*itact)->setEnabled(file_open);
+ }
+
+ updateActionList(&m_listQuickActions,file_open);
+ updateActionList(&m_listCompilerActions,file_open);
+ updateActionList(&m_listConverterActions,file_open);
+ updateActionList(&m_listViewerActions,file_open);
+ updateActionList(&m_listOtherActions,file_open);
+
+}
+
+void Kile::updateActionList(QPtrList<KAction> *list, bool state)
+{
+ for ( KAction *a=list->first(); a; a=list->next() ) {
+ a->setEnabled(state);
+ }
+}
+
+//TODO: move to KileView::Manager
+void Kile::prepareForPart(const QString & state)
+{
+ KILE_DEBUG() << "==Kile::prepareForPart====================" << endl;
+
+ if ( m_currentState == "Editor" && state == "Editor" ) return;
+
+ resetPart();
+ m_wantState = state;
+
+ //deactivate kateparts
+ for (uint i=0; i<viewManager()->textViews().count(); ++i)
+ {
+ guiFactory()->removeClient(viewManager()->textView(i));
+ viewManager()->textView(i)->setActive(false);
+ }
+}
+
+void Kile::runTool()
+{
+ focusLog();
+ QString name = sender()->name();
+ name.replace(QRegExp("^.*tool_"), "");
+ m_manager->run(name);
+}
+
+void Kile::cleanAll(KileDocument::TextInfo *docinfo)
+{
+ static QString noactivedoc = i18n("There is no active document or it is not saved.");
+ if (docinfo == 0)
+ {
+ Kate::Document *doc = activeTextDocument();
+ if (doc)
+ docinfo = docManager()->textInfoFor(doc);
+ else
+ {
+ m_logWidget->printMsg(KileTool::Error, noactivedoc, i18n("Clean"));
+ return;
+ }
+ }
+
+ if (docinfo)
+ docManager()->cleanUpTempFiles(docinfo->url(), false);
+}
+
+void Kile::refreshStructure()
+{
+ viewManager()->updateStructure(true);
+}
+
+void Kile::insertTag(const KileAction::TagData& data)
+{
+ logWidget()->clear();
+
+ if ( data.description.length() > 0 )
+ {
+ outputView()->showPage(logWidget());
+ setLogPresent(false);
+ logWidget()->append(data.description);
+ }
+
+ Kate::View *view = viewManager()->currentTextView();
+
+ if ( !view ) return;
+
+ view->setFocus();
+
+ editorExtension()->insertTag(data, view);
+}
+
+void Kile::insertTag(const QString& tagB, const QString& tagE, int dx, int dy)
+{
+ insertTag(KileAction::TagData(QString::null,tagB,tagE,dx,dy));
+}
+
+void Kile::insertAmsTag(const KileAction::TagData& data)
+{
+ insertTag(data, QStringList("amsmath"));
+}
+
+void Kile::insertTag(const KileAction::TagData& data,const QStringList &pkgs)
+{
+ KILE_DEBUG() << "void Kile::insertTag(const KileAction::TagData& data,const QStringList " << pkgs.join(",") << ")" << endl;
+ insertTag(data);
+
+ KileDocument::Info *docinfo = docManager()->textInfoFor(getCompileName());
+ if ( docinfo )
+ {
+ const QStringList *packagelist = allPackages(docinfo);
+ QStringList::const_iterator it;
+ QStringList warnPkgs;
+
+ for ( it = pkgs.begin() ; it != pkgs.end() ; it++ )
+ if( !(*packagelist).contains(*it) )
+ warnPkgs.append(*it);
+
+ if( warnPkgs.count() > 0 )
+ {
+ if( warnPkgs.count() == 1 )
+ m_logWidget->printMsg(KileTool::Error, i18n("You have to include the package %1.").arg(warnPkgs.join(",")),
+ i18n("Insert text"));
+ else
+ m_logWidget->printMsg(KileTool::Error, i18n("You have to include the packages %1.").arg(warnPkgs.join(",")),
+ i18n("Insert text"));
+ }
+ }
+}
+
+void Kile::insertText(const QString &text)
+{
+ insertTag( KileAction::TagData(QString::null,text,"%C",0,0) );
+}
+
+void Kile::insertText(const QString &text, const QStringList &pkgs)
+{
+ insertTag( KileAction::TagData(QString::null,text,"%C",0,0),pkgs );
+}
+
+void Kile::quickDocument()
+{
+ KileDialog::QuickDocument *dlg = new KileDialog::QuickDocument(m_config, this,"Quick Start",i18n("Quick Start"));
+
+ if ( dlg->exec() )
+ {
+ if (!viewManager()->currentTextView())
+ {
+ docManager()->createNewLaTeXDocument();
+ }
+ insertTag( dlg->tagData() );
+ viewManager()->updateStructure(true);
+ }
+ delete dlg;
+}
+
+void Kile::quickArray()
+{
+ quickTabulardialog(false);
+}
+
+void Kile::quickTabular()
+{
+ quickTabulardialog(true);
+}
+
+void Kile::quickTabulardialog(bool tabularenv)
+{
+ if ( !viewManager()->currentTextView() ) return;
+
+ KileDialog::TabularDialog *dlg = new KileDialog::TabularDialog(this,m_config,m_latexCommands,tabularenv);
+ if ( dlg->exec() ) {
+ insertTag(dlg->tagData());
+ }
+ delete dlg;
+}
+
+void Kile::quickTabbing()
+{
+ if ( !viewManager()->currentTextView() ) return;
+ KileDialog::QuickTabbing *dlg = new KileDialog::QuickTabbing(m_config,this,this,"Tabbing", i18n("Tabbing"));
+ if ( dlg->exec() )
+ {
+ insertTag(dlg->tagData());
+ }
+ delete dlg;
+}
+
+void Kile::quickFloat()
+{
+ if ( !viewManager()->currentTextView() ) return;
+
+ KileDialog::FloatEnvironmentDialog *dlg = new KileDialog::FloatEnvironmentDialog(m_config,this,this);
+ if ( dlg->exec() ) {
+ insertTag(dlg->tagData());
+ }
+ delete dlg;
+}
+
+void Kile::quickMathenv()
+{
+ if ( !viewManager()->currentTextView() ) return;
+
+ KileDialog::MathEnvironmentDialog *dlg = new KileDialog::MathEnvironmentDialog(this,m_config,this,m_latexCommands);
+ if ( dlg->exec() ) {
+ insertTag(dlg->tagData());
+ }
+ delete dlg;
+}
+
+void Kile::quickPostscript()
+{
+ QString startdir = QDir::homeDirPath();
+ QString texfilename = QString::null;
+
+ Kate::View *view = viewManager()->currentTextView();
+ if ( view ) {
+ startdir = QFileInfo(view->getDoc()->url().path()).dirPath();
+ texfilename = getCompileName();
+ }
+
+ KileDialog::PostscriptDialog *dlg = new KileDialog::PostscriptDialog(this,texfilename,startdir,m_extensions->latexDocuments(),m_logWidget,m_outputWidget);
+ dlg->exec();
+ delete dlg;
+}
+
+void Kile::helpLaTex()
+{
+ QString loc = locate("html","en/kile/latexhelp.html");
+ KileTool::ViewHTML *tool = new KileTool::ViewHTML("ViewHTML", m_manager, false);
+ tool->setFlags(KileTool::NeedSourceExists | KileTool::NeedSourceRead);
+ tool->setSource(loc);
+ tool->setTargetPath(loc);
+ tool->prepareToRun();
+ m_manager->run(tool);
+}
+
+void Kile::editUserMenu()
+{
+ KileDialog::UserTags *dlg = new KileDialog::UserTags(m_listUserTags, this, "Edit User Tags", i18n("Edit User Tags"));
+
+ if ( dlg->exec() )
+ {
+ //remove all actions
+ uint len = m_listUserTagsActions.count();
+ for (uint j=0; j< len; ++j)
+ {
+ KAction *menuItem = m_listUserTagsActions.getLast();
+ m_menuUserTags->remove(menuItem);
+ m_listUserTagsActions.removeLast();
+ delete menuItem;
+ }
+ if ( len > 0 )
+ m_menuUserTags->remove(m_actionEditSeparator);
+ m_menuUserTags->remove(m_actionEditTag);
+
+ m_listUserTags = dlg->result();
+ setupUserTagActions();
+ }
+
+ delete dlg;
+}
+
+void Kile::readGUISettings()
+{
+ m_horSplitLeft = KileConfig::horizontalSplitterLeft();
+ m_horSplitRight = KileConfig::horizontalSplitterRight();
+ m_verSplitTop = KileConfig::verticalSplitterTop();
+ m_verSplitBottom = KileConfig::verticalSplitterBottom();
+}
+
+void Kile::readUserSettings()
+{
+ //test for old kilerc
+ int version = KileConfig::rCVersion();
+
+ //if the kilerc file is old some of the configuration
+ //data must be set by kile, even if the keys are present
+ //in the kilerc file
+ if ( version < 4 )
+ {
+ KileTool::Factory *factory = new KileTool::Factory(0, m_config);
+ KILE_DEBUG() << "WRITING STD TOOL CONFIG" << endl;
+ factory->writeStdConfig();
+ delete factory;
+ }
+
+ //delete old editor key
+ if (m_config->hasGroup("Editor") )
+ {
+ m_config->deleteGroup("Editor");
+ }
+
+ m_config->setGroup( "User" );
+ int len = m_config->readNumEntry("nUserTags",0);
+ for (int i = 0; i < len; ++i)
+ {
+ m_listUserTags.append(KileDialog::UserTags::splitTag(m_config->readEntry("userTagName"+QString::number(i),i18n("no name")) , m_config->readEntry("userTag"+QString::number(i),"") ));
+ }
+
+ //convert user tools to new KileTool classes
+ userItem tempItem;
+ len= m_config->readNumEntry("nUserTools",0);
+ for (int i=0; i< len; ++i)
+ {
+ tempItem.name=m_config->readEntry("userToolName"+QString::number(i),i18n("no name"));
+ tempItem.tag =m_config->readEntry("userTool"+QString::number(i),"");
+ m_listUserTools.append(tempItem);
+ }
+ if ( len > 0 )
+ {
+ //move the tools
+ m_config->writeEntry("nUserTools", 0);
+ for ( int i = 0; i < len; ++i)
+ {
+ tempItem = m_listUserTools[i];
+ m_config->setGroup("Tools");
+ m_config->writeEntry(tempItem.name, "Default");
+
+ KileTool::setGUIOptions(tempItem.name, "Other", "gear", m_config);
+
+ m_config->setGroup(KileTool::groupFor(tempItem.name, "Default"));
+ QString bin = KRun::binaryName(tempItem.tag, false);
+ m_config->writeEntry("command", bin);
+ m_config->writeEntry("options", tempItem.tag.mid(bin.length()));
+ m_config->writeEntry("class", "Base");
+ m_config->writeEntry("type", "Process");
+ m_config->writeEntry("from", "");
+ m_config->writeEntry("to", "");
+
+ if ( i < 10 )
+ {
+ m_config->setGroup("Shortcuts");
+ m_config->writeEntry("tool_" + tempItem.name, "Alt+Shift+" + QString::number(i + 1) ); //should be alt+shift+
+ }
+ }
+ }
+
+ // check autocompletion modes: if KTextEditor-plugin for document word
+ // completion is active, both autocompletion modes of Kile must be disabled
+ if ( kateCompletionPlugin() )
+ {
+ KileConfig::setCompleteAuto(false);
+ KileConfig::setCompleteAutoText(false);
+ }
+}
+
+void Kile::readRecentFileSettings()
+{
+ m_config->setGroup("FilesOpenOnStart");
+ int n = m_config->readNumEntry("NoDOOS", 0);
+ for (int i=0; i < n; ++i)
+ m_listDocsOpenOnStart.append(m_config->readPathEntry("DocsOpenOnStart"+QString::number(i), ""));
+
+ n = m_config->readNumEntry("NoPOOS", 0);
+ for (int i=0; i < n; ++i)
+ m_listProjectsOpenOnStart.append(m_config->readPathEntry("ProjectsOpenOnStart"+QString::number(i), ""));
+}
+
+void Kile::readConfig()
+{
+ enableAutosave(KileConfig::autosave());
+ m_edit->complete()->readConfig(m_config);
+ //m_edit->initDoubleQuotes();
+ m_edit->readConfig();
+ docManager()->updateInfos();
+ m_jScriptManager->readConfig();
+ m_sideBar->setPageVisible(m_scriptsManagementWidget, KileConfig::scriptingEnabled());
+ m_sideBar->setPageVisible(m_kileAbbrevView, KileConfig::completeShowAbbrev());
+
+ if( KileConfig::displayMFUS() )
+ enableSymbolViewMFUS();
+ else
+ disableSymbolViewMFUS();
+}
+
+void Kile::saveSettings()
+{
+ showEditorWidget();
+
+ m_fileSelector->writeConfig();
+ m_symbolViewMFUS->writeConfig();
+
+ KileConfig::setInputEncoding(m_fileSelector->comboEncoding()->lineEdit()->text());
+
+ // Store recent files
+ m_actRecentFiles->saveEntries(m_config, "Recent Files");
+ m_actRecentProjects->saveEntries(m_config, "Projects");
+
+ m_config->deleteGroup("FilesOpenOnStart");
+ if (KileConfig::restore())
+ {
+ m_config->setGroup("FilesOpenOnStart");
+ m_config->writeEntry("NoDOOS", m_listDocsOpenOnStart.count());
+ for (uint i=0; i < m_listDocsOpenOnStart.count(); ++i)
+ m_config->writePathEntry("DocsOpenOnStart"+QString::number(i), m_listDocsOpenOnStart[i]);
+
+ m_config->writeEntry("NoPOOS", m_listProjectsOpenOnStart.count());
+ for (uint i=0; i < m_listProjectsOpenOnStart.count(); ++i)
+ m_config->writePathEntry("ProjectsOpenOnStart"+QString::number(i), m_listProjectsOpenOnStart[i]);
+
+ if (!m_singlemode)
+ KileConfig::setMaster(m_masterName);
+ else
+ KileConfig::setMaster("");
+ }
+
+ m_config->setGroup( "User" );
+
+ m_config->writeEntry("nUserTags",static_cast<int>(m_listUserTags.size()));
+ for (uint i=0; i < m_listUserTags.size(); ++i)
+ {
+ KileAction::TagData td( m_listUserTags[i]);
+ m_config->writeEntry( "userTagName"+QString::number(i), td.text );
+ m_config->writeEntry( "userTag"+QString::number(i), KileDialog::UserTags::completeTag(td) );
+ }
+
+ actionCollection()->writeShortcutSettings();
+ saveMainWindowSettings(m_config, "KileMainWindow" );
+
+ scriptManager()->writeConfig();
+ m_edit->complete()->saveLocalChanges();
+
+ KileConfig::setRCVersion(KILERC_VERSION);
+ KileConfig::setMainwindowWidth(width());
+ KileConfig::setMainwindowHeight(height());
+
+ QValueList<int> sizes;
+ QValueList<int>::Iterator it;
+ sizes=m_horizontalSplitter->sizes();
+ it = sizes.begin();
+ m_horSplitLeft=*it;
+ ++it;
+ m_horSplitRight=*it;
+ sizes.clear();
+ sizes = m_verticalSplitter->sizes();
+ it = sizes.begin();
+ m_verSplitTop=*it;
+ ++it;
+ m_verSplitBottom=*it;
+
+ // sync vertical splitter and size of bottom bar
+ int sizeBottomBar = m_bottomBar->size();
+ if ( m_bottomBar->isVisible() )
+ sizeBottomBar = m_verSplitBottom;
+ else
+ m_verSplitBottom = sizeBottomBar;
+
+ KileConfig::setHorizontalSplitterLeft(m_horSplitLeft);
+ KileConfig::setHorizontalSplitterRight(m_horSplitRight);
+ KileConfig::setVerticalSplitterTop(m_verSplitTop);
+ KileConfig::setVerticalSplitterBottom(m_verSplitBottom);
+
+ KileConfig::setSideBar(m_sideBar->isVisible());
+ KileConfig::setSideBarSize(m_sideBar->size());
+ KileConfig::setBottomBar(m_bottomBar->isVisible());
+ KileConfig::setBottomBarSize(sizeBottomBar);
+
+ if(m_sideBar->isVisible())
+ KileConfig::setSelectedLeftView(m_sideBar->currentTab());
+ else
+ KileConfig::setSelectedLeftView(-1);
+ KileConfig::writeConfig();
+ m_config->sync();
+}
+
+///////////////// OPTIONS ////////////////////
+void Kile::toggleMode()
+{
+ if (!m_singlemode)
+ {
+ ModeAction->setText(i18n("Define Current Document as 'Master Document'"));
+ ModeAction->setChecked(false);
+ m_logPresent=false;
+ m_singlemode=true;
+ m_masterName=QString::null;
+ }
+ else if (m_singlemode && viewManager()->currentTextView())
+ {
+ m_masterName=getName();
+ if ( KileUntitled::isUntitled(m_masterName) || m_masterName.isEmpty())
+ {
+ ModeAction->setChecked(false);
+ KMessageBox::error(this, i18n("In order to define the current document as a master document, it has to be saved first."));
+ m_masterName="";
+ return;
+ }
+
+ QString shortName = m_masterName;
+ int pos;
+ while ( (pos = (int)shortName.find('/')) != -1 )
+ shortName.remove(0,pos+1);
+
+ ModeAction->setText(i18n("Normal mode (current master document: %1)").arg(shortName));
+ ModeAction->setChecked(true);
+ m_singlemode=false;
+ }
+ else
+ ModeAction->setChecked(false);
+
+ updateModeStatus();
+ KILE_DEBUG() << "SETTING master to " << m_masterName << " singlemode = " << m_singlemode << endl;
+}
+
+void Kile::toggleWatchFile()
+{
+ m_bWatchFile=!m_bWatchFile;
+
+ if (m_bWatchFile)
+ WatchFileAction->setChecked(true);
+ else
+ WatchFileAction->setChecked(false);
+}
+
+// execute configuration dialog
+
+void Kile::generalOptions()
+{
+ m_edit->complete()->saveLocalChanges();
+
+ KileDialog::Config *dlg = new KileDialog::Config(m_config,this,this);
+
+ if (dlg->exec())
+ {
+ // check new Kate settings
+ checkKateSettings();
+
+ // update new settings
+ readConfig();
+ setupTools();
+ m_help->update();
+
+ emit configChanged();
+
+ //stop/restart LyX server if necessary
+ if (KileConfig::runLyxServer() && !m_lyxserver->isRunning())
+ m_lyxserver->start();
+
+ if (!KileConfig::runLyxServer() && m_lyxserver->isRunning())
+ m_lyxserver->stop();
+ }
+
+ delete dlg;
+}
+
+// read kate plugin configuration
+bool Kile::kateCompletionPlugin()
+{
+ m_config->setGroup("Kate Document Defaults");
+ return m_config->readBoolEntry("KTextEditor Plugin ktexteditor_docwordcompletion",false);
+}
+
+void Kile::checkKateSettings()
+{
+ // editor settings were only available with an opened document
+ Kate::View *view = viewManager()->currentTextView();
+ if ( view )
+ {
+ // remove menu entry to config Kate
+ viewManager()->unplugKatePartMenu(view);
+ }
+}
+
+void Kile::slotPerformCheck()
+{
+ if(!m_singlemode)
+ {
+ m_logWidget->printMsg(KileTool::Error, i18n("Please turn off the \'Master Document\' mode before performing the System Check."), i18n("System Check"));
+ return;
+ }
+ KileDialog::ConfigChecker *dlg = new KileDialog::ConfigChecker(this);
+ dlg->exec();
+ delete dlg;
+}
+
+/////////////// KEYS - TOOLBARS CONFIGURATION ////////////////
+void Kile::configureKeys()
+{
+ KKeyDialog dlg( false, this );
+ QPtrList<KXMLGUIClient> clients = guiFactory()->clients();
+ for( QPtrListIterator<KXMLGUIClient> it( clients ); it.current(); ++it )
+ {
+ dlg.insert( (*it)->actionCollection() );
+ }
+ dlg.configure();
+ actionCollection()->writeShortcutSettings("Shortcuts", m_config);
+}
+
+void Kile::configureToolbars()
+{
+ saveMainWindowSettings(m_config, "KileMainWindow" );
+ KEditToolbar dlg(factory());
+ dlg.exec();
+
+ applyMainWindowSettings(m_config, "KileMainWindow" );
+ showToolBars(m_currentState);
+}
+
+void Kile::changeInputEncoding()
+{
+ Kate::Document *doc = activeTextDocument();
+ if ( doc )
+ {
+ KileDocument::TextInfo *textInfo = docManager()->textInfoFor(doc);
+ bool modified = doc->isModified();
+
+ if( !textInfo )
+ return;
+
+ QString encoding = m_fileSelector->comboEncoding()->lineEdit()->text();
+
+ if(!encoding.isNull())
+ doc->setEncoding(encoding);
+ unsigned int mode = doc->hlMode(); //remember the highlighting mode
+
+ //reload the document so that the new encoding takes effect
+ doc->openURL(doc->url());
+ doc->setHlMode(mode);
+ doc->setModified(modified);
+
+ viewManager()->updateStructure(true,textInfo); //reparse doc to get a correct structure view
+ }
+}
+
+//////////////////// CLEAN BIB /////////////////////
+void Kile::cleanBib()
+{
+ Kate::View *view = viewManager()->currentTextView();
+ if ( ! view )
+ return;
+
+ QRegExp reOptional( "(ALT|OPT)(\\w+)\\s*=\\s*(\\S.*)" );
+ QRegExp reNonEmptyEntry( ".*\\w.*" );
+
+ QString s;
+ uint i=0;
+ while(i < view->getDoc()->numLines())
+ {
+ s = view->getDoc()->textLine(i);
+
+ // do we have a line that starts with ALT or OPT?
+ if ( reOptional.search( s ) >= 0 )
+ {
+ // yes! capture type and entry
+ QString type = reOptional.cap( 2 );
+ QString entry = reOptional.cap( 3 );
+ view->getDoc()->removeLine( i );
+ view->getDoc()->setModified(true);
+ if ( reNonEmptyEntry.search( entry ) >= 0 )
+ {
+ type.append( " = " );
+ type.append( entry );
+ view->getDoc()->insertLine( i, type );
+ ++i;
+ }
+ }
+ else
+ ++i;
+ }
+ uint j=0;
+ for ( i=0; i < view->getDoc()->numLines() ; i++ )
+ {
+ j = i+1;
+ if ( j < view->getDoc()->numLines() && view->getDoc()->textLine(j).contains( QRegExp("^\\s*\\}\\s*$") ) )
+ {
+ s = view->getDoc()->textLine( i );
+ view->getDoc()->removeLine( i );
+ s.remove( QRegExp(",\\s*$") );
+ view->getDoc()->setModified( true );
+ view->getDoc()->insertLine( i, s);
+ }
+ }
+}
+
+void Kile::includeGraphics()
+{
+ Kate::View *view = viewManager()->currentTextView();
+ if ( !view ) return;
+
+ QFileInfo fi( view->getDoc()->url().path() );
+ KileDialog::IncludeGraphics *dialog = new KileDialog::IncludeGraphics(this, fi.dirPath(), this);
+
+ if ( dialog->exec() == QDialog::Accepted )
+ {
+ insertTag(dialog->getTemplate(), "%C", 0,0);
+ docManager()->projectAddFile( dialog->getFilename(),true );
+ }
+
+ delete dialog;
+}
+
+void Kile::slotToggleFullScreen()
+{
+ //FIXME for Qt 3.3.x we can do: setWindowState(windowState() ^ WindowFullScreen);
+ if (!m_pFullScreen->isChecked())
+ showNormal();
+ else
+ showFullScreen();
+}
+
+/////////////// QuickPreview (dani) ////////////////
+
+// all calls of QuickPreview will get here, so we can decide what to do
+// rewritten Sep 05 2006 to work together with preview in the bottom bar
+
+void Kile::slotQuickPreview(int type)
+{
+ KILE_DEBUG() << "==Kile::slotQuickPreview()==========================" << endl;
+
+ Kate::View *view = viewManager()->currentTextView();
+ if ( ! view) return;
+
+ Kate::Document *doc = view->getDoc();
+ if ( ! doc )
+ return;
+
+ switch ( type )
+ {
+ case KileTool::qpSelection: m_quickPreview->previewSelection(doc); break;
+ case KileTool::qpEnvironment: m_quickPreview->previewEnvironment(doc); break;
+ case KileTool::qpSubdocument: m_quickPreview->previewSubdocument(doc); break;
+ case KileTool::qpMathgroup: m_quickPreview->previewMathgroup(doc); break;
+ }
+}
+
+void Kile::citeViewBib()
+{
+ KILE_DEBUG() << "===void Kile::citeViewBib()===" << endl;
+
+ DCOPClient *client = kapp->dcopClient();
+ QByteArray params, replyData;
+ QCString replyType;
+
+ QDataStream stream(params, IO_WriteOnly);
+ QCStringList functions,remoteApps,remoteObjs;
+
+ const QCString viewBibApp = "kbib"; // currently these things are hardcoded because only kbib supports it
+ const QCString viewBibObj = "kbibapp";
+ const QCString viewBibFncDef = "QString cite()";
+ const QCString viewBibFnc = "cite()";
+
+ remoteApps = client->registeredApplications();
+ if( !remoteApps.contains(viewBibApp) )
+ {
+ m_logWidget->printMsg(KileTool::Warning,
+ i18n("No ViewBib tool running, trying to start it now"),
+ i18n("ViewBib Citation"));
+ uint ret = runWith("ViewBib","KBib");
+ if( ret == 0 )
+ m_logWidget->printMsg(KileTool::Info,
+ i18n("Please select the desired bibliographies and re-execute this command"),
+ i18n("ViewBib Citation"));
+ return;
+ }
+
+ remoteObjs = client->remoteObjects(viewBibApp);
+ if( !remoteObjs.contains(viewBibObj) )
+ {
+ m_logWidget->printMsg(KileTool::Warning,
+ i18n("The ViewBib tool does not have the correct interface"),
+ i18n("ViewBib Citation"));
+ return;
+ }
+
+ functions = client->remoteFunctions(viewBibApp,viewBibObj);
+ if( !functions.contains(viewBibFncDef) )
+ {
+ m_logWidget->printMsg(KileTool::Warning,
+ i18n("The ViewBib tool does not have the correct definition of the cite function"),
+ i18n("ViewBib Citation"));
+ return;
+ }
+
+ if ( !client->call(viewBibApp, viewBibObj, viewBibFnc, params, replyType, replyData) )
+ {
+ // we should never get here
+ kdWarning() << "internal error in viewbib citation" << endl;
+ return;
+ }
+ else{
+ QDataStream reply(replyData, IO_ReadOnly);
+ if (replyType == "QString")
+ {
+ QString result;
+ reply >> result;
+
+ if (result.isEmpty())
+ {
+ m_logWidget->printMsg(KileTool::Warning,
+ i18n("No reference selected.\nPlease select a reference first!"),
+ i18n("ViewBib Citation"));
+ }
+ else
+ {
+ insertTag(KileAction::TagData(i18n("ViewBib Citation"), result, QString::null, result.length()));
+
+ }
+ }
+ }
+}
+
+#include "kile.moc"
diff --git a/src/kile/kile.desktop b/src/kile/kile.desktop
new file mode 100644
index 0000000..89804fd
--- /dev/null
+++ b/src/kile/kile.desktop
@@ -0,0 +1,82 @@
+# KDE Config File
+[Desktop Entry]
+Type=Application
+Exec=kile
+Icon=kile
+DocPath=kile/index.html
+Comment=(La)TeX development environment
+Comment[be]=Асяроддзе распрацоўкі (La)TeX
+Comment[bg]=Графичен интерфейс на (La)TeX
+Comment[bs]=(La)TeX razvojno okruženje
+Comment[ca]=Entorn de desenvolupament (La)TeX
+Comment[cs]=Vývojové prostředí pro (La)TeX
+Comment[da]=(La)TeX udviklingsmiljø
+Comment[de]=(La)TeX-Entwicklungsumgebung
+Comment[el]=Περιβάλλον ανάπτυξης (La)TeX
+Comment[es]=Entorno de desarrollo de (La)TeX
+Comment[et]=(La)TeXi arenduskeskkond
+Comment[fi]=(La)TeX-kehitysympäristö
+Comment[fr]=Environnement de développement pour (La)TeX
+Comment[ga]=Timpeallacht fhorbartha (La)TeX
+Comment[gl]=O editor de (La)TeX
+Comment[hi]=(ले)टेक्स डेवलपमेंट वातावरण
+Comment[hu]=(La)TeX fejlesztőkörnyezet
+Comment[it]=Ambiente di sviluppo (La)TeX
+Comment[ja]=(La)TeX 開発環境
+Comment[ms]=Persekitaran pembangunan (La)TeX
+Comment[nds]=(La)TeX-Dokmentensmeed
+Comment[nl]=(La)TeX-ontwikkelingsomgeving
+Comment[pa]=(La)TeX ਵਿਕਾਸ ਵਾਤਾਵਰਣ
+Comment[pt]=Ambiente de desenvolvimento de (La)TeX
+Comment[pt_BR]=Ambiente de Desenvolvimento (La)TeX
+Comment[sk]=(La)TeX vývojové prostredie
+Comment[sr]=Развојно окружење за (La)TeX
+Comment[sr@Latn]=Razvojno okruženje za (La)TeX
+Comment[sv]=(La)tex-utvecklingsmiljö
+Comment[ta]=(லா)டெக்ஸ் மேம்பாட்டு சூழல்
+Comment[tr]=(La)TeX geliştirme ortamı
+Comment[uk]=Середовище розробки (La)TeX
+Comment[xx]=xx(La)TeX development environmentxx
+Comment[zh_CN]=(La)TeX 开发环境
+Terminal=false
+Name=Kile
+Name[hi]=काइल
+Name[ta]=கயில்
+Name[xx]=xxKilexx
+GenericName=LaTeX Frontend
+GenericName[be]=Інтэрфейс да LaTeX
+GenericName[bg]=Интерфейс за LaTeX
+GenericName[bs]=LaTeX frontend
+GenericName[ca]=Frontal per a LaTeX
+GenericName[cs]=Prostředí pro LaTeX
+GenericName[da]=Forende for LaTeX
+GenericName[de]=Graphische Oberfläche zu LaTeX
+GenericName[el]=Σύστημα υποστήριξης χρήστη LaTeX
+GenericName[es]=Interfaz para LaTeX
+GenericName[et]=LaTeXi kasutajaliides
+GenericName[fr]=Interface graphique LaTeX
+GenericName[ga]=Comhéadan LaTeX
+GenericName[gl]=Interface para LaTeX
+GenericName[hi]=लेटेक्स फ्रंटएण्ड
+GenericName[hu]=LaTeX-felület
+GenericName[it]=Interfaccia LaTeX
+GenericName[ja]=LaTeX フロントエンド
+GenericName[ms]=Frontend LaTeX
+GenericName[nds]=LaTeX-Böversiet
+GenericName[nl]=LaTeX-tekstverwerking
+GenericName[pa]=LaTeX ਮੁੱਖ
+GenericName[pt]=Interface para o LaTeX
+GenericName[pt_BR]=Interface do LaTeX
+GenericName[ru]=Интерфейс к LaTeX
+GenericName[sk]=LaTeX rozhranie
+GenericName[sr]=Интерфејс за LaTeX
+GenericName[sr@Latn]=Interfejs za LaTeX
+GenericName[sv]=Latex-gränssnitt
+GenericName[ta]=(லா)டெக்ஸ்
+GenericName[tr]=LaTeX Arayüzü
+GenericName[uk]=Інтерфейс до LaTeX
+GenericName[xx]=xxLaTeX Frontendxx
+GenericName[zh_CN]=LaTeX 前端
+MimeType=text/x-tex;text/x-kilepr;
+Categories=Qt;KDE;Office;
+Encoding=UTF-8
diff --git a/src/kile/kile.h b/src/kile/kile.h
new file mode 100644
index 0000000..e186854
--- /dev/null
+++ b/src/kile/kile.h
@@ -0,0 +1,337 @@
+/***************************************************************************
+ begin : sam jui 13 09:50:06 CEST 2002
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : wijnhout@science.uva.nl
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILE_H
+#define KILE_H
+
+#include <kdeversion.h>
+#include <kate/view.h>
+#include <kate/document.h>
+#include <dcopobject.h>
+#include <kparts/mainwindow.h>
+#include <kparts/partmanager.h>
+#include <kparts/part.h>
+
+#include <qsplitter.h>
+#include <qwidget.h>
+#include <qstringlist.h>
+#include <qwidgetstack.h>
+#include <qstring.h>
+#include <qtoolbox.h>
+
+#include "kileappIface.h"
+#include "docpart.h"
+#include "kilefileselect.h"
+#include "kileinfo.h"
+#include "symbolview.h"
+
+#include "latexoutputinfo.h"
+#include "latexoutputfilter.h"
+
+#include "codecompletion.h" // code completion (dani)
+#include "kileedit.h" // advanced editor (dani)
+#include "kilehelp.h" // kile help (dani)
+#include "quickpreview.h"
+#include "kileabbrevview.h"
+
+#define ID_HINTTEXT 301
+#define ID_LINE_COLUMN 302
+
+#define KILERC_VERSION 6
+
+class QFileInfo;
+class QTimer;
+class QSignalMapper;
+class QIconViewItem;
+
+class KToolBar;
+class KAction;
+class KActionMenu;
+class KRecentFilesAction;
+class KToggleFullScreenAction;
+class KToggleToolBarAction;
+class KMultiTabBar;
+
+class KileLyxServer;
+class KileEventFilter;
+class KileProject;
+class KileProjectItem;
+class KileProjectView;
+class TemplateItem;
+class KileAutoSaveJob;
+class KileErrorHandler;
+class KileSideBar;
+
+namespace KileAction { class TagData; }
+namespace KileDocument { class Info; class TextInfo; class Extensions; }
+namespace KileTool { class Manager; class Factory; }
+namespace KileWidget { class LogMsg; class Output; class Konsole; class Structure; }
+
+//TODO remove once we stop supporting pre 1.7 user tools
+struct userItem
+{
+ QString name, tag;
+};
+
+/**
+ * @author Jeroen Wijnhout
+ **/
+
+/**
+ * The Kile main class. It acts as the mainwindow, information manager and DCOP interface.
+ **/
+class Kile : public KParts::MainWindow, public KileAppDCOPIface, public KileInfo
+{
+ Q_OBJECT
+
+public:
+ Kile( bool allowRestore = true, QWidget *parent = 0, const char *name = 0 );
+ ~Kile();
+
+public slots:
+ /**
+ * @param line : Jump to give line in current editor (can be called via DCOP interface).
+ **/
+ void setLine( const QString &line);
+ void setCursor(const KURL &, int, int);
+ void setActive();
+ int run(const QString &);
+ int runWith(const QString &, const QString &);
+ void runArchiveTool();
+ void runArchiveTool(const KURL&);
+ void openDocument(const QString & url);
+ void fileSelected(const QString & url) { openDocument(url); } //backwards compatibility
+ void closeDocument();
+ void showTip();
+
+/* actions */
+private:
+ void showEvent(QShowEvent *e);
+ void hideEvent(QHideEvent *e);
+ QWidget *m_focusWidget;
+
+ void setupStatusBar();
+ void setupSideBar();
+ void setupProjectView();
+ void setupStructureView();
+ void setupScriptsManagementView();
+ void setupSymbolViews();
+ void enableSymbolViewMFUS();
+ void disableSymbolViewMFUS();
+ void setupAbbreviationView();
+ void setupBottomBar();
+ void setupGraphicTools();
+ void setupPreviewTools();
+ void setupActions();
+ void setupTools();
+ void setupUserTagActions();
+ void cleanUpActionList(QPtrList<KAction> &, const QStringList & tools);
+
+ bool kateCompletionPlugin();
+ void checkKateSettings();
+
+ void initMenu();
+ void setMenuItems(QStringList &list, QMap<QString,bool> &dict);
+ void updateMenu();
+ void updateActionList(QPtrList<KAction> *list, bool state);
+ QMap<QString,bool> m_dictMenuAction, m_dictMenuFile, m_dictMenuProject;
+
+ KToolBar *m_toolsToolBar;
+ KActionMenu *m_menuUserTags;
+ QValueList<KileAction::TagData> m_listUserTags;
+ QValueList<userItem> m_listUserTools;
+ QPtrList<KAction> m_listUserTagsActions, m_listQuickActions, m_listCompilerActions, m_listConverterActions, m_listViewerActions, m_listOtherActions;
+ KAction *m_actionEditTag;
+ KActionSeparator *m_actionEditSeparator;
+ KAction *m_paStop, *m_paPrint;
+ KToggleAction *ModeAction, *WatchFileAction;
+ KToggleAction *m_actionMessageView;
+ KRecentFilesAction *m_actRecentFiles;
+ KToggleFullScreenAction *m_pFullScreen;
+
+/* GUI */
+private:
+ //widgets
+ KileSideBar *m_sideBar;
+ KileAbbrevView *m_kileAbbrevView;
+ QWidgetStack *m_topWidgetStack;
+ QSplitter *m_horizontalSplitter, *m_verticalSplitter;
+ QToolBox *m_toolBox;
+ SymbolView *m_symbolViewMFUS, *m_symbolViewRelation, *m_symbolViewArrows, *m_symbolViewMiscMath, *m_symbolViewMiscText, *m_symbolViewOperators, *m_symbolViewUser, *m_symbolViewDelimiters, *m_symbolViewGreek, *m_symbolViewSpecial, *m_symbolViewCyrillic;
+
+ //parts
+ KParts::PartManager *m_partManager;
+ QString m_wantState, m_currentState;
+
+private slots:
+ void toggleMode();
+ void toggleWatchFile();
+ void showEditorWidget();
+ void refreshStructure();
+
+ void helpLaTex();
+
+private slots:
+ bool resetPart();
+ void activePartGUI(KParts::Part *);
+ void showToolBars(const QString &);
+ void enableKileGUI(bool);
+ void slotToggleFullScreen();
+
+public slots:
+ void prepareForPart(const QString &);
+
+/* config */
+private:
+ KConfig *m_config;
+ int m_horSplitRight, m_horSplitLeft, m_verSplitTop, m_verSplitBottom;
+ QStringList m_recentFilesList, m_listDocsOpenOnStart, m_listProjectsOpenOnStart;
+
+ void setViewerToolBars();
+signals:
+ /**
+ * Emit this signal when the configuration is changed. Classes that read and write to the global KConfig object
+ * should connect to this signal so they can update their settings.
+ **/
+ void configChanged();
+
+private slots:
+ void restoreFilesAndProjects(bool allowRestore);
+ void readGUISettings();
+ void readUserSettings();
+ void readRecentFileSettings();
+ void saveSettings();
+
+ void readConfig();
+
+ void generalOptions();
+ void configureKeys();
+ void configureToolbars();
+ void slotPerformCheck();
+
+private slots:
+ /**
+ * Activates (sets up the GUI for the editor part) the view.
+ * @param updateStruct If true, force an update of the structure view.
+ **/
+ void activateView(QWidget* view , bool updateStruct = true);
+
+ void focusLog();
+ void focusOutput();
+ void focusKonsole();
+ void focusEditor();
+ void focusPreview();
+
+ void sideOrBottomBarChanged(bool visible);
+
+public slots:
+ bool queryExit();
+ bool queryClose();
+
+ void changeInputEncoding();
+
+ void newStatus(const QString& = QString::null);
+ void updateModeStatus();
+ void newCaption();
+ void citeViewBib();
+
+public slots:
+ void openProject(const QString& proj);
+
+private:
+ KRecentFilesAction *m_actRecentProjects;
+
+ //
+ // documentinfo
+ //
+private slots:
+ void showDocInfo(Kate::Document *doc = 0);
+ void convertToASCII(Kate::Document *doc = 0);
+ void convertToEnc(Kate::Document *doc = 0);
+
+public:
+ int lineNumber();
+
+/* autosave */
+private slots:
+ void autoSaveAll();
+ void enableAutosave(bool);
+
+private:
+ QTimer *m_AutosaveTimer;
+
+private slots:
+ void runTool();
+
+ void cleanAll(KileDocument::TextInfo *docinfo = 0);
+ void cleanBib();
+
+ void findInFiles();
+ void findInProjects();
+ void grepItemSelected(const QString &abs_filename, int line);
+
+/* insert tags */
+private slots:
+ /**
+ * @param td Inserts the TagData td into the current editor.
+ *
+ * It can wrap a tag around selected text.
+ **/
+ void insertTag(const KileAction::TagData& td);
+ /**
+ * @param td Inserts the TagData td into the current editor
+ * @param pkgs list of packages needed for this command
+ *
+ * warns if latex packages in pkgs are not included in the document
+ **/
+ void insertTag(const KileAction::TagData& td, const QStringList& pkgs);
+ /**
+ * An overloaded member function, behaves essentially as above.
+ **/
+ void insertTag(const QString& tagB, const QString& tagE, int dx, int dy);
+ void insertAmsTag(const KileAction::TagData& td);
+ void insertText(const QString &text, const QStringList &pkgs);
+ void insertText(const QString &text);
+
+ void quickTabular();
+ void quickArray();
+ void quickTabbing();
+ void quickDocument();
+ void quickFloat();
+ void quickMathenv();
+ void quickPostscript();
+ void quickTabulardialog(bool tabularenv);
+
+ void editUserMenu();
+
+ void includeGraphics();
+
+private:
+ KileLyxServer *m_lyxserver;
+
+private:
+ KileErrorHandler *m_errorHandler;
+
+// QuickPreview
+private slots:
+ void slotQuickPreview(int type);
+
+ void quickPreviewEnvironment() { slotQuickPreview(KileTool::qpEnvironment); }
+ void quickPreviewSelection() { slotQuickPreview(KileTool::qpSelection); }
+ void quickPreviewSubdocument() { slotQuickPreview(KileTool::qpSubdocument); }
+ void quickPreviewMathgroup() { slotQuickPreview(KileTool::qpMathgroup); }
+};
+
+#endif
diff --git a/src/kile/kile.kcfg b/src/kile/kile.kcfg
new file mode 100644
index 0000000..611e876
--- /dev/null
+++ b/src/kile/kile.kcfg
@@ -0,0 +1,515 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <include>qapplication.h</include>
+ <include>qstring.h</include>
+ <include>qtextcodec.h</include>
+ <include>qdir.h</include>
+
+ <kcfgfile name="kilerc"/>
+
+ <group name="VersionInfo">
+ <entry name="RCVersion" type="Int">
+ <label>The resource file version.</label>
+ <default>0</default>
+ </entry>
+ </group>
+ <group name="Geometries">
+ <entry name="horizontalSplitterLeft" type="Int">
+ <label></label>
+ <default>100</default>
+ </entry>
+ <entry name="horizontalSplitterRight" type="Int">
+ <label></label>
+ <default>350</default>
+ </entry>
+ <entry name="verticalSplitterTop" type="Int">
+ <label></label>
+ <default>350</default>
+ </entry>
+ <entry name="verticalSplitterBottom" type="Int">
+ <label></label>
+ <default>100</default>
+ </entry>
+ <entry name="MainwindowWidth" type="Int">
+ <label>The main window's width.</label>
+ <default code="true">
+ QApplication::desktop()->screenGeometry().width() - 100
+ </default>
+ </entry>
+ <entry name="MainwindowHeight" type="Int">
+ <label>The main window's height.</label>
+ <default code="true">
+ QApplication::desktop()->screenGeometry().height() - 100
+ </default>
+ </entry>
+ </group>
+ <group name="Structure">
+ <entry name="DefaultLevel" type="Int">
+ <label>The expansion level for the structure view.</label>
+ <default>5</default>
+ </entry>
+ <entry name="SvShowLabels" type="Bool">
+ <label>Show label commands in the structure view</label>
+ <default>true</default>
+ </entry>
+ <entry name="SvShowReferences" type="Bool">
+ <label>Show undefined references in the structure view</label>
+ <default>false</default>
+ </entry>
+ <entry name="SvShowBibitems" type="Bool">
+ <label>Show bibitems commands in the structure view</label>
+ <default>true</default>
+ </entry>
+ <entry name="SvShowGraphics" type="Bool">
+ <label>Show includegraphics commands in the structure view</label>
+ <default>true</default>
+ </entry>
+ <entry name="SvShowFloats" type="Bool">
+ <label>Show float environments in the structure view</label>
+ <default>true</default>
+ </entry>
+ <entry name="SvShowInputFiles" type="Bool">
+ <label>Show file input commands in the structure view</label>
+ <default>true</default>
+ </entry>
+ <entry name="SvShowSectioningLabels" type="Bool">
+ <label>Show labels as child of sectioning items in the structure view</label>
+ <default>false</default>
+ </entry>
+ <entry name="SvShowTodo" type="Bool">
+ <label>Show TODO and FIXME comments</label>
+ <default>true</default>
+ </entry>
+ <entry name="SvOpenLabels" type="Bool">
+ <label>Open the parent item for all labels in the structure view as default</label>
+ <default>false</default>
+ </entry>
+ <entry name="SvOpenReferences" type="Bool">
+ <label>Open the parent item for all undefined references in the structure view</label>
+ <default>false</default>
+ </entry>
+ <entry name="SvOpenBibitems" type="Bool">
+ <label>Open the parent item for all bibitems in the structure view as default</label>
+ <default>false</default>
+ </entry>
+ <entry name="SvOpenTodo" type="Bool">
+ <label>Open the parent item for all TODO and FIXME comments as default</label>
+ <default>false</default>
+ </entry>
+ </group>
+ <group name="Tools">
+ <entry name="RunLyxServer" type="Bool">
+ <label>Whether to run the Lyx server.</label>
+ <default>true</default>
+ </entry>
+ <entry name="TeXPaths" type="String">
+ <label>Holds the TEXINPUTS environment variable.</label>
+ <whatsthis>Set the TEXINPUTS environment variable here. TEXINPUTS should be a colon-separated list of all paths TeX should look for additional packages and/or files. You do not have to add :$TEXINPUTS at the end.</whatsthis>
+ <default></default>
+ </entry>
+ <entry name="PreviewTeXPaths" type="String">
+ <label>Holds the TEXINPUTS environment variable for QuickPreview tools.</label>
+ <whatsthis>Set the TEXINPUTS environment variable for QuickPreview tools here. TEXINPUTS should be a colon-separated list of all paths TeX should look for additional packages and/or files. You do not have to add :$TEXINPUTS at the end.</whatsthis>
+ <default></default>
+ </entry>
+ <entry name="BibInputPaths" type="String">
+ <label>Holds th BIBINPUTS environment variable.</label>
+ <whatsthis>Set the BIBINPUTS environment variable here. BIBINPUTS should be a colon-separated list of all paths bibtex should look for additional .bib files. You do not have to add :$BIBINPUTS at the end.</whatsthis>
+ <default></default>
+ </entry>
+ <entry name="BstInputPaths" type="String">
+ <label>Holds th BSTINPUTS environment variable.</label>
+ <whatsthis>Set the BSTINPUTS environment variable here. BSTINPUTS should be a colon-separated list of all paths bibtex should look for additional .bst files. You do not have to add :$BSTINPUTS at the end.</whatsthis>
+ <default></default>
+ </entry>
+ </group>
+ <group name="Show">
+ <entry name="BottomBar" type="Bool">
+ <label>Whether to show the bottom bar.</label>
+ <default>true</default>
+ </entry>
+ <entry name="BottomBarSize" type="Int">
+ <label>Height of the bottombar.</label>
+ <default>200</default>
+ </entry>
+ <entry name="SideBarSize" type="Int">
+ <label>Width of the sidebar.</label>
+ <default>300</default>
+ </entry>
+ <entry name="SideBar" type="Bool">
+ <label>Whether to show the side bar.</label>
+ <default>true</default>
+ </entry>
+ <entry name="HideProblemBadBox" type="Bool">
+ <label>Whether to show Bad Box warnings in the LogMsg view.</label>
+ <default>false</default>
+ </entry>
+ <entry name="HideProblemWarning" type="Bool">
+ <label>Whether to show (La)TeX warnings in the LogMsg view.</label>
+ <default>false</default>
+ </entry>
+ <entry name="SelectedLeftView" type="Int">
+ <label>The identifier of the selected view in the left pane.</label>
+ <default>1</default>
+ </entry>
+ </group>
+ <group name="Editor Ext">
+ <entry name="CompleteEnvironment" type="Bool">
+ <label>Automatic completion \begin{env} with \end{env}.</label>
+ <default>true</default>
+ </entry>
+ <entry name="envIndentation" type="Bool">
+ <label>Enable auto indentation of environemnts</label>
+ <default>true</default>
+ </entry>
+ <entry name="envIndentSpaces" type="Bool">
+ <label>Use spaces instead of a tabulator to autoindent environments</label>
+ <default>true</default>
+ </entry>
+ <entry name="envIndentNumSpaces" type="Int">
+ <label>Use this number of spaces to autoindent environments</label>
+ <default>1</default>
+ </entry>
+ <entry name="ShowUserCommands" type="Bool">
+ <label></label>
+ <default>false</default>
+ </entry>
+ <entry name="InsertDoubleQuotes" type="Bool">
+ <label>Automatic insertion of double quotes.</label>
+ <default>true</default>
+ </entry>
+ <entry name="DoubleQuotes" type="Int">
+ <label>Language dependent type of double quotes.</label>
+ <default>0</default>
+ </entry>
+ </group>
+ <group name="IncludeGraphics">
+ <entry name="igCenter" type="Bool">
+ <label>Center the graphics.</label>
+ <default>true</default>
+ </entry>
+ <entry name="igPdftex" type="Bool">
+ <label>Use PdfTeX or PdfLaTeX.</label>
+ <default>false</default>
+ </entry>
+ <entry name="igGraphicspath" type="Bool">
+ <label>Filename is relative to a path given in graphicspath command.</label>
+ <default>false</default>
+ </entry>
+ <entry name="igFigure" type="Bool">
+ <label>Embed the graphics in a figure environment.</label>
+ <default>false</default>
+ </entry>
+ <entry name="imagemagick" type="Bool">
+ <label>Whether ImageMagick is installed.</label>
+ <default>false</default>
+ </entry>
+ <entry name="boundingbox" type="Bool">
+ <label>Try to determine the bounding box from the picture.</label>
+ <default>true</default>
+ </entry>
+ <entry name="resolution" type="Int">
+ <label>The default image resolution.</label>
+ <default>300</default>
+ </entry>
+ </group>
+ <group name="Help">
+ <entry name="location" type="String">
+ <label>Location of the TeX documentation.</label>
+ <default>/usr/share/texmf/doc</default>
+ </entry>
+ <entry name="use" type="Int">
+ <label>Use the system's TeX reference for the contextual help.</label>
+ <default>0</default>
+ </entry>
+ <entry name="embedded" type="Int">
+ <label>Use embedded viewer for user help.</label>
+ <default>1</default>
+ </entry>
+ </group>
+ <group name="Files">
+ <entry name="DefaultEncoding" type="String">
+ <label>The default encoding.</label>
+ <default>invalid</default>
+ </entry>
+ <entry name="Restore" type="Bool">
+ <label>Reopen files and projects on startup.</label>
+ <default>true</default>
+ </entry>
+ <entry name="Autosave" type="Bool">
+ <label>Automatic save.</label>
+ <default>true</default>
+ </entry>
+ <entry name="CleanUpAfterClose" type="Bool">
+ <label>Automatically clean-up files after close.</label>
+ <default>false</default>
+ </entry>
+ <entry name="AutosaveInterval" type="Int">
+ <label>The autosave interval in minutes.</label>
+ <default>10</default>
+ </entry>
+ <entry name="CleanUpFileExtensions" type="String">
+ <label>The file extensions to clean on exit.</label>
+ <default>.log .aux .lof .lot .bit .idx .glo .blg .ilg .toc .ind</default>
+ </entry>
+ <entry name="LastDocument" type="Path">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="InputEncoding" type="String">
+ <label></label>
+ <default code="true">
+ QString::fromLatin1(QTextCodec::codecForLocale()->name())
+ </default>
+ </entry>
+ <entry name="lastDir" type="Path">
+ <label></label>
+ <default></default>
+ </entry>
+ </group>
+ <group name="User">
+ <entry name="Author" type="String">
+ <label>The Author template variable.</label>
+ <default></default>
+ </entry>
+ <entry name="DocumentClassOptions" type="String">
+ <label>The Documentclass template variable.</label>
+ <default>a4paper,10pt</default>
+ </entry>
+ <entry name="TemplateEncoding" type="String">
+ <label>The Input encoding template variable.</label>
+ <default></default>
+ </entry>
+ <entry name="DefaultProjectLocation" type="String">
+ <label>The default location where the projects must be created.</label>
+ <default code="true">
+ QDir::home().absPath()
+ </default>
+ </entry>
+ </group>
+ <group name="Complete">
+ <entry name="CompleteEnabled" type="Bool">
+ <label></label>
+ <default>true</default>
+ </entry>
+ <entry name="CompleteCursor" type="Bool">
+ <label></label>
+ <default>true</default>
+ </entry>
+ <entry name="CompleteBullets" type="Bool">
+ <label></label>
+ <default>true</default>
+ </entry>
+ <entry name="CompleteCloseEnv" type="Bool">
+ <label></label>
+ <default>true</default>
+ </entry>
+ <entry name="CompleteAuto" type="Bool">
+ <label></label>
+ <default>true</default>
+ </entry>
+ <entry name="CompleteAutoText" type="Bool">
+ <label></label>
+ <default>false</default>
+ </entry>
+ <entry name="completeAutoAbbrev" type="Bool">
+ <label></label>
+ <default>false</default>
+ </entry>
+ <entry name="completeShowAbbrev" type="Bool">
+ <label></label>
+ <default>false</default>
+ </entry>
+ <entry name="completeCitationMove" type="Bool">
+ <label></label>
+ <default>false</default>
+ </entry>
+ <entry name="CompleteAutoThreshold" type="Int">
+ <label></label>
+ <default>3</default>
+ </entry>
+ <entry name="CompleteAutoTextThreshold" type="Int">
+ <label></label>
+ <default>3</default>
+ </entry>
+ <entry name="CompleteChangedLists" type="Bool">
+ <label></label>
+ <default>false</default>
+ </entry>
+ <entry name="CompleteChangedCommands" type="Bool">
+ <label></label>
+ <default>false</default>
+ </entry>
+ <entry name="CompleteTex" type="StringList">
+ <label></label>
+ <default>1-latex-document,1-tex</default>
+ </entry>
+ <entry name="CompleteDict" type="StringList">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="CompleteAbbrev" type="StringList">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="autoInsertDollar" type="Bool">
+ <label></label>
+ <default>false</default>
+ </entry>
+ </group>
+ <group name="FilesOpenOnStart">
+ <entry name="Master" type="String">
+ <label></label>
+ <default></default>
+ </entry>
+ </group>
+ <group name="QuickPreview">
+ <entry name="previewTask" type="String">
+ <label></label>
+ <default>LaTeX ---> DVI</default>
+ </entry>
+ <entry name="dvipng" type="Bool">
+ <label>Whether Dvipng is installed.</label>
+ <default>false</default>
+ </entry>
+ <entry name="convert" type="Bool">
+ <label>Whether Convert is installed.</label>
+ <default>false</default>
+ </entry>
+ <entry name="dvipngResolution" type="String">
+ <label></label>
+ <default>120</default>
+ </entry>
+ <entry name="envPreviewInWidget" type="Bool">
+ <label>Show preview of environments in bottom bar.</label>
+ <default>false</default>
+ </entry>
+ <entry name="selPreviewInWidget" type="Bool">
+ <label>Show preview of selected text in bottom bar.</label>
+ <default>false</default>
+ </entry>
+ <entry name="mathgroupPreviewInWidget" type="Bool">
+ <label>Show preview of mathgroups in bottom bar.</label>
+ <default>false</default>
+ </entry>
+ <entry name="envPreviewTool" type="Int">
+ <label>Conversion tool for preview of environments in bottom bar.</label>
+ <default>0</default>
+ </entry>
+ <entry name="selPreviewTool" type="Int">
+ <label>Conversion tool for preview of selected text in bottom bar.</label>
+ <default>0</default>
+ </entry>
+ </group>
+ <group name="QuickDocument">
+ <entry name="userClasses" type="StringList">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="documentClass" type="String">
+ <label></label>
+ <default>article</default>
+ </entry>
+ <entry name="encoding" type="String">
+ <label></label>
+ <default>latin1</default>
+ </entry>
+ <entry name="optionsArticle" type="String">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="optionsBook" type="String">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="optionsReport" type="String">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="optionsLetter" type="String">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="optionsScrartcl" type="String">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="optionsScrbook" type="String">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="optionsScrreprt" type="String">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="optionsProsper" type="String">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="optionsBeamer" type="String">
+ <label></label>
+ <default></default>
+ </entry>
+ </group>
+ <group name="QuickDocument/Packages">
+ <entry name="packagesList" type="StringList">
+ <label></label>
+ <default></default>
+ </entry>
+ </group>
+ <group name="KileGrepDialog">
+ <entry name="LastSearchItems" type="StringList">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="LastSearchPaths" type="StringList">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="LastSearchTemplates" type="StringList">
+ <label></label>
+ <default></default>
+ </entry>
+ <entry name="GrepRecursive" type="Bool">
+ <label></label>
+ <default>true</default>
+ </entry>
+ </group>
+ <group name="KileConfigDialog">
+ <entry name="UnfoldConfigTree" type="Bool">
+ <label></label>
+ <default>false</default>
+ </entry>
+ </group>
+ <group name="Scripting">
+ <entry name="ScriptingEnabled" type="Bool">
+ <label>Enable the scripting support.</label>
+ <default>true</default>
+ </entry>
+ <entry name="TimeLimitEnabled" type="Bool">
+ <label>Set a time limit for the execution of scripts.</label>
+ <default>true</default>
+ </entry>
+ <entry name="TimeLimit" type="Int">
+ <label>Time limit for the execution of scripts.</label>
+ <default>5</default>
+ </entry>
+ </group>
+ <group name="MostUsedSymbols">
+ <entry name="numSymbolsMFUS" type="UInt">
+ <label>Number of symbols to store in the Most Frequently Used Symbols view.</label>
+ <default>30</default>
+ </entry>
+ <entry name="displayMFUS" type="Bool">
+ <label>Display the Most Frequently Used Symbols view.</label>
+ <default>true</default>
+ </entry>
+ <entry name="clearMFUS" type="Bool">
+ <label>Clear the list of the most frequently used symbols whilst closing Kile.</label>
+ <default>false</default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/src/kile/kileabbrevview.cpp b/src/kile/kileabbrevview.cpp
new file mode 100644
index 0000000..69efeb6
--- /dev/null
+++ b/src/kile/kileabbrevview.cpp
@@ -0,0 +1,319 @@
+/***************************************************************************
+ begin : Feb 24 2007
+ copyright : 2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kileabbrevview.h"
+
+#include <klistview.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include "kiledebug.h"
+
+#include <qheader.h>
+#include <qlayout.h>
+#include <qregexp.h>
+#include <qvalidator.h>
+#include <qfile.h>
+
+KileAbbrevView::KileAbbrevView(QWidget *parent, const char *name)
+ : KListView(parent, name), m_changes(false)
+{
+
+ addColumn(i18n("Short"));
+ addColumn(QString::null);
+ addColumn(i18n("Expanded Text"));
+ setAllColumnsShowFocus(true);
+ setFullWidth(true);
+
+ setItemsMovable(false); // default: true
+ //setAcceptDrops(false); // default: false
+ //setDragEnabled(false); // default: false
+ //setShadeSortColumn(true); // default: true
+ header()->setMovingEnabled(false); // default: true
+
+ m_popup = new QPopupMenu( this );
+
+ connect(this, SIGNAL(mouseButtonClicked(int,QListViewItem *,const QPoint &,int)),
+ this, SLOT(slotMouseButtonClicked(int,QListViewItem *,const QPoint &,int)));
+
+ connect(this, SIGNAL(contextMenu(KListView *,QListViewItem *,const QPoint &)),
+ this, SLOT(slotContextMenu(KListView *,QListViewItem *,const QPoint &)));
+}
+
+KileAbbrevView::~KileAbbrevView()
+{
+}
+//////////////////// init abbreviation view with wordlists ////////////////////
+
+
+void KileAbbrevView::init(const QStringList *globallist, const QStringList *locallist)
+{
+ setUpdatesEnabled(false);
+ clear();
+ addWordlist(globallist,true);
+ addWordlist(locallist,false);
+ setUpdatesEnabled(true);
+
+ m_changes = false;
+}
+
+void KileAbbrevView::addWordlist(const QStringList *wordlist, bool global)
+{
+ QString type = ( global ) ? QString::null : "*";
+
+ QStringList::ConstIterator it;
+ for ( it=wordlist->begin(); it!=wordlist->end(); ++it )
+ {
+ int index = (*it).find( '=' );
+ if ( index >= 0 )
+ {
+ insertItem( new KListViewItem(this,(*it).left(index),type,(*it).right( (*it).length()-index-1 )) );
+ }
+ }
+}
+
+//////////////////// save local abbreviation list ////////////////////
+
+void KileAbbrevView::saveLocalAbbreviation(const QString &filename)
+{
+ if ( ! m_changes )
+ return;
+
+ KILE_DEBUG() << "=== KileAbbrevView::saveLocalAbbreviation ===================" << endl;
+ // create the file
+ QFile abbrevfile(filename);
+ if ( ! abbrevfile.open( IO_WriteOnly ) )
+ return;
+
+ QTextStream stream( &abbrevfile );
+ stream << "# abbreviation mode: editable abbreviations\n";
+ stream << "# dani/2007\n";
+
+ //QTextCodec *codec = QTextCodec::codecForName(m_ki->activeTextDocument()->encoding().ascii());
+ // stream.setCodec(codec);
+
+ QListViewItemIterator it( this );
+ while ( it.current() )
+ {
+ if ( it.current()->text(KileAbbrevView::ALVlocal) == "*" )
+ {
+ stream << it.current()->text(KileAbbrevView::ALVabbrev)
+ << "="
+ << it.current()->text(KileAbbrevView::ALVexpansion)
+ << "\n";
+ }
+ ++it;
+ }
+ abbrevfile.close();
+
+ m_changes = false;
+}
+
+//////////////////// find abbreviation ////////////////////
+
+bool KileAbbrevView::findAbbreviation(const QString &abbrev)
+{
+ QListViewItemIterator it( this );
+ while ( it.current() )
+ {
+ if ( it.current()->text(KileAbbrevView::ALVabbrev) == abbrev )
+ return true;
+
+ ++it;
+ }
+ return false;
+}
+
+//////////////////// item clicked ////////////////////
+
+void KileAbbrevView::slotMouseButtonClicked(int button, QListViewItem *item, const QPoint &, int)
+{
+ if ( button==1 && item )
+ {
+ emit( sendText( item->text(KileAbbrevView::ALVexpansion) ) );
+ }
+}
+
+//////////////////// context menu ////////////////////
+
+void KileAbbrevView::slotContextMenu(KListView *, QListViewItem *item, const QPoint &pos)
+{
+ m_popup->clear();
+ m_popup->disconnect();
+
+ m_popup->insertItem(i18n("&Add"),ALVadd);
+ if ( item && item->text(ALVlocal)== "*" )
+ {
+ m_popup->insertSeparator();
+ m_popup->insertItem(i18n("&Edit"),ALVedit);
+ m_popup->insertSeparator();
+ m_popup->insertItem(i18n("&Delete"),ALVdelete);
+ }
+
+ connect(m_popup, SIGNAL(activated(int)), this, SLOT(slotPopupAbbreviation(int)));
+
+ // show context menu
+ m_popup->exec(pos);
+}
+
+void KileAbbrevView::addAbbreviation(const QString &abbrev, const QString &expansion)
+{
+ insertItem( new KListViewItem(this,abbrev,"*",expansion) );
+ QString newAbbrev = abbrev + '=' + expansion;
+
+ emit( updateAbbrevList(QString::null,newAbbrev) );
+ m_changes = true;
+}
+
+void KileAbbrevView::changeAbbreviation(KListViewItem *item, const QString &abbrev, const QString &expansion)
+{
+ if ( item )
+ {
+ QString oldAbbrev = item->text(ALVabbrev) + '=' + item->text(ALVexpansion);
+ QString newAbbrev = abbrev + '=' + expansion;
+ item->setText(ALVabbrev,abbrev);
+ item->setText(ALVexpansion,expansion);
+
+ emit( updateAbbrevList(oldAbbrev,newAbbrev) );
+ m_changes = true;
+ }
+}
+
+void KileAbbrevView::deleteAbbreviation(KListViewItem *item)
+{
+ QString abbrev = item->text(ALVabbrev);
+ QString message = i18n("Delete the abbreviation '%1'?").arg(abbrev);
+ if ( KMessageBox::questionYesNo( this,
+ "<center>" + message + "</center>",
+ i18n("Delete Abbreviation") ) == KMessageBox::Yes )
+ {
+ QString s = item->text(ALVabbrev) + '=' + item->text(ALVexpansion);
+ delete item;
+
+ emit( updateAbbrevList(s,QString::null) );
+ m_changes = true;
+ }
+}
+
+void KileAbbrevView::slotPopupAbbreviation(int id)
+{
+ KListViewItem *item = (KListViewItem *)selectedItem();
+
+ int mode = ALVnone;
+ if ( id == ALVadd )
+ mode = ALVadd;
+ else if ( id==ALVedit && item )
+ mode = ALVedit;
+ else if ( id==ALVdelete && item )
+ deleteAbbreviation(item);
+
+ if ( mode != ALVnone )
+ {
+ KileAbbrevInputDialog *dialog = new KileAbbrevInputDialog(this,item,mode);
+ if ( dialog->exec() == QDialog::Accepted )
+ {
+ QString abbrev,expansion;
+ dialog->abbreviation(abbrev,expansion);
+ if ( mode == ALVadd )
+ addAbbreviation(abbrev,expansion);
+ else
+ changeAbbreviation(item,abbrev,expansion);
+ }
+ delete dialog;
+ }
+}
+
+//////////////////// add/edit abbreviation ////////////////////
+
+KileAbbrevInputDialog::KileAbbrevInputDialog(KileAbbrevView *listview, KListViewItem *item, int mode, const char *name )
+ : KDialogBase(listview,name, true, i18n("Add Abbreviation"), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true),
+ m_listview(listview), m_abbrevItem(item), m_mode(mode)
+{
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+ QVBoxLayout *vl = new QVBoxLayout(page, 0, spacingHint());
+
+ if ( m_mode == KileAbbrevView::ALVedit )
+ {
+ setCaption( i18n("Edit Abbreviation") );
+ m_abbrev = m_abbrevItem->text(KileAbbrevView::ALVabbrev);
+ m_expansion = m_abbrevItem->text(KileAbbrevView::ALVexpansion);
+ }
+
+ QLabel *abbrev = new QLabel(i18n("&Abbreviation:"),page);
+ QLabel *expansion = new QLabel(i18n("&Expanded Text:"),page);
+ m_leAbbrev = new KLineEdit(m_abbrev,page);
+ m_leExpansion = new KLineEdit(m_expansion,page);
+
+ vl->addWidget(abbrev);
+ vl->addWidget(m_leAbbrev);
+ vl->addWidget(expansion);
+ vl->addWidget(m_leExpansion);
+ vl->addSpacing(8);
+
+ abbrev->setBuddy(m_leAbbrev);
+ expansion->setBuddy(m_leExpansion);
+
+ QRegExp reg("[a-zA-Z0-9]+");
+ QRegExpValidator *abbrevValidator = new QRegExpValidator(reg,this);
+ m_leAbbrev->setValidator(abbrevValidator);
+
+ connect(m_leAbbrev,SIGNAL(textChanged(const QString &)),
+ this,SLOT(slotTextChanged(const QString &)));
+ connect(m_leExpansion,SIGNAL(textChanged(const QString &)),
+ this,SLOT(slotTextChanged(const QString &)));
+
+ slotTextChanged(QString::null);
+ m_leAbbrev->setFocus();
+ page->setMinimumWidth(350);
+}
+
+KileAbbrevInputDialog::~KileAbbrevInputDialog()
+{
+}
+
+void KileAbbrevInputDialog::abbreviation(QString &abbrev, QString &expansion)
+{
+ abbrev = m_leAbbrev->text();
+ expansion = m_leExpansion->text().stripWhiteSpace();
+}
+
+void KileAbbrevInputDialog::slotTextChanged(const QString &)
+{
+ bool state = ( m_mode == KileAbbrevView::ALVadd )
+ ? ! m_listview->findAbbreviation( m_leAbbrev->text() ) : true;
+ state = state && !m_leAbbrev->text().isEmpty() && !m_leExpansion->text().isEmpty();
+
+ enableButton(KDialogBase::Ok,state);
+}
+
+void KileAbbrevInputDialog::slotOk()
+{
+ QString abbrev = m_leAbbrev->text();
+ QString expansion = m_leExpansion->text().stripWhiteSpace();
+
+ if ( abbrev.isEmpty() || expansion.isEmpty() )
+ {
+ KMessageBox::error( this, i18n("Empty strings are not allowed.") );
+ return;
+ }
+
+ if ( abbrev!=m_abbrev || expansion!=m_expansion )
+ accept();
+ else
+ reject();
+}
+
+
+#include "kileabbrevview.moc"
diff --git a/src/kile/kileabbrevview.h b/src/kile/kileabbrevview.h
new file mode 100644
index 0000000..040a55a
--- /dev/null
+++ b/src/kile/kileabbrevview.h
@@ -0,0 +1,95 @@
+/***************************************************************************
+ begin : Feb 24 2007
+ copyright : 2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEABBREVVIEW_H
+#define KILEABBREVVIEW_H
+
+#include <qstring.h>
+#include <qlabel.h>
+#include <qpopupmenu.h>
+
+#include <klineedit.h>
+#include <klistbox.h>
+#include <klistview.h>
+#include <kdialogbase.h>
+
+//////////////////// KlistView for abbreviations ////////////////////
+
+class KileAbbrevView : public KListView
+{
+ Q_OBJECT
+
+public:
+ enum { ALVabbrev=0, ALVlocal=1, ALVexpansion=2 };
+ enum { ALVnone=0, ALVadd=1, ALVedit=2, ALVdelete=3 };
+
+ KileAbbrevView(QWidget *parent=0, const char *name=0);
+ ~KileAbbrevView();
+
+ void init(const QStringList *globallist, const QStringList *locallist);
+ bool findAbbreviation(const QString &abbrev);
+ void saveLocalAbbreviation(const QString &filename);
+
+signals:
+ void updateAbbrevList(const QString &ds, const QString &as);
+ void sendText(const QString &text);
+
+private slots:
+ void slotMouseButtonClicked(int button, QListViewItem *item, const QPoint &pos, int);
+ void slotContextMenu(KListView *, QListViewItem *item, const QPoint &pos);
+ void slotPopupAbbreviation(int id);
+
+private:
+ QPopupMenu* m_popup;
+ bool m_changes;
+
+ void addAbbreviation(const QString &abbrev, const QString &expansion);
+ void changeAbbreviation(KListViewItem *item,const QString &abbrev, const QString &expansion);
+ void deleteAbbreviation(KListViewItem *item);
+
+ void addWordlist(const QStringList *wordlist, bool global);
+
+};
+
+//////////////////// add/edit dialog for abbreviations ////////////////////
+
+class KileAbbrevInputDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KileAbbrevInputDialog(KileAbbrevView *listview, KListViewItem *item, int mode, const char *name=0);
+ ~KileAbbrevInputDialog();
+
+ void abbreviation(QString &abbrev, QString &expansion);
+
+private:
+ KileAbbrevView *m_listview;
+ KListViewItem *m_abbrevItem;
+ KLineEdit *m_leAbbrev;
+ KLineEdit *m_leExpansion;
+
+ int m_mode;
+ QString m_abbrev, m_expansion;
+
+public slots:
+ void slotOk();
+
+private slots:
+ void slotTextChanged(const QString &text);
+
+};
+
+#endif
diff --git a/src/kile/kileactions.cpp b/src/kile/kileactions.cpp
new file mode 100644
index 0000000..99314d2
--- /dev/null
+++ b/src/kile/kileactions.cpp
@@ -0,0 +1,394 @@
+/***************************************************************************
+ begin : 2003-07-01 17:33:00 CEST 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// 2005-07-26 dani
+// - cleanup dialog
+// - added new action 'ShowLabel'
+
+// 2007-03-12 dani
+// - use KileDocument::Extensions
+
+#include "kileactions.h"
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qfileinfo.h>
+
+#include <klineedit.h>
+#include <kglobal.h>
+#include <kcombobox.h>
+#include <kpushbutton.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <kiconloader.h>
+
+#include "kiledebug.h"
+
+#include "kileinfo.h"
+#include "kiledocmanager.h"
+
+namespace KileAction
+{
+
+////////////////
+// Tag //
+////////////////
+Tag::Tag( const QString &text, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent
+ , const char *name, const QString &tagBegin, const QString &tagEnd
+ , int dx, int dy, const QString &description)
+ : KAction(text, cut, parent, name),
+ m_data(text,tagBegin, tagEnd, dx, dy, description)
+{
+ init(receiver,slot);
+}
+
+Tag::Tag( const QString &text, const QString& pix, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent
+ , const char *name, const QString &tagBegin, const QString &tagEnd
+ , int dx, int dy, const QString &description)
+ : KAction(text, pix, cut, parent, name),
+ m_data(text,tagBegin, tagEnd, dx, dy, description)
+{
+ init(receiver,slot);
+}
+
+Tag::Tag( const QString &text, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent
+ , const char *name, const TagData& data)
+ : KAction(text, cut, parent, name),
+ m_data(data)
+{
+ init(receiver,slot);
+}
+
+Tag::Tag( const QString &text, const QString& pix, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent
+ , const char *name, const TagData& data)
+ : KAction(text, pix, cut, parent, name),
+ m_data(data)
+{
+ init(receiver,slot);
+}
+
+Tag::~Tag()
+{
+}
+
+void Tag::init(const QObject *receiver, const char *slot)
+{
+ connect(this, SIGNAL(activated()), SLOT(emitData()));
+ connect(this, SIGNAL(activated(const KileAction::TagData&)), receiver, slot);
+}
+
+void Tag::emitData()
+{
+ emit(activated(m_data));
+}
+
+////////////////
+// InputTag //
+////////////////
+InputTag::InputTag(KileInfo* ki, const QString &text, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name, QWidget *wparent, uint options
+ , const QString &tagBegin, const QString &tagEnd
+ , int dx, int dy, const QString &description, const QString &hint, const QString &alter)
+ : Tag(text, cut, receiver, slot, parent, name, tagBegin, tagEnd, dx, dy, description), m_ki(ki),
+ m_parent(wparent), m_options(options), m_hint(hint), m_alter(alter)
+{
+ init();
+}
+
+InputTag::InputTag( KileInfo* ki, const QString &text, const QString& pix, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name, QWidget *wparent,uint options
+ , const QString &tagBegin, const QString &tagEnd
+ , int dx, int dy, const QString &description, const QString &hint, const QString &alter)
+ : Tag(text, pix, cut, receiver, slot, parent, name, tagBegin, tagEnd, dx, dy, description), m_ki(ki),
+ m_parent(wparent), m_options(options), m_hint(hint), m_alter(alter)
+{
+ init();
+}
+
+InputTag::InputTag( KileInfo* ki, const QString &text, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name, QWidget *wparent,uint options
+ , const TagData& data, const QString &hint, const QString &alter)
+ : Tag(text,cut,receiver, slot, parent, name,data), m_ki(ki),
+ m_parent(wparent), m_options(options), m_hint(hint), m_alter(alter)
+{
+ init();
+}
+
+InputTag::InputTag( KileInfo* ki, const QString &text, const QString& pix, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name, QWidget *wparent,uint options
+ , const TagData& data, const QString &hint, const QString &alter)
+ : Tag(text, pix, cut,receiver, slot, parent, name,data), m_ki(ki),
+ m_parent(wparent), m_options(options), m_hint(hint), m_alter(alter)
+{
+ init();
+}
+
+InputTag::~InputTag()
+{
+}
+
+void InputTag::init()
+{
+ m_history.clear();
+}
+
+void InputTag::emitData()
+{
+ KILE_DEBUG() << "InputTag::emitData() " << m_ki->getName() << endl;
+
+ InputDialog *dlg = new InputDialog(m_data.text, m_options, m_history, m_hint, m_alter, m_ki, m_parent, "input_dialog");
+ if (dlg->exec())
+ {
+ if ( (! dlg->tag().isEmpty()) && hasHistory()) addToHistory(dlg->tag());
+
+ TagData td(m_data);
+
+ td.tagBegin.replace("%R",dlg->tag());
+ td.tagEnd.replace("%R",dlg->tag());
+
+ QString alt = dlg->useAlternative() ? "*" : "";
+ td.tagBegin.replace("%A", alt);
+ td.tagEnd.replace("%A", alt);
+
+ if ( dlg->useLabel() )
+ {
+ td.tagEnd += dlg->label();
+ td.dy++;
+ }
+
+ if (dlg->usedSelection())
+ m_ki->clearSelection();
+
+ // if a filename was given for a \input- or \include-command,
+ // the cursor is moved out of the braces
+ if ( (m_options & KileAction::ShowBrowseButton) && !dlg->tag().isEmpty() )
+ td.dx += dlg->tag().length() + 1;
+
+ // insert tag
+ emit(activated(td));
+ // refresh document structure and project tree when a file was inserted
+ if ( dlg->useAddProjectFile() )
+ {
+ m_ki->docManager()->projectAddFile( QFileInfo(m_ki->getCompileName()).dirPath(true) + '/' + dlg->tag() );
+ }
+ }
+ delete dlg;
+}
+
+
+/*
+ InputDialog
+*/
+InputDialog::InputDialog(const QString &caption, uint options, const QStringList& history, const QString& hint, const QString& alter, KileInfo *ki, QWidget *parent, const char *name)
+ : KDialogBase (parent, name, true, caption, KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true), m_ki(ki)
+{
+ QString newcaption = caption;
+ setCaption(newcaption.remove("&"));
+ m_labelprefix = ( newcaption == "chapter" ) ? "chap:" : "sec:";
+
+ m_usedSelection = false;
+
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+ QGridLayout *gbox = new QGridLayout( page, 6,3,5,5,"");
+
+ QLabel *lb = new QLabel(hint, page);
+ gbox->addMultiCellWidget(lb,0,0,0,2);
+
+ m_tag=QString::null;
+ QWidget *focus;
+ if ( (options & KileAction::KeepHistory) || (options & KileAction::FromLabelList) || (options & KileAction::FromBibItemList) )
+ {
+ KComboBox *input = new KComboBox(true, page, "input_dialog_input");
+ input->setCompletionMode(KGlobalSettings::CompletionAuto);
+ input->setMinimumWidth(300);
+ focus = input;
+
+ connect(input, SIGNAL(textChanged(const QString&)), this, SLOT(setTag(const QString&)));
+ connect(this, SIGNAL(setInput(const QString&)), input, SLOT(setEditText(const QString&)));
+ if ( options & KileAction::ShowBrowseButton )
+ gbox->addWidget(input,1,0);
+ else
+ gbox->addMultiCellWidget(input,1,1,0,2);
+
+ const QStringList *list;
+
+ if (options & KileAction::FromLabelList)
+ {
+ list = ki->allLabels();
+ input->insertStringList(*list);
+ m_tag = list->first();
+ }
+ else
+ if (options & KileAction::FromBibItemList)
+ {
+ list = ki->allBibItems();
+ input->insertStringList(*list);
+ m_tag = list->first();
+ }
+ else
+ {
+ if (history.size()>0)
+ {
+ input->insertStringList(history);
+ m_tag = history.first();
+ }
+ }
+ }
+ else
+ {
+ KLineEdit *input = new KLineEdit(page);
+ input->setMinimumWidth(300);
+ focus = input;
+
+ connect(input, SIGNAL(textChanged(const QString&)), this, SLOT(setTag(const QString&)));
+ connect(this, SIGNAL(setInput(const QString&)), input, SLOT(setText(const QString&)));
+ if ( options & KileAction::ShowBrowseButton )
+ gbox->addWidget(input,1,0);
+ else
+ gbox->addMultiCellWidget(input,1,1,0,2);
+
+ input->setText(ki->getSelection());
+ m_usedSelection=true;
+ }
+
+ if (focus)
+ lb->setBuddy(focus);
+
+ if ( options & KileAction::ShowBrowseButton)
+ {
+ KPushButton *pbutton = new KPushButton("", page);
+ pbutton->setPixmap( SmallIcon("fileopen") );
+ gbox->addWidget(pbutton,1,2);
+ gbox->setColSpacing(1,8);
+ gbox->setColSpacing(2, pbutton->sizeHint().width()+5 );
+ connect(pbutton, SIGNAL(clicked()), this, SLOT(slotBrowse()));
+ }
+
+ if ( options & KileAction::ShowAlternative)
+ {
+ QCheckBox * m_checkbox = new QCheckBox(alter, page, "input_dialog_checkbox");
+ connect(m_checkbox, SIGNAL(clicked()), this, SLOT(slotAltClicked()));
+ m_useAlternative=false;
+ gbox->addMultiCellWidget(m_checkbox,2,2,0,2);
+ }
+
+ m_edLabel = 0L;
+ m_useLabel = ( options & KileAction::ShowLabel );
+ if ( m_useLabel )
+ {
+ // Label
+ QLabel *label = new QLabel(i18n("&Label:"),page);
+ m_edLabel = new KLineEdit("",page);
+ m_edLabel->setMinimumWidth(300);
+ m_edLabel->setText(m_labelprefix);
+ label->setBuddy(m_edLabel);
+ gbox->addMultiCellWidget(label,3,3,0,2);
+ gbox->addMultiCellWidget(m_edLabel,4,4,0,2);
+ }
+
+ m_useAddProjectFile = ( options & KileAction::AddProjectFile );
+
+ gbox->setRowStretch(5,1);
+ gbox->setColStretch(0,1);
+
+ focus->setFocus();
+}
+
+
+InputDialog::~InputDialog()
+{
+}
+
+void InputDialog::slotBrowse()
+{
+ QString fn;
+ QFileInfo fi(m_ki->getCompileName());
+
+ // Called from InputDialog after a \input- or \include command:
+ // so we are only looking for a LaTeX source document
+ QString filter = m_ki->extensions()->latexDocumentFileFilter() + '\n' + "*|" + i18n("All Files");
+
+ fn = KFileDialog::getOpenFileName(fi.absFilePath(), filter, this,i18n("Select File") );
+ if ( !fn.isEmpty() )
+ {
+ QString path = m_ki->relativePath(fi.dirPath(), fn);
+
+ // if the file has no extension, we add the default TeX extension
+ if ( QFileInfo(path).extension().isEmpty() )
+ path += m_ki->extensions()->latexDocumentDefault();
+
+ setTag(path);
+ emit(setInput(path));
+ }
+}
+
+void InputDialog::slotAltClicked()
+{
+ m_useAlternative = !m_useAlternative;
+}
+
+void InputDialog::setTag(const QString &tag)
+{
+ m_tag = tag;
+}
+
+QString InputDialog::label()
+{
+ if ( m_edLabel )
+ {
+ QString label = m_edLabel->text().stripWhiteSpace();
+ if ( !label.isEmpty() && label!=m_labelprefix )
+ return "\\label{" + label + "}\n";
+ }
+
+ return QString::null;
+}
+
+/////////////////
+// SelectTag //
+/////////////////
+
+Select::Select(const QString &text, const KShortcut &cut, KActionCollection *parent, const char *name )
+ : KSelectAction(text,cut,parent,name)
+{
+ init();
+}
+
+void Select::init()
+{
+ connect(this, SIGNAL(activated(const QString&)), SLOT(emitData(const QString &)));
+}
+
+void Select::emitData(const QString & name)
+{
+ m_dict[name]->activate();
+}
+
+void Select::setItems(QPtrList<KAction>& list)
+{
+ QStringList tmp;
+
+ for (uint i=0; i < list.count(); ++i)
+ {
+ tmp.append(list.at(i)->text());
+ m_dict.insert(list.at(i)->text(), list.at(i));
+ }
+
+ KSelectAction::setItems(tmp);
+}
+
+}
+
+#include "kileactions.moc"
diff --git a/src/kile/kileactions.h b/src/kile/kileactions.h
new file mode 100644
index 0000000..4ca1888
--- /dev/null
+++ b/src/kile/kileactions.h
@@ -0,0 +1,197 @@
+/***************************************************************************
+ begin : 2003-07-01 17:33:00 CEST 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef KILEACTIONS_H
+#define KILEACTIONS_H
+
+#include <qdict.h>
+
+#include <kaction.h>
+#include <kdialogbase.h>
+#include <klineedit.h>
+
+class QCheckBox;
+class QLineEdit;
+
+class KileInfo;
+
+namespace KileAction
+{
+
+enum { KeepHistory=1, ShowAlternative=2, ShowBrowseButton=4, FromLabelList=8, FromBibItemList=16, ShowLabel=32, AddProjectFile=64};
+/*
+ TagData
+*/
+
+class TagData
+{
+public:
+ TagData(const QString &t, const QString &tB = QString::null, const QString &tE = QString::null, int x = 0, int y = 0, const QString &desc = QString::null)
+ : text(t), tagBegin(tB), tagEnd(tE), dx(x), dy(y), description(desc) {}
+
+ TagData() : text(QString::null), tagBegin(QString::null), tagEnd(QString::null), dx(0), dy(0), description(QString::null) {}
+
+ QString text;
+ QString tagBegin, tagEnd;
+ int dx,dy;
+ QString description;
+};
+
+class Tag : public KAction
+{
+ Q_OBJECT
+
+public:
+ //constructors
+ Tag(const QString &text, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name
+ , const QString &tagBegin, const QString &tagEnd = QString::null, int dx=0, int dy=0, const QString &description = QString::null);
+
+ Tag(const QString &text, const QString& pix, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name
+ , const QString &tagBegin, const QString &tagEnd = QString::null, int dx=0, int dy=0, const QString &description = QString::null);
+
+ Tag(const QString &text, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name
+ , const TagData& data);
+
+ Tag(const QString &text, const QString& pix, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name
+ , const TagData& data);
+
+ ~Tag();
+
+private:
+ void init(const QObject *receiver = 0, const char *slot = 0);
+
+signals:
+ //sends along tagdata so that receiver knows what to insert
+ void activated(const KileAction::TagData&);
+
+private slots:
+ //emits the activated(TagData) signal
+ virtual void emitData();
+
+protected:
+ TagData m_data;
+};
+
+/*
+ InputTag: adds a history list and options for a input dialog to TagData
+*/
+class InputTag : public Tag
+{
+ Q_OBJECT
+
+public:
+ //constructors
+ InputTag(KileInfo* ki, const QString &text, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name, QWidget *wparent,uint options
+ , const QString &tagBegin, const QString &tagEnd = QString::null, int dx=0, int dy=0, const QString &description = QString::null, const QString &hint = QString::null, const QString &alter = QString::null);
+
+ InputTag(KileInfo* ki, const QString &text, const QString& pix, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name, QWidget *wparent,uint options
+ , const QString &tagBegin, const QString &tagEnd = QString::null, int dx=0, int dy=0, const QString &description = QString::null, const QString &hint = QString::null, const QString &alter = QString::null);
+
+ InputTag(KileInfo* ki, const QString &text, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name, QWidget *wparent,uint options
+ , const TagData& data, const QString &hint = QString::null, const QString &alter = QString::null);
+
+ InputTag(KileInfo* ki, const QString &text, const QString& pix, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name, QWidget *wparent,uint options
+ , const TagData& data, const QString &hint = QString::null, const QString &alter = QString::null);
+
+ ~InputTag();
+
+ bool hasHistory() {return (m_options & KeepHistory); }
+ bool hasAlternative() { return (m_options & ShowAlternative); }
+ bool hasBrowseButton() { return (m_options & ShowBrowseButton); }
+
+ void addToHistory(const QString& str) { if ( m_history.first() != str ) m_history.prepend(str); }
+
+private:
+ void init();
+
+private slots:
+ //emits the activated(TagData) signal
+ virtual void emitData();
+
+private:
+ KileInfo *m_ki;
+ QStringList m_history;
+ QWidget *m_parent;
+ uint m_options;
+ QString m_hint;
+ QString m_alter;
+};
+
+
+/*
+ InputDialog
+*/
+class InputDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ InputDialog(const QString &caption, uint options, const QStringList& history, const QString &hint, const QString &alter, KileInfo *ki, QWidget *parent=0, const char *name=0);
+ ~InputDialog();
+
+ bool useAlternative() {return m_useAlternative;}
+ bool useLabel() {return m_useLabel;}
+ bool useAddProjectFile() {return m_useAddProjectFile;}
+
+public slots:
+ void slotBrowse();
+ void slotAltClicked();
+
+ void setTag(const QString&);
+
+signals:
+ void setInput(const QString&);
+
+public:
+ QString tag() { return m_tag; }
+ QString label();
+ bool usedSelection() { return m_usedSelection; }
+
+ KLineEdit *m_edLabel;
+
+private:
+ QString m_tag;
+ QString m_labelprefix;
+ bool m_useAlternative,m_useLabel,m_usedSelection,m_useAddProjectFile;
+ KileInfo *m_ki;
+};
+
+class Select : public KSelectAction
+{
+ Q_OBJECT
+
+public:
+ //constructors
+ Select(const QString &text, const KShortcut &cut, KActionCollection *parent, const char *name);
+
+private:
+ void init();
+
+signals:
+ void activated(const KAction&);
+
+public slots:
+ void setItems(QPtrList<KAction> &);
+
+private slots:
+ void emitData(const QString&);
+
+private:
+ QDict<KAction> m_dict;
+};
+
+}
+
+#endif
+
diff --git a/src/kile/kileappIface.h b/src/kile/kileappIface.h
new file mode 100644
index 0000000..64e1b42
--- /dev/null
+++ b/src/kile/kileappIface.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ begin : sam sep 28 2002
+ copyright : (C) 2002 - 2003 by Pascal Brachet, 2003 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef KILEAPPDCOPIFACE_H
+#define KILEAPPDCOPIFACE_H
+
+#include <dcopobject.h>
+
+class KileAppDCOPIface : virtual public DCOPObject
+{
+ K_DCOP
+
+ k_dcop:
+ virtual void openDocument(const QString &)=0;
+ virtual void insertText(const QString &)=0;
+ virtual void fileSelected(const QString &)=0; //backwards compatibility
+ virtual void closeDocument()=0;
+ virtual void openProject(const QString &)=0;
+ virtual void setLine( const QString &)=0;
+ virtual void setActive()=0;
+ virtual int run(const QString &)=0;
+ virtual int runWith(const QString &, const QString &)=0;
+};
+
+#endif
diff --git a/src/kile/kileapplication.cpp b/src/kile/kileapplication.cpp
new file mode 100644
index 0000000..7764d51
--- /dev/null
+++ b/src/kile/kileapplication.cpp
@@ -0,0 +1,54 @@
+/***************************************************************************
+ begin : Sun Apr 21 2002
+ copyright : (C) 2002 - 2003 by Pascal Brachet, 2003 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kileapplication.h"
+
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include <kate/document.h>
+
+#include <qframe.h>
+#include <qpixmap.h>
+#include <qlabel.h>
+#include <qpainter.h>
+#include <qfont.h>
+#include <qfontmetrics.h>
+
+static QFrame *pix=0;
+static QWidget *splash=0;
+
+
+KileApplication::KileApplication()
+{
+ QRect screen = QApplication::desktop()->screenGeometry();
+ QPixmap pm(KGlobal::dirs()->findResource("appdata","pics/kile_splash.png"));
+ splash = new QWidget( 0, "splash", WDestructiveClose | WStyle_Customize | WStyle_NoBorder | WX11BypassWM | WStyle_StaysOnTop );
+ pix=new QFrame(splash,"pix",QWidget::WStyle_NoBorder | QWidget::WStyle_Customize);
+ pix->setBackgroundPixmap(pm);
+ pix->setLineWidth(0);
+ pix->setGeometry( 0,0,398, 120 );
+ splash->adjustSize();
+ splash->setCaption( "Kile" );
+ splash->move( screen.center() - QPoint( splash->width() / 2, splash->height() / 2 ) );
+ splash->show();
+}
+KileApplication::~KileApplication(){
+}
+
+void KileApplication::closeSplash()
+{
+splash->hide();
+delete splash;
+}
diff --git a/src/kile/kileapplication.h b/src/kile/kileapplication.h
new file mode 100644
index 0000000..1ce2e0d
--- /dev/null
+++ b/src/kile/kileapplication.h
@@ -0,0 +1,33 @@
+/***************************************************************************
+ begin : Sun Apr 21 2002
+ copyright : (C) 2002 - 2003 by Pascal Brachet, 2003 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEAPPLICATION_H
+#define KILEAPPLICATION_H
+
+#include <kapplication.h>
+
+/**
+ *@author Pascal Brachet
+ */
+
+class KileApplication : public KApplication
+{
+public:
+ KileApplication();
+ ~KileApplication();
+ static void closeSplash();
+};
+
+#endif
diff --git a/src/kile/kileconfig.kcfgc b/src/kile/kileconfig.kcfgc
new file mode 100644
index 0000000..2aa5be1
--- /dev/null
+++ b/src/kile/kileconfig.kcfgc
@@ -0,0 +1,4 @@
+File=kile.kcfg
+ClassName=KileConfig
+Singleton=true
+Mutators=true
diff --git a/src/kile/kileconfigdialog.cpp b/src/kile/kileconfigdialog.cpp
new file mode 100644
index 0000000..17ec1ed
--- /dev/null
+++ b/src/kile/kileconfigdialog.cpp
@@ -0,0 +1,357 @@
+/***************************************************************************
+ begin : Wed Jun 6 2001
+ copyright : (C) 2003 by Jeroen Wijnhout
+ (C) 2005-2007 by Holger Danielsson
+ email : Jeroen.Wijnhout@kdemail.net
+ holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// 2005-12-02 dani
+// - put configuration of Kile and Kate together in one dialog
+// - items are shown as a tree list
+// - encoding config page and spelling page are removed,
+// because settings are also avaiblable with Kate
+// - geometry of the dialog are saved and restored, because
+// the initial values may be bad in some languages
+
+// 2007-03-17 dani
+// - add support for auto insert $
+// - move graphics config to a separate page
+
+#include "kileconfigdialog.h"
+
+#include <qvbox.h>
+#include <qlayout.h>
+#include <qtextcodec.h>
+
+#include <kdeversion.h>
+#include <klocale.h>
+#include <ksconfig.h>
+#include <kiconloader.h>
+
+#include "kiletoolmanager.h"
+#include "kiletoolconfigwidget.h"
+#include "kileviewmanager.h"
+#include "helpconfigwidget.h"
+#include "latexconfigwidget.h"
+#include "generalconfigwidget.h"
+#include "previewconfigwidget.h"
+#include "scriptingconfigwidget.h"
+#include "kileconfig.h"
+#include "kileinfo.h"
+#include "kileedit.h"
+
+#include "kiledebug.h"
+
+namespace KileDialog
+{
+ Config::Config(KConfig *config, KileInfo *ki, QWidget* parent)
+ : KDialogBase( KDialogBase::TreeList, Qt::WStyle_DialogBorder,
+ parent, "kileconfiguration", true, i18n("Configure"), Ok|Cancel, Ok ),
+ m_config(config),
+ m_ki(ki)
+ {
+ m_config->sync();
+
+ // we need a dialog manager
+ m_manager = new KConfigDialogManager(this,KileConfig::self());
+
+ setShowIconsInTreeList(true);
+ addConfigFolder(i18n("Kile"),"kile");
+ addConfigFolder(i18n("LaTeX"),"tex");
+ addConfigFolder(i18n("Tools"),"gear");
+ addConfigFolder(i18n("Editor"),"edit");
+
+ // setup all configuration pages
+ setupGeneralOptions();
+ setupCodeCompletion(); // complete configuration (dani)
+ setupHelp();
+ setupScripting();
+
+ setupLatex();
+ setupEnvironment();
+ setupGraphics();
+ setupStructure();
+ setupSymbolView();
+
+ setupTools();
+ setupQuickPreview(); // QuickPreview (dani)
+
+ setupEditor();
+ enableButtonSeparator(true);
+
+ // calculate size for opening
+ if ( ! m_config->hasGroup("KileConfigDialog") )
+ incInitialSize(QSize(50,0));
+ else
+ setInitialSize( configDialogSize("KileConfigDialog") );
+
+ // setup connections
+ //connect(m_manager, SIGNAL(widgetModified()), this, SLOT(slotWidgetModified()));
+ connect(this, SIGNAL(okClicked()), m_manager, SLOT(updateSettings()));
+ }
+
+ Config::~Config()
+ {
+ saveDialogSize("KileConfigDialog");
+ delete m_manager;
+ }
+
+ void Config::show()
+ {
+ if ( KileConfig::unfoldConfigTree() )
+ unfoldTreeList();
+ m_manager->updateWidgets();
+ KDialogBase::show();
+ }
+
+ //////////////////// add a new folder ////////////////////
+
+ void Config::addConfigFolder(const QString &section,const QString &icon)
+ {
+ QStringList path;
+ path << section;
+
+#if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
+ setFolderIcon(path, SmallIcon(icon, KIcon::SizeSmallMedium));
+#else
+ setFolderIcon(path, SmallIcon(icon));
+#endif
+ }
+
+ //////////////////// add a new page ////////////////////
+
+ void Config::addConfigPage(QWidget *page,
+ const QString &sectionName,const QString &itemName,
+ const QString &pixmapName, const QString &header,
+ bool addSpacer)
+ {
+ KILE_DEBUG() << "slot: add config page item=" << itemName << endl;
+
+ // add page
+ QStringList path;
+ path << sectionName << itemName;
+
+ QVBox *vbox = addVBoxPage(path, header,
+#if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
+ SmallIcon(pixmapName,KIcon::SizeSmallMedium)
+#else
+ SmallIcon(pixmapName)
+#endif
+ );
+ vbox->setSpacing(0);
+ vbox->setMargin(0);
+ page->reparent(((QWidget*)vbox),0,QPoint());
+ if ( addSpacer )
+ {
+ QFrame *spacer = new QFrame(vbox);
+ vbox->setStretchFactor(spacer,1);
+ }
+
+ // add to the dialog manager
+ m_manager->addWidget(page);
+ }
+
+ //////////////////// General Options ////////////////////
+
+ void Config::setupGeneralOptions()
+ {
+ generalPage = new KileWidgetGeneralConfig(0, "LaTeX");
+ addConfigPage(generalPage,i18n("Kile"),i18n("General"),"configure",i18n("General Settings"));
+ }
+
+ //////////////////// Tools Configuration ////////////////////
+
+ void Config::setupTools()
+ {
+ toolPage = new KileWidget::ToolConfig(m_ki->toolManager(), 0);
+
+ addConfigPage(toolPage,i18n("Tools"),i18n("Build"),"launch",i18n("Build"),false);
+ }
+
+ //////////////////// Scripting ////////////////////
+
+ void Config::setupScripting()
+ {
+ scriptingPage = new KileWidgetScriptingConfig(this, "Scripting");
+ addConfigPage(scriptingPage,i18n("Kile"),i18n("Scripting"),"exec",i18n("Scripting Support"));
+ }
+
+ //////////////////// LaTeX specific editing options ////////////////////
+
+ //////////////////// Complete configuration (dani) ////////////////////
+
+ void Config::setupCodeCompletion()
+ {
+ completePage = new ConfigCodeCompletion(m_config,m_ki->logWidget());
+ completePage->readConfig();
+
+ addConfigPage(completePage,i18n("Kile"),i18n("Complete"),"source",i18n("Code Completion"));
+ }
+
+ //////////////////// QuickPreview (dani) ////////////////////
+
+ void Config::setupQuickPreview()
+ {
+ previewPage = new KileWidgetPreviewConfig(m_config,m_ki->quickPreview(),0);
+ previewPage->readConfig();
+
+ addConfigPage(previewPage,i18n("Tools"),i18n("Preview"),"preview",i18n("Quick Preview"));
+ }
+
+ void Config::setupHelp()
+ {
+ helpPage = new KileWidgetHelpConfig(0);
+ helpPage->setHelp(m_ki->help());
+
+ addConfigPage(helpPage,i18n("Kile"),i18n("Help"),"help");
+ }
+
+ //////////////////// LaTeX environments ////////////////////
+
+ void Config::setupLatex()
+ {
+ latexPage = new KileWidgetLatexConfig(0, "LaTeX");
+ latexPage->kcfg_DoubleQuotes->insertStringList( m_ki->editorExtension()->doubleQuotesList() );
+ latexPage->setLatexCommands(m_config,m_ki->latexCommands());
+
+ addConfigPage(latexPage,i18n("LaTeX"),i18n("General"),"configure");
+ }
+
+ void Config::setupEnvironment()
+ {
+ envPage = new KileWidgetEnvironmentConfig(0, "LaTeX");
+ addConfigPage(envPage,i18n("LaTeX"),i18n("Environments"),"environment");
+ }
+
+ void Config::setupGraphics()
+ {
+ graphicsPage = new KileWidgetGraphicsConfig(0, "Graphics");
+ graphicsPage->m_lbImagemagick->setText( ( KileConfig::imagemagick() ) ? i18n("installed") : i18n("not installed") );
+
+ addConfigPage(graphicsPage,i18n("LaTeX"),i18n("Graphics"),"graphicspage");
+ }
+
+ void Config::setupStructure()
+ {
+ structurePage = new KileWidgetStructureViewConfig(0, "StructureView");
+ addConfigPage(structurePage,i18n("LaTeX"),i18n("Structure View"),"view_tree");
+ }
+
+ void Config::setupSymbolView()
+ {
+ symbolViewPage = new KileWidgetSymbolViewConfig(0, "SymbolView");
+ addConfigPage(symbolViewPage,i18n("LaTeX"),i18n("Symbol View"),"math0");
+ }
+
+ //////////////////// Editor ////////////////////
+
+ void Config::setupEditor()
+ {
+ Kate::View *view = m_ki->viewManager()->currentTextView();
+ m_editorOpened = ( view != 0L );
+ m_editorSettingsChanged = false;
+
+ if ( ! m_editorOpened )
+ return;
+
+ editorPages.setAutoDelete(false);
+ editorPages.clear();
+
+ KTextEditor::ConfigInterfaceExtension *iface;
+ iface = dynamic_cast<KTextEditor::ConfigInterfaceExtension *>( view->getDoc() );
+
+ QStringList path;
+ for (uint i=0; i<iface->configPages(); i++)
+ {
+ path.clear();
+ path << i18n("Editor") << iface->configPageName(i);
+
+ // create a new vbox page and add the config page
+#if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
+ QVBox *page = addVBoxPage(path,iface->configPageFullName(i), iface->configPagePixmap(i,KIcon::SizeSmallMedium) );
+#else
+ QVBox *page = addVBoxPage(path,iface->configPageFullName(i), iface->configPagePixmap(i) );
+#endif
+ KTextEditor::ConfigPage *configPage = iface->configPage(i,page);
+ connect( configPage, SIGNAL(changed()), this, SLOT(slotChanged()) );
+ editorPages.append(configPage);
+ }
+ }
+
+ //////////////////// encoding ////////////////////
+
+ QString Config::readKateEncoding()
+ {
+ m_config->setGroup("Kate Document Defaults");
+ return m_config->readEntry("Encoding",QString::null);
+ }
+
+ void Config::syncKileEncoding()
+ {
+ QString enc = readKateEncoding();
+ if ( enc.isEmpty() )
+ enc = QString::fromLatin1(QTextCodec::codecForLocale()->name());
+ KileConfig::setDefaultEncoding( enc );
+ }
+ //////////////////// slots ////////////////////
+
+ void Config::slotOk()
+ {
+ KILE_DEBUG() << " slot ok (" << m_manager->hasChanged() << "," << m_editorSettingsChanged << ")" << endl;
+
+ // editor settings are only available, when at least one document is opened
+ if ( m_editorOpened && m_editorSettingsChanged )
+ {
+ for (uint i=0; i<editorPages.count(); i++)
+ editorPages.at(i)->apply();
+ m_ki->viewManager()->currentTextView()->getDoc()->writeConfig();
+
+ // take Kate's encoding for Kile
+ syncKileEncoding();
+ }
+
+ // Kile settings
+ toolPage->writeConfig(); // config all tools
+ completePage->writeConfig(); // Complete configuration (dani)
+ previewPage->writeConfig(); // Quick Preview (dani)
+
+ m_config->sync();
+ emit okClicked(); // Otherwise, the KConfigXT machine doesn't start...
+
+ // oder m_manager->updateSettings();
+ accept();
+ }
+
+ void Config::slotCancel()
+ {
+ KILE_DEBUG() << " slot cancel" << endl;
+ m_config->rollback();
+ accept();
+ }
+
+ void Config::slotChanged()
+ {
+ KILE_DEBUG() << " slot changed" << endl;
+ m_editorSettingsChanged = true;
+ }
+
+/*
+void Config::slotWidgetModified()
+{
+ KILE_DEBUG() << "slot: widget modified --> " << m_manager->hasChanged() << endl;
+ //emit widgetModified();
+}
+*/
+}
+
+#include "kileconfigdialog.moc"
diff --git a/src/kile/kileconfigdialog.h b/src/kile/kileconfigdialog.h
new file mode 100644
index 0000000..a447ecc
--- /dev/null
+++ b/src/kile/kileconfigdialog.h
@@ -0,0 +1,124 @@
+/***************************************************************************
+ begin : Wed Jun 6 2001
+ copyright : (C) 2003 by Jeroen Wijnout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef TOOLSOPTIONSDIALOG_H
+#define TOOLSOPTIONSDIALOG_H
+
+#include <kdialogbase.h>
+#include <kdeversion.h>
+
+#include <ktexteditor/configinterfaceextension.h>
+#include <kconfigdialogmanager.h>
+
+#include "configcodecompletion.h" // code completion (dani)
+#include "previewconfigwidget.h" // QuickPreview (dani)
+#include "envconfigwidget.h" // environments (dani)
+#include "graphicsconfigwidget.h" // graphics (dani)
+#include "structureconfigwidget.h" // structure view (dani)
+#include "symbolviewconfig.h"
+
+class QFrame;
+class KConfig;
+
+namespace KileWidget { class ToolConfig; }
+class KileWidgetHelpConfig;
+class KileWidgetLatexConfig;
+class KileWidgetGeneralConfig;
+class KileWidgetEnvironmentConfig;
+class KileWidgetGraphicsConfig;
+class KileWidgetStructureViewConfig;
+class KileWidgetScriptingConfig;
+
+namespace KileTool { class Manager; }
+
+namespace KileDialog
+{
+ class Config : public KDialogBase
+ {
+ Q_OBJECT
+
+ public:
+ Config( KConfig *config, KileInfo *ki, QWidget* parent = 0);
+ ~Config();
+
+ virtual void show();
+
+ //signals:
+ // void widgetModified();
+
+ private slots:
+ void slotOk();
+ void slotCancel();
+ void slotChanged();
+
+ private:
+ // dialog manager
+ KConfigDialogManager *m_manager;
+
+ KConfig *m_config;
+ KileInfo *m_ki;
+
+ bool m_editorSettingsChanged;
+ bool m_editorOpened;
+
+ KileWidget::ToolConfig *toolPage;
+
+ // CodeCompletion (dani)
+ ConfigCodeCompletion *completePage;
+ KileWidgetPreviewConfig *previewPage;
+
+ KileWidgetHelpConfig *helpPage;
+ KileWidgetLatexConfig *latexPage;
+ KileWidgetGeneralConfig *generalPage;
+ KileWidgetEnvironmentConfig *envPage;
+ KileWidgetGraphicsConfig *graphicsPage;
+ KileWidgetStructureViewConfig *structurePage;
+ KileWidgetSymbolViewConfig *symbolViewPage;
+ KileWidgetScriptingConfig *scriptingPage;
+
+
+ // setup configuration
+ void addConfigFolder(const QString &section,const QString &icon);
+
+ void addConfigPage( QWidget *page,
+ const QString &sectionName,const QString &itemName,
+ const QString &pixmapName, const QString &header=QString::null,
+ bool addSpacer = true );
+
+ void setupGeneralOptions();
+ void setupTools();
+ void setupLatex();
+ void setupCodeCompletion();
+ void setupQuickPreview();
+ void setupHelp();
+ void setupEditor();
+ void setupEnvironment();
+ void setupGraphics();
+ void setupStructure();
+ void setupSymbolView();
+ void setupScripting();
+
+ // write configuration
+ void writeGeneralOptionsConfig();
+
+ // synchronize encoding
+ QString readKateEncoding();
+ void syncKileEncoding();
+
+ // editor pages
+ QPtrList<KTextEditor::ConfigPage> editorPages;
+ };
+}
+#endif
diff --git a/src/kile/kileconstants.h b/src/kile/kileconstants.h
new file mode 100644
index 0000000..85a0fd6
--- /dev/null
+++ b/src/kile/kileconstants.h
@@ -0,0 +1,23 @@
+/**************************************************************************
+* Copyright (C) 2006 by Michel Ludwig (michel.ludwig@kdemail.net) *
+***************************************************************************/
+
+/**************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef KILECONSTANTS_H
+#define KILECONSTANTS_H
+
+namespace KileDocument {
+ enum Type {Undefined, Text, LaTeX, BibTeX, Script};
+
+}
+
+
+#endif
diff --git a/src/kile/kiledebug.h b/src/kile/kiledebug.h
new file mode 100644
index 0000000..b388aca
--- /dev/null
+++ b/src/kile/kiledebug.h
@@ -0,0 +1,21 @@
+/***************************************************************************
+* begin : 26.09.2007
+* copyright : (C) Thomas Braun
+* email : braun _aeht_ physik.fu-berlin.de
+****************************************************************************/
+
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+#include <kdebug.h>
+
+#ifdef NDEBUG
+ #define KILE_DEBUG(A) if (true); else kdDebug()
+#else
+ #define KILE_DEBUG(A) kdDebug(A)
+#endif
diff --git a/src/kile/kiledocmanager.cpp b/src/kile/kiledocmanager.cpp
new file mode 100644
index 0000000..b94b4c4
--- /dev/null
+++ b/src/kile/kiledocmanager.cpp
@@ -0,0 +1,2040 @@
+//
+// C++ Implementation: kiledocmanager
+//
+// Description:
+//
+//
+// Author: Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>, (C) 2004
+// Michel Ludwig <michel.ludwig@kdemail.net>, (C) 2006, 2007
+// Holger Danielsson <holger.danielsson@versanet.de>, (C) 2007
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// 2007-03-12 dani
+// - use KileDocument::Extensions
+
+#include "kiledocmanager.h"
+
+#include <qtextcodec.h>
+#include <qfile.h>
+#include <qdir.h>
+
+#include <kate/document.h>
+#include <kate/view.h>
+#include <kapplication.h>
+#include "kiledebug.h"
+#include <kencodingfiledialog.h>
+#include <klocale.h>
+#include <kmimetype.h>
+#include <kmessagebox.h>
+#include <kprogress.h>
+#include <kfile.h>
+#include <krun.h>
+#include <kstandarddirs.h>
+#include <kio/netaccess.h>
+#include <kpushbutton.h>
+#include <kurl.h>
+#include <kurldrag.h>
+#include <kfileitem.h>
+
+#include "kileeventfilter.h"
+#include "kileuntitled.h"
+#include "templates.h"
+#include "newfilewizard.h"
+#include "managetemplatesdialog.h"
+#include "kileinfo.h"
+#include "kilejscript.h"
+#include "kileproject.h"
+#include "kiledocumentinfo.h"
+#include "kileviewmanager.h"
+#include "kilefileselect.h"
+#include "kileprojectview.h"
+#include "kilestructurewidget.h"
+#include "kileprojectdlgs.h"
+#include "kiletool.h"
+#include "kiletool_enums.h"
+#include "kilestdtools.h"
+#include "kilelistselector.h"
+#include "kiletoolmanager.h"
+#include "kilekonsolewidget.h"
+#include "kileconfig.h"
+#include "kilelogwidget.h"
+#include "cleandialog.h"
+
+/*
+ * Newly created text documents have an empty URL and a non-empty document name.
+ */
+
+namespace KileDocument
+{
+
+Manager::Manager(KileInfo *info, QObject *parent, const char *name) :
+ QObject(parent, name),
+ m_ki(info)
+{
+ m_textInfoList.setAutoDelete(false);
+ m_projects.setAutoDelete(false);
+ Kate::Document::setFileChangedDialogsActivated (true);
+
+ if ( KileConfig::defaultEncoding() == "invalid" )
+ KileConfig::setDefaultEncoding(QString::fromLatin1(QTextCodec::codecForLocale()->name()));
+
+ QWidget *par = m_ki ? m_ki->parentWidget() : 0;
+ m_kpd = new KProgressDialog(par, 0, i18n("Open Project..."), QString::null, true);
+ m_kpd->showCancelButton(false);
+ m_kpd->setLabel(i18n("Scanning project files..."));
+ m_kpd->setAutoClose(true);
+ m_kpd->setMinimumDuration(2000);
+ m_kpd->cancel();
+}
+
+Manager::~Manager()
+{
+ KILE_DEBUG() << "==KileDocument::Manager::~Manager()=========" << endl;
+}
+
+void Manager::trashDoc(TextInfo *docinfo, Kate::Document *doc /*= 0L*/ )
+{
+ KILE_DEBUG() << "==void Manager::trashDoc(" << docinfo->url().path() << ")=====" << endl;
+
+ if ( m_ki->isOpen(docinfo->url()) ) return;
+
+ if ( doc == 0L ) doc = docinfo->getDoc();
+ //look for doc before we detach the docinfo
+ //if we do it the other way around, docFor will always return nil
+ if ( doc == 0L ) doc = docFor(docinfo->url());
+
+ KILE_DEBUG() << "DETACHING " << docinfo << endl;
+ docinfo->detach();
+
+ KILE_DEBUG() << "\tTRASHING " << doc << endl;
+ if ( doc == 0L ) return;
+
+ KILE_DEBUG() << "just checking: docinfo->getDoc() = " << docinfo->getDoc() << endl;
+ KILE_DEBUG() << "just checking: docFor(docinfo->url()) = " << docFor(docinfo->url()) << endl;
+
+ for ( uint i = 0; i < m_textInfoList.count(); ++i )
+ {
+ if ( (m_textInfoList.at(i) != docinfo) && (m_textInfoList.at(i)->getDoc() == doc) )
+ {
+ KMessageBox::information(0, i18n("The internal structure of Kile is corrupted (probably due to a bug in Kile). Please select Save All from the File menu and close Kile.\nThe Kile team apologizes for any inconvenience and would appreciate a bug report."));
+ kdWarning() << "docinfo " << m_textInfoList.at(i) << " url " << m_textInfoList.at(i)->url().fileName() << " has a wild pointer!!!"<< endl;
+ }
+ }
+
+ KILE_DEBUG() << "DELETING doc" << endl;
+ delete doc;
+}
+
+// update all Info's with changed user commands
+void Manager::updateInfos()
+{
+ for (uint i=0; i < m_textInfoList.count(); ++i)
+ {
+ m_textInfoList.at(i)->updateStructLevelInfo();
+ }
+}
+
+Kate::Document* Manager::docFor(const KURL & url)
+{
+ for (uint i=0; i < m_textInfoList.count(); ++i)
+ {
+ if ( m_ki->similarOrEqualURL(m_textInfoList.at(i)->url(),url) )
+ {
+ return m_textInfoList.at(i)->getDoc();
+ }
+ }
+
+ return 0L;
+}
+
+Info* Manager::getInfo() const
+{
+ Kate::Document *doc = m_ki->activeTextDocument();
+ if ( doc != 0L )
+ return textInfoFor(doc);
+ else
+ return 0L;
+}
+
+TextInfo* Manager::textInfoFor(const QString & path) const
+{
+ if( path.isEmpty() )
+ return 0L;
+
+ KILE_DEBUG() << "==KileInfo::textInfoFor(" << path << ")==========================" << endl;
+ QPtrListIterator<TextInfo> it(m_textInfoList);
+ while ( true )
+ {
+ if ( it.current()->url().path() == path)
+ return it.current();
+
+ if (it.atLast()) break;
+
+ ++it;
+ }
+
+ KILE_DEBUG() << "\tCOULD NOT find info for " << path << endl;
+ return 0L;
+}
+
+TextInfo* Manager::textInfoForURL(const KURL& url)
+{
+ if( url.isEmpty() )
+ return 0L;
+
+ KILE_DEBUG() << "==KileInfo::textInfoFor(" << url << ")==========================" << endl;
+ QPtrListIterator<TextInfo> it(m_textInfoList);
+ TextInfo *info;
+ while ( (info = it.current()) != 0L )
+ {
+ if ( info->url() == url)
+ {
+ return info;
+ }
+ ++it;
+ }
+
+ KILE_DEBUG() << "\tCOULD NOT find info for " << url << endl;
+ return 0L;
+}
+
+TextInfo* Manager::textInfoFor(Kate::Document* doc) const
+{
+ if( !doc )
+ return 0L;
+
+ QPtrListIterator<TextInfo> it(m_textInfoList);
+ while ( true )
+ {
+ if ( it.current()->getDoc() == doc)
+ return it.current();
+
+ if (it.atLast()) return 0L;
+
+ ++it;
+ }
+
+ return 0;
+}
+
+void Manager::mapItem(TextInfo *docinfo, KileProjectItem *item)
+{
+ item->setInfo(docinfo);
+}
+
+KileProject* Manager::projectFor(const KURL &projecturl)
+{
+ KileProject *project = 0;
+
+ //find project with url = projecturl
+ QPtrListIterator<KileProject> it(m_projects);
+ while ( it.current() )
+ {
+ if ((*it)->url() == projecturl)
+ {
+ return *it;
+ }
+ ++it;
+ }
+
+ return project;
+}
+
+KileProject* Manager::projectFor(const QString &name)
+{
+ KileProject *project = 0;
+
+ //find project with url = projecturl
+ QPtrListIterator<KileProject> it(m_projects);
+ while ( it.current() )
+ {
+ if ((*it)->name() == name)
+ {
+ return *it;
+ }
+ ++it;
+ }
+
+ return project;
+}
+
+KileProjectItem* Manager::itemFor(const KURL &url, KileProject *project /*=0L*/) const
+{
+ if (project == 0L)
+ {
+ QPtrListIterator<KileProject> it(m_projects);
+ while ( it.current() )
+ {
+ KILE_DEBUG() << "looking in project " << (*it)->name() << endl;
+ if ((*it)->contains(url))
+ {
+ KILE_DEBUG() << "\t\tfound!" << endl;
+ return (*it)->item(url);
+ }
+ ++it;
+ }
+ KILE_DEBUG() << "\t nothing found" << endl;
+ }
+ else
+ {
+ if ( project->contains(url) )
+ return project->item(url);
+ }
+
+ return 0L;
+}
+
+KileProjectItem* Manager::itemFor(Info *docinfo, KileProject *project /*=0*/) const
+{
+ if(docinfo)
+ return itemFor(docinfo->url(), project);
+ else
+ return 0L;
+}
+
+KileProjectItemList* Manager::itemsFor(Info *docinfo) const
+{
+ if ( docinfo == 0 ) return 0L;
+
+ KILE_DEBUG() << "==KileInfo::itemsFor(" << docinfo->url().fileName() << ")============" << endl;
+ KileProjectItemList *list = new KileProjectItemList();
+ list->setAutoDelete(false);
+
+ QPtrListIterator<KileProject> it(m_projects);
+ while ( it.current() )
+ {
+ KILE_DEBUG() << "\tproject: " << (*it)->name() << endl;
+ if ((*it)->contains(docinfo))
+ {
+ KILE_DEBUG() << "\t\tcontains" << endl;
+ list->append((*it)->item(docinfo));
+ }
+ ++it;
+ }
+
+ return list;
+}
+
+bool Manager::isProjectOpen()
+{
+ return ( m_projects.count() > 0 );
+}
+
+KileProject* Manager::activeProject()
+{
+ KileProject *curpr=0;
+ Kate::Document *doc = m_ki->activeTextDocument();
+
+ if (doc)
+ {
+ for (uint i=0; i < m_projects.count(); ++i)
+ {
+ if (m_projects.at(i)->contains(doc->url()) )
+ {
+ curpr = m_projects.at(i);
+ break;
+ }
+ }
+ }
+
+ return curpr;
+}
+
+KileProjectItem* Manager::activeProjectItem()
+{
+ KileProject *curpr = activeProject();
+ Kate::Document *doc = m_ki->activeTextDocument();
+ KileProjectItem *item = 0;
+
+ if (curpr && doc)
+ {
+ KileProjectItemList *list = curpr->items();
+
+ for (uint i=0; i < list->count(); ++i)
+ {
+ if (list->at(i)->url() == doc->url())
+ {
+ item = list->at(i);
+ break;
+ }
+ }
+ }
+
+ return item;
+}
+
+TextInfo* Manager::createTextDocumentInfo(KileDocument::Type type, const KURL & url, const KURL& baseDirectory)
+{
+ TextInfo *docinfo = 0L;
+
+ //see if this file belongs to an opened project
+ KileProjectItem *item = itemFor(url);
+ if ( item != 0L ) docinfo = item->getInfo();
+
+ if ( docinfo == 0L )
+ {
+ switch(type)
+ {
+ case Undefined: // fall through
+ case Text:
+ KILE_DEBUG() << "CREATING TextInfo for " << url.url() << endl;
+ docinfo = new TextInfo(0L,m_ki->extensions());
+ break;
+ case LaTeX:
+ KILE_DEBUG() << "CREATING LaTeXInfo for " << url.url() << endl;
+ docinfo = new LaTeXInfo(0L, m_ki->extensions(), m_ki->latexCommands(), m_ki->eventFilter());
+ break;
+ case BibTeX:
+ KILE_DEBUG() << "CREATING BibInfo for " << url.url() << endl;
+ docinfo = new BibInfo(0L, m_ki->extensions(), m_ki->latexCommands());
+ break;
+ case Script:
+ KILE_DEBUG() << "CREATING ScriptInfo for " << url.url() << endl;
+ docinfo = new ScriptInfo(0L, m_ki->extensions());
+ break;
+ }
+ docinfo->setBaseDirectory(baseDirectory);
+ emit(documentInfoCreated(docinfo));
+ m_textInfoList.append(docinfo);
+ }
+
+ KILE_DEBUG() << "DOCINFO: returning " << docinfo << " " << docinfo->url().fileName() << endl;
+ return docinfo;
+}
+
+void Manager::recreateTextDocumentInfo(TextInfo *oldinfo)
+{
+ KileProjectItemList *list = itemsFor(oldinfo);
+ KURL url = oldinfo->url();
+ TextInfo *newinfo = createTextDocumentInfo(m_ki->extensions()->determineDocumentType(url), url, oldinfo->getBaseDirectory());
+
+ newinfo->setDoc(oldinfo->getDoc());
+
+ KileProjectItem *pritem = 0L;
+ for ( pritem = list->first(); pritem; pritem = list->next() )
+ {
+ pritem->setInfo(newinfo);
+ }
+ removeTextDocumentInfo(oldinfo);
+
+ emit(updateStructure(true, newinfo));
+}
+
+bool Manager::removeTextDocumentInfo(TextInfo *docinfo, bool closingproject /* = false */)
+{
+ KILE_DEBUG() << "==Manager::removeTextDocumentInfo(Info *docinfo)=====" << endl;
+ KileProjectItemList *itms = itemsFor(docinfo);
+ bool oneItem = false;
+ if (itms->count() == 1)
+ oneItem = true;
+
+ if (itms->count() == 0 || ( closingproject && oneItem ))
+ {
+ KILE_DEBUG() << "\tremoving " << docinfo << " count = " << m_textInfoList.count() << endl;
+ m_textInfoList.remove(docinfo);
+
+ emit ( closingDocument ( docinfo ) );
+
+ cleanupDocumentInfoForProjectItems(docinfo);
+ delete docinfo;
+ delete itms;
+
+ return true;
+ }
+
+ KILE_DEBUG() << "\tnot removing " << docinfo << endl;
+ delete itms;
+ return false;
+}
+
+Kate::Document* Manager::createDocument(const QString& name, const KURL& url, TextInfo *docinfo, const QString & encoding, const QString & highlight)
+{
+ KILE_DEBUG() << "==Kate::Document* Manager::createDocument()===========" << endl;
+
+ Kate::Document *doc = (Kate::Document*) KTextEditor::createDocument ("libkatepart", this, "Kate::Document");
+ if ( docFor(url) != 0L )
+ kdWarning() << url << " already has a document!" << endl;
+ else
+ KILE_DEBUG() << "\tappending document " << doc << endl;
+
+ //set the default encoding
+ QString enc = encoding.isNull() ? KileConfig::defaultEncoding() : encoding;
+ doc->setEncoding(enc);
+
+ KILE_DEBUG() << "url is = " << docinfo->url() << endl;
+
+ if(!url.isEmpty())
+ {
+ bool r = doc->openURL(url);
+ // don't add scripts to the recent files
+ if(r && docinfo->getType() != Script)
+ {
+ emit(addToRecentFiles(url));
+ }
+ }
+ doc->setDocName(name.isEmpty() ? url.fileName() : name);
+
+ //handle changes of the document
+ connect(doc, SIGNAL(nameChanged(Kate::Document *)), m_ki->parentWidget(), SLOT(newCaption()));
+ connect(doc, SIGNAL(fileNameChanged()), m_ki->parentWidget(), SLOT(newCaption()));
+ connect(doc, SIGNAL(modStateChanged(Kate::Document*)), this, SLOT(newDocumentStatus(Kate::Document*)));
+ connect(doc, SIGNAL(modifiedOnDisc(Kate::Document*, bool, unsigned char)), this, SIGNAL(documentStatusChanged(Kate::Document*, bool, unsigned char)));
+
+ docinfo->setDoc(doc);
+ docinfo->setHighlightMode(highlight);
+ // FIXME: the whole structure updating stuff needs to be rewritten; updates should originate from
+ // the docinfo only, i.e. the structure view should just react to changes!
+ connect(docinfo, SIGNAL(completed(KileDocument::Info*)), m_ki->structureWidget(), SLOT(update(KileDocument::Info*)));
+
+ KILE_DEBUG() << "createDocument: url " << doc->url() << " name " << doc->docName() << endl;
+ KILE_DEBUG() << "createDocument: SANITY check: " << (docinfo->getDoc() == docFor(docinfo->url())) << endl;
+ return doc;
+}
+
+Kate::View* Manager::loadItem(KileDocument::Type type, KileProjectItem *item, const QString & text, bool openProjectItemViews)
+{
+ Kate::View *view = 0L;
+
+ KILE_DEBUG() << "==loadItem(" << item->url().path() << ")======" << endl;
+
+ if ( item->type() != KileProjectItem::Image )
+ {
+ view = loadText(type, QString::null, item->url(), item->encoding(), openProjectItemViews && item->isOpen(), item->highlight(), text);
+ KILE_DEBUG() << "\tloadItem: docfor = " << docFor(item->url().path()) << endl;
+
+ TextInfo *docinfo = textInfoFor(item->url().path());
+ item->setInfo(docinfo);
+
+ KILE_DEBUG() << "\tloadItem: docinfo = " << docinfo << " doc = " << docinfo->getDoc() << " docfor = " << docFor(docinfo->url().path()) << endl;
+ if ( docinfo->getDoc() != docFor(docinfo->url().path()) ) kdWarning() << "docinfo->getDoc() != docFor()" << endl;
+ }
+ else
+ {
+ KILE_DEBUG() << "\tloadItem: no document generated" << endl;
+ TextInfo *docinfo = createTextDocumentInfo(m_ki->extensions()->determineDocumentType(item->url()), item->url());
+ item->setInfo(docinfo);
+
+ if ( docFor(item->url()) == 0L)
+ {
+ docinfo->detach();
+ KILE_DEBUG() << "\t\t\tdetached" << endl;
+ }
+ }
+
+ return view;
+}
+
+Kate::View* Manager::loadText(KileDocument::Type type, const QString& name, const KURL &url , const QString & encoding /* = QString::null */, bool create /* = true */, const QString & highlight /* = QString::null */, const QString & text /* = QString::null */, int index /* = - 1 */, const KURL& baseDirectory /* = KURL() */)
+{
+ KILE_DEBUG() << "==loadText(" << url.url() << ")=================" << endl;
+ //if doc already opened, update the structure view and return the view
+ if ( !url.isEmpty() && m_ki->isOpen(url))
+ return m_ki->viewManager()->switchToTextView(url);
+
+ TextInfo *docinfo = createTextDocumentInfo(type, url, baseDirectory);
+ Kate::Document *doc = createDocument(name, url, docinfo, encoding, highlight);
+
+ m_ki->structureWidget()->clean(docinfo);
+ docinfo->updateStruct();
+
+ if ( !text.isNull() ) doc->setText(text);
+
+ //FIXME: use signal/slot
+ if (doc && create)
+ return m_ki->viewManager()->createTextView(docinfo, index);
+
+ KILE_DEBUG() << "just after createView()" << endl;
+ KILE_DEBUG() << "\tdocinfo = " << docinfo << " doc = " << docinfo->getDoc() << " docfor = " << docFor(docinfo->url().path()) << endl;
+
+ return 0L;
+}
+
+//FIXME: template stuff should be in own class
+Kate::View* Manager::loadTemplate(TemplateItem *sel)
+{
+ QString text = QString::null;
+
+ if (sel && sel->name() != DEFAULT_EMPTY_CAPTION && sel->name() != DEFAULT_EMPTY_LATEX_CAPTION && sel->name() != DEFAULT_EMPTY_BIBTEX_CAPTION)
+ {
+ //create a new document to open the template in
+ Kate::Document *tempdoc = (Kate::Document*) KTextEditor::createDocument ("libkatepart", this, "Kate::Document");
+
+ if (!tempdoc->openURL(KURL(sel->path())))
+ {
+ KMessageBox::error(m_ki->parentWidget(), i18n("Could not find template: %1").arg(sel->name()),i18n("File Not Found"));
+ }
+ else
+ {
+ //substitute templates variables
+ text = tempdoc->text();
+ delete tempdoc;
+ replaceTemplateVariables(text);
+ }
+ }
+
+ KileDocument::Type type = sel ? sel->type() : KileDocument::Undefined;
+ //always set the base directory for scripts
+ return createDocumentWithText(text, type, QString(), (type == KileDocument::Script ? m_ki->scriptManager()->getLocalJScriptDirectory() : QString()));
+}
+
+Kate::View* Manager::createDocumentWithText(const QString& text, KileDocument::Type type /* = KileDocument::Undefined */, const QString& extension, const KURL& baseDirectory)
+{
+ Kate::View *view = loadText(type, KileUntitled::next() + (extension.isEmpty() ? QString::null : '.' + extension), KURL(), QString::null, true, QString::null, text, -1, baseDirectory);
+ if (view)
+ {
+ //FIXME this shouldn't be necessary!!!
+ view->getDoc()->setModified(true);
+ newDocumentStatus(view->getDoc());
+ }
+
+ return view;
+}
+
+Kate::View* Manager::createNewJScript()
+{
+ Kate::View *view = createDocumentWithText(QString::null, Script, "js", m_ki->scriptManager()->getLocalJScriptDirectory());
+ emit(updateStructure(false, 0L));
+ emit(updateModeStatus());
+ return view;
+}
+
+Kate::View* Manager::createNewLaTeXDocument()
+{
+ Kate::View *view = createDocumentWithText(QString::null, LaTeX);
+ emit(updateStructure(false, 0L));
+ emit(updateModeStatus());
+ return view;
+}
+
+void Manager::replaceTemplateVariables(QString &line)
+{
+ line=line.replace("$$AUTHOR$$", KileConfig::author());
+ line=line.replace("$$DOCUMENTCLASSOPTIONS$$", KileConfig::documentClassOptions());
+ if (!KileConfig::templateEncoding().isEmpty()) { line=line.replace("$$INPUTENCODING$$", "\\usepackage["+ KileConfig::templateEncoding() +"]{inputenc}");}
+ else { line = line.replace("$$INPUTENCODING$$","");}
+}
+
+void Manager::createTemplate()
+{
+ Kate::View *view = m_ki->viewManager()->currentTextView();
+ if (view)
+ {
+ if (view->getDoc()->isModified() )
+ {
+ KMessageBox::information(m_ki->parentWidget(),i18n("Please save the file first."));
+ return;
+ }
+ }
+ else
+ {
+ KMessageBox::information(m_ki->parentWidget(),i18n("Open/create a document first."));
+ return;
+ }
+
+ KURL url = view->getDoc()->url();
+ KileDocument::Type type = m_ki->extensions()->determineDocumentType(url);
+
+ if(type == KileDocument::Undefined || type == KileDocument::Text)
+ {
+ KMessageBox::information(m_ki->parentWidget(),i18n("Sorry, but a template for this type of document cannot be created."));
+ return;
+ }
+
+ ManageTemplatesDialog mtd(m_ki->templateManager(), url, i18n("Create Template From Document"));
+ mtd.exec();
+}
+
+void Manager::removeTemplate()
+{
+ ManageTemplatesDialog mtd(m_ki->templateManager(), i18n("Remove Template"));
+ mtd.exec();
+}
+
+void Manager::fileNew()
+{
+ NewFileWizard *nfw = new NewFileWizard(m_ki->templateManager(), m_ki->parentWidget());
+ if (nfw->exec())
+ {
+ loadTemplate(nfw->getSelection());
+ if ( nfw->useWizard() ) emit ( startWizard() );
+ emit(updateStructure(false, 0L));
+ emit(updateModeStatus());
+ }
+ delete nfw;
+}
+
+void Manager::fileNew(const KURL & url)
+{
+ //create an empty file
+ QFile file(url.path());
+ file.open(IO_ReadWrite);
+ file.close();
+
+ fileOpen(url, QString::null);
+}
+
+void Manager::fileOpen()
+{
+ //determine the starting dir for the file dialog
+ QString compileName = m_ki->getCompileName();
+ QString currentDir;
+ if ( QFileInfo(compileName).exists() )
+ currentDir = QFileInfo(compileName).dirPath(true);
+ else
+ currentDir = m_ki->fileSelector()->dirOperator()->url().path();
+
+ // use a filter for fileOpen dialog
+ Extensions *extensions = m_ki->extensions();
+ QString filter = extensions->latexDocumentFileFilter() + '\n'
+ + extensions->latexPackageFileFilter() + '\n'
+ + extensions->bibtexFileFilter() + '\n'
+ + extensions->metapostFileFilter() + '\n'
+ + "*|" + i18n("All Files");
+
+ //get the URLs
+ KEncodingFileDialog::Result result = KEncodingFileDialog::getOpenURLsAndEncoding( KileConfig::defaultEncoding(), currentDir, filter, m_ki->parentWidget(), i18n("Open Files") );
+
+ //open them
+ KURL::List urls = result.URLs;
+ for (KURL::List::Iterator i=urls.begin(); i != urls.end(); ++i)
+ fileOpen(*i, result.encoding);
+}
+
+void Manager::fileSelected(const KFileItem *file)
+{
+ fileSelected(file->url());
+ m_ki->fileSelector()->dirOperator()->view()->setSelected(file,false);
+}
+
+void Manager::fileSelected(const KileProjectItem * item)
+{
+ fileOpen(item->url(), item->encoding());
+}
+
+void Manager::fileSelected(const KURL & url)
+{
+ fileOpen(url, m_ki->fileSelector()->comboEncoding()->lineEdit()->text());
+}
+
+void Manager::saveURL(const KURL & url)
+{
+ Kate::Document *doc = docFor(url);
+ if (doc) doc->save();
+}
+
+void Manager::newDocumentStatus(Kate::Document *doc)
+{
+ KILE_DEBUG() << "void Manager::newDocumentStatus(Kate::Document)" << endl;
+ if (doc == 0L) return;
+
+ //sync terminal
+ m_ki->texKonsole()->sync();
+
+ emit(documentStatusChanged(doc, doc->isModified(), 0));
+
+ //updatestructure if active document changed from modified to unmodified (typically after a save)
+ if (!doc->isModified())
+ emit(updateStructure(true, textInfoFor(doc)));
+}
+
+void Manager::fileSaveAll(bool amAutoSaving, bool disUntitled )
+{
+ Kate::View *view= 0L;
+ QFileInfo fi;
+ int saveResult = Kate::View::SAVE_ERROR;
+ KURL url, backupUrl;
+
+ KILE_DEBUG() << "===Kile::fileSaveAll(amAutoSaving = " << amAutoSaving << ",disUntitled = " << disUntitled <<")" << endl;
+
+ for (uint i = 0; i < m_ki->viewManager()->textViews().count(); ++i)
+ {
+ view = m_ki->viewManager()->textView(i);
+
+ if ( view && view->getDoc()->isModified() )
+ {
+ url = view->getDoc()->url();
+ fi.setFile(url.path());
+
+ if ( ( !amAutoSaving && !(disUntitled && url.isEmpty() ) ) // DisregardUntitled is true and we have an untitled doc and don't autosave
+ || ( amAutoSaving && !url.isEmpty() ) //don't save untitled documents when autosaving
+ || ( !amAutoSaving && !disUntitled ) // both false, so we want to save everything
+ )
+ {
+
+ KILE_DEBUG() << "The files _" << autosaveWarnings.join(", ") << "_ have autosaveWarnings" <<endl;
+
+ if ( amAutoSaving)
+ {
+ if( !fi.isWritable() )
+ {
+ if ( autosaveWarnings.contains(url.path()) )
+ {
+ KILE_DEBUG() << "File " << url.prettyURL() << " is not writeable (again), trying next file" << endl;
+ continue;
+ }
+ else
+ {
+ autosaveWarnings.append(url.path());
+ KILE_DEBUG() << "File " << url.prettyURL() << " is not writeable (first time)" << endl;
+ }
+ }
+ else
+ {
+ autosaveWarnings.remove(url.path());
+ }
+ }
+ if (amAutoSaving && fi.size() > 0) // the size check ensures that we don't save empty files (to prevent something like #125809 in the future).
+ {
+ KURL backupUrl = KURL::fromPathOrURL(url.path()+ ".backup");
+
+ // patch for secure permissions, slightly modified for kile by Thomas Braun, taken from #103331
+
+ // get the right permissions, start with safe default
+ mode_t perms = 0600;
+ KIO::UDSEntry fentry;
+ if (KIO::NetAccess::stat (url, fentry, kapp->mainWidget()))
+ {
+ KILE_DEBUG () << "stating successful: " << url.prettyURL() << endl;
+ KFileItem item (fentry, url);
+ perms = item.permissions();
+ }
+
+ // first del existing file if any, than copy over the file we have
+ // failure if a: the existing file could not be deleted, b: the file could not be copied
+ if ( (!KIO::NetAccess::exists( backupUrl, false, kapp->mainWidget() )
+ || KIO::NetAccess::del( backupUrl, kapp->mainWidget() ) )
+ && KIO::NetAccess::file_copy( url, backupUrl, perms, true, false, kapp->mainWidget() ) )
+ {
+ KILE_DEBUG()<<"backing up successful ("<<url.prettyURL()<<" -> "<<backupUrl.prettyURL()<<")"<<endl;
+ }
+ else
+ {
+ KILE_DEBUG()<<"backing up failed ("<<url.prettyURL()<<" -> "<<backupUrl.prettyURL()<<")"<<endl;
+ emit printMsg(KileTool::Error,i18n("The file %1 could not be saved, check the permissions and the free disk space!").arg(backupUrl.prettyURL()),i18n("Autosave"));
+ }
+ }
+
+ KILE_DEBUG() << "trying to save: " << url.path() << endl;
+ saveResult = view->save();
+ fi.refresh();
+
+ if(saveResult == Kate::View::SAVE_ERROR && fi.size() == 0 && !url.isEmpty()) // we probably hit bug #125809, inform the user of the possible consequences
+ emit printMsg(KileTool::Error,i18n("Kile encountered problems while saving the file %1. Do you have enough free disk space left?").arg(url.url()),i18n("Saving"));
+ }
+ }
+ }
+ /*
+ This may look superfluos but actually it is not, in the case of multiple modified docs it ensures that the structure view keeps synchronized with the currentTextView
+ And if we only have one masterdoc or none nothing goes wrong.
+ */
+ emit(updateStructure(false,NULL));
+}
+
+void Manager::fileOpen(const KURL & url, const QString & encoding, int index)
+{
+ KILE_DEBUG() << "==Kile::fileOpen==========================" << endl;
+
+ //don't want to receive signals from the fileselector since
+ //that would allow the user to open a single file twice by double-clicking on it
+ m_ki->fileSelector()->blockSignals(true);
+
+ KILE_DEBUG() << "url is " << url.url() << endl;
+ const KURL realurl = symlinkFreeURL(url);
+ KILE_DEBUG() << "symlink free url is " << realurl.url() << endl;
+
+ bool isopen = m_ki->isOpen(realurl);
+
+ Kate::View *view = loadText(m_ki->extensions()->determineDocumentType(realurl), QString::null, realurl, encoding, true, QString::null, QString::null, index);
+ KileProjectItem *item = itemFor(realurl);
+
+ if(!isopen)
+ {
+ if(!item)
+ emit addToProjectView(realurl);
+ else if(view)
+ view->setCursorPosition(item->lineNumber(),item->columnNumber());
+ }
+
+ emit(updateStructure(true, 0L));
+ emit(updateModeStatus());
+ // update undefined references in this file
+ emit(updateReferences(textInfoFor(realurl.path())) );
+ m_ki->fileSelector()->blockSignals(false);
+}
+
+void Manager::fileSave()
+{
+ Kate::View* view = m_ki->viewManager()->currentTextView();
+ if(!view)
+ {
+ return;
+ }
+ KURL url = view->getDoc()->url();
+ if(url.isEmpty()) // newly created document
+ {
+ fileSaveAs();
+ return;
+ }
+ else
+ {
+ view->save();
+ }
+}
+
+void Manager::fileSaveAs(Kate::View* view)
+{
+
+ if(!view)
+ view = m_ki->viewManager()->currentTextView();
+ if(!view)
+ return;
+
+ Kate::Document* doc = view->getDoc();
+ Q_ASSERT(doc);
+ KileDocument::TextInfo* info = textInfoFor(doc);
+ Q_ASSERT(info);
+ KURL startURL = info->url();
+ KURL oldURL = startURL;
+ if(startURL.isEmpty())
+ {
+ if((info->getBaseDirectory()).isEmpty())
+ {
+ startURL = ":KILE_LATEX_SAVE_DIR";
+ }
+ else
+ {
+ startURL = info->getBaseDirectory();
+ startURL.setFileName(doc->docName());
+ }
+ }
+
+ KILE_DEBUG() << "startURL is " << startURL.path() << endl;
+
+ KEncodingFileDialog::Result result;
+ KURL saveURL;
+ while(true)
+ {
+ QString filter = info->getFileFilter() + "\n* |" + i18n("All Files");
+ result = KEncodingFileDialog::getSaveURLAndEncoding(KileConfig::defaultEncoding(), startURL.url(), filter, m_ki->parentWidget(), i18n("Save File"));
+ if(result.URLs.isEmpty() || result.URLs.first().isEmpty())
+ {
+ return;
+ }
+ saveURL = result.URLs.first();
+ if(info->getType() == KileDocument::LaTeX) {
+ saveURL = Info::makeValidTeXURL(saveURL, m_ki->extensions()->isTexFile(saveURL), false); // don't check for file existence
+ }
+ if(KIO::NetAccess::exists(saveURL, true, kapp->mainWidget())) // check for writing possibility
+ {
+ int r = KMessageBox::warningContinueCancel(m_ki->parentWidget(), i18n("A file with the name \"%1\" exists already. Do you want to overwrite it ?").arg(saveURL.fileName()), i18n("Overwrite File ?"), KGuiItem(i18n("&Overwrite")), QString::null);
+ if(r != KMessageBox::Continue)
+ {
+ continue;
+ }
+ }
+ break;
+ }
+ doc->setEncoding(result.encoding);
+ if(!doc->saveAs(saveURL))
+ {
+ return;
+ }
+ if(oldURL != saveURL)
+ {
+ if(info->isDocumentTypePromotionAllowed())
+ {
+ recreateTextDocumentInfo(info);
+ info = textInfoFor(doc);
+ }
+ m_ki->structureWidget()->updateUrl(info);
+ emit addToRecentFiles(saveURL);
+ emit addToProjectView(doc->url());
+ }
+}
+
+void Manager::fileSaveCopyAs()
+{
+ Kate::Document *doc= m_ki->activeTextDocument();
+ Kate::View *view = 0L;
+ if(doc)
+ {
+ KileDocument::TextInfo *originalInfo = textInfoFor(doc);
+
+ if(!originalInfo)
+ return;
+
+ view = createDocumentWithText(doc->text(),originalInfo->getType());
+
+ KileDocument::TextInfo *newInfo = textInfoFor(view->getDoc());
+
+ if(originalInfo->url().isEmpty()) // untitled doc
+ newInfo->setBaseDirectory(m_ki->fileSelector()->dirOperator()->url().path());
+ else
+ newInfo->setBaseDirectory(originalInfo->url().path());
+
+ fileSaveAs(view);
+
+ doc = view->getDoc();
+ if(doc && !doc->isModified()) // fileSaveAs was successful
+ fileClose(doc);
+ }
+}
+
+bool Manager::fileCloseAllOthers()
+{
+ Kate::View * currentview = m_ki->viewManager()->currentTextView();
+ while ( m_ki->viewManager()->textViews().count() > 1 )
+ {
+ Kate::View *view = m_ki->viewManager()->textViews().first();
+ if ( view == currentview )
+ view = m_ki->viewManager()->textViews().next();
+ if ( ! fileClose(view->getDoc()) )
+ return false;
+ }
+
+ return true;
+}
+
+bool Manager::fileCloseAll()
+{
+ Kate::View * view = m_ki->viewManager()->currentTextView();
+
+ //assumes one view per doc here
+ while( ! m_ki->viewManager()->textViews().isEmpty() )
+ {
+ view = m_ki->viewManager()->textView(0);
+ if (! fileClose(view->getDoc())) return false;
+ }
+
+ return true;
+}
+
+bool Manager::fileClose(const KURL & url)
+{
+ Kate::Document *doc = docFor(url);
+ if ( doc == 0L )
+ return true;
+ else
+ return fileClose(doc);
+}
+
+bool Manager::fileClose(Kate::Document *doc /* = 0L*/, bool closingproject /*= false*/)
+{
+ KILE_DEBUG() << "==Kile::fileClose==========================" << endl;
+
+ if (doc == 0L)
+ doc = m_ki->activeTextDocument();
+
+ if (doc == 0L)
+ return true;
+ else
+ //FIXME: remove from docinfo map, remove from dirwatch
+ {
+ KILE_DEBUG() << "doc->url().path()=" << doc->url().path() << endl;
+
+ const KURL url = doc->url();
+
+ TextInfo *docinfo= textInfoFor(doc);
+ if (docinfo == 0L)
+ {
+ kdWarning() << "no DOCINFO for " << url.url() << endl;
+ return true;
+ }
+ KileProjectItemList *items = itemsFor(docinfo);
+
+ while ( items->current() )
+ {
+ //FIXME: refactor here
+ if (items->current() && doc) storeProjectItem(items->current(),doc);
+ items->next();
+ }
+
+ delete items;
+
+ if ( doc->closeURL() )
+ {
+ // docinfo may have been recreated from 'Untitled' doc to a named doc
+ if ( url.isEmpty() )
+ docinfo= textInfoFor(doc);
+
+ if ( KileConfig::cleanUpAfterClose() )
+ cleanUpTempFiles(url, true); // yes we pass here url and not docinfo->url()
+
+ //FIXME: use signal/slot
+ m_ki->viewManager()->removeView(static_cast<Kate::View*>(doc->views().first()));
+ //remove the decorations
+
+ trashDoc(docinfo, doc);
+ m_ki->structureWidget()->clean(docinfo);
+ removeTextDocumentInfo(docinfo, closingproject);
+
+ emit removeFromProjectView(url);
+ emit updateModeStatus();
+ }
+ else
+ return false;
+ }
+
+ return true;
+}
+
+void Manager::buildProjectTree(const KURL & url)
+{
+ KileProject * project = projectFor(url);
+
+ if (project)
+ buildProjectTree(project);
+}
+
+void Manager::buildProjectTree(KileProject *project)
+{
+ if (project == 0)
+ project = activeProject();
+
+ if (project == 0 )
+ project = selectProject(i18n("Refresh Project Tree"));
+
+ if (project)
+ {
+ //TODO: update structure for all docs
+ project->buildProjectTree();
+ }
+ else if (m_projects.count() == 0)
+ KMessageBox::error(m_ki->parentWidget(), i18n("The current document is not associated to a project. Please activate a document that is associated to the project you want to build the tree for, then choose Refresh Project Tree again."),i18n( "Could Not Refresh Project Tree"));
+}
+
+void Manager::projectNew()
+{
+ KILE_DEBUG() << "==Kile::projectNew==========================" << endl;
+ KileNewProjectDlg *dlg = new KileNewProjectDlg(m_ki->templateManager(), m_ki->extensions(), m_ki->parentWidget());
+ KILE_DEBUG()<< "\tdialog created" << endl;
+
+ if (dlg->exec())
+ {
+ KILE_DEBUG()<< "\tdialog executed" << endl;
+ KILE_DEBUG() << "\t" << dlg->name() << " " << dlg->location() << endl;
+
+ KileProject *project = dlg->project();
+
+ //add the project file to the project
+ //TODO: shell expand the filename
+ KileProjectItem *item = new KileProjectItem(project, project->url());
+ item->setOpenState(false);
+ projectOpenItem(item);
+
+ if (dlg->createNewFile())
+ {
+ QString filename = dlg->file();
+
+ //create the new document and fill it with the template
+ //TODO: shell expand the filename
+ Kate::View *view = loadTemplate(dlg->getSelection());
+
+ //derive the URL from the base url of the project
+ KURL url = project->baseURL();
+ url.addPath(filename);
+
+ TextInfo *docinfo = textInfoFor(view->getDoc());
+
+ //save the new file
+ view->getDoc()->saveAs(url);
+ emit documentStatusChanged(view->getDoc(), false, 0);
+
+ //add this file to the project
+ item = new KileProjectItem(project, url);
+ //project->add(item);
+ mapItem(docinfo, item);
+
+ //docinfo->updateStruct(m_kwStructure->level());
+ emit(updateStructure(true, docinfo));
+ }
+
+ project->buildProjectTree();
+ //project->save();
+ addProject(project);
+ emit(updateModeStatus());
+ emit(addToRecentProjects(project->url()));
+ }
+}
+
+void Manager::addProject(const KileProject *project)
+{
+ KILE_DEBUG() << "==void Manager::addProject(const KileProject *project)==========" << endl;
+ m_projects.append(project);
+ KILE_DEBUG() << "\tnow " << m_projects.count() << " projects" << endl;
+ emit addToProjectView(project);
+ connect(project, SIGNAL(projectTreeChanged(const KileProject *)), this, SIGNAL(projectTreeChanged(const KileProject *)));
+}
+
+KileProject* Manager::selectProject(const QString& caption)
+{
+ QStringList list;
+ QPtrListIterator<KileProject> it(m_projects);
+ while (it.current())
+ {
+ list.append((*it)->name());
+ ++it;
+ }
+
+ KileProject *project = 0;
+ QString name = QString::null;
+ if (list.count() > 1)
+ {
+ KileListSelector *dlg = new KileListSelector(list, caption, i18n("Select Project"), m_ki->parentWidget());
+ if (dlg->exec())
+ {
+ name = list[dlg->currentItem()];
+ }
+ delete dlg;
+ }
+ else if (list.count() == 0)
+ {
+ return 0;
+ }
+ else
+ name = m_projects.first()->name();
+
+ project = projectFor(name);
+
+ return project;
+}
+
+void Manager::addToProject(const KURL & url)
+{
+ KILE_DEBUG() << "===Kile::addToProject(const KURL & url =" << url.url() << ")" << endl;
+
+ KileProject *project = selectProject(i18n("Add to Project"));
+
+ if (project)
+ addToProject(project, url);
+}
+
+void Manager::addToProject(KileProject* project, const KURL & url)
+{
+ const KURL realurl = symlinkFreeURL(url);
+ QFileInfo fi(realurl.path());
+
+ if (project->contains(realurl))
+ {
+ emit printMsg(KileTool::Info,i18n("The file %1 is already member of the project %2").arg(realurl.filename()).arg(project->name()),i18n("Add to Project"));
+ return;
+ }
+ else if(!fi.exists() || !fi.isReadable())
+ {
+ emit printMsg( KileTool::Info,i18n("The file %1 can not be added because it does not exist or is not readable").arg(realurl.filename()),i18n("Add to Project"));
+ return;
+ }
+
+ KileProjectItem *item = new KileProjectItem(project, realurl);
+ item->setOpenState(m_ki->isOpen(realurl));
+ projectOpenItem(item);
+ emit addToProjectView(item);
+ buildProjectTree(project);
+}
+
+void Manager::removeFromProject(const KileProjectItem *item)
+{
+ if (item && item->project())
+ {
+ KILE_DEBUG() << "\tprojecturl = " << item->project()->url().path() << ", url = " << item->url().path() << endl;
+
+ if (item->project()->url() == item->url())
+ {
+ KMessageBox::error(m_ki->parentWidget(), i18n("This file is the project file, it holds all the information about your project. Therefore it is not allowed to remove this file from its project."), i18n("Cannot Remove File From Project"));
+ return;
+ }
+
+ emit removeItemFromProjectView(item, m_ki->isOpen(item->url()));
+
+ KileProject *project = item->project();
+ item->project()->remove(item);
+
+ // update undefined references in all project files
+ updateProjectReferences(project);
+ project->buildProjectTree();
+ }
+}
+
+void Manager::projectOpenItem(KileProjectItem *item, bool openProjectItemViews)
+{
+ KILE_DEBUG() << "==Kile::projectOpenItem==========================" << endl;
+ KILE_DEBUG() << "\titem:" << item->url().path() << endl;
+
+ if (m_ki->isOpen(item->url())) //remove item from projectview (this file was opened before as a normal file)
+ emit removeFromProjectView(item->url());
+
+ Kate::View *view = loadItem(m_ki->extensions()->determineDocumentType(item->url()), item, QString::null, openProjectItemViews);
+
+ if ( (!item->isOpen()) && (view == 0L) && (item->getInfo()) ) //doc shouldn't be displayed, trash the doc
+ trashDoc(item->getInfo());
+ else if (view != 0L)
+ view->setCursorPosition(item->lineNumber(), item->columnNumber());
+
+ //oops, doc apparently was open while the project settings wants it closed, don't trash it the doc, update openstate instead
+ if ((!item->isOpen()) && (view != 0L))
+ item->setOpenState(true);
+}
+
+KileProject* Manager::projectOpen(const KURL & url, int step, int max, bool openProjectItemViews)
+{
+ KILE_DEBUG() << "==Kile::projectOpen==========================" << endl;
+ KILE_DEBUG() << "\tfilename: " << url.fileName() << endl;
+
+ const KURL realurl = symlinkFreeURL(url);
+
+ if (m_ki->projectIsOpen(realurl))
+ {
+ m_kpd->cancel();
+
+ KMessageBox::information(m_ki->parentWidget(), i18n("The project you tried to open is already opened. If you wanted to reload the project, close the project before you re-open it."),i18n("Project Already Open"));
+ return 0L;
+ }
+
+ QFileInfo fi(realurl.path());
+ if ( ! fi.isReadable() )
+ {
+ m_kpd->cancel();
+
+ if (KMessageBox::warningYesNo(m_ki->parentWidget(), i18n("The project file for this project does not exists or is not readable. Remove this project from the recent projects list?"),i18n("Could Not Load Project File")) == KMessageBox::Yes)
+ emit(removeFromRecentProjects(realurl));
+
+ return 0L;
+ }
+
+ m_kpd->show();
+
+ KileProject *kp = new KileProject(realurl,m_ki->extensions());
+
+ if(kp->isInvalid())
+ {
+ m_kpd->cancel();
+ delete kp;
+ return 0L;
+ }
+
+ emit(addToRecentProjects(realurl));
+
+ KileProjectItemList *list = kp->items();
+
+ int project_steps = list->count() + 1;
+ m_kpd->progressBar()->setTotalSteps(project_steps * max);
+ project_steps *= step;
+ m_kpd->progressBar()->setValue(project_steps);
+
+ // open the project files in the correct order
+ QValueVector<KileProjectItem*> givenPositionVector(list->count(), NULL);
+ QValueList<KileProjectItem*> notCorrectlyOrderedList;
+ for(KileProjectItem *item = list->first(); item; item = list->next())
+ {
+ int order = item->order();
+ if(order >= 0 && static_cast<unsigned int>(order) >= list->count())
+ {
+ order = -1;
+ }
+ if(!item->isOpen() || order < 0 || givenPositionVector[order] != NULL)
+ {
+ notCorrectlyOrderedList.push_back(item);
+ }
+ else
+ {
+ givenPositionVector[order] = item;
+ }
+ }
+
+ QValueList<KileProjectItem*> orderedList;
+ for(unsigned int i = 0; i < givenPositionVector.size(); ++i)
+ {
+ KileProjectItem *item = givenPositionVector[i];
+ if(item)
+ {
+ orderedList.push_back(item);
+ }
+ }
+ for(QValueList<KileProjectItem*>::iterator i = notCorrectlyOrderedList.begin(); i != notCorrectlyOrderedList.end(); ++i)
+ {
+ orderedList.push_back(*i);
+ }
+
+ unsigned int counter = 0;
+ for (QValueList<KileProjectItem*>::iterator i = orderedList.begin(); i != orderedList.end(); ++i)
+ {
+ projectOpenItem(*i, openProjectItemViews);
+ m_kpd->progressBar()->setValue(counter + project_steps);
+ kapp->processEvents();
+ ++counter;
+ }
+
+ kp->buildProjectTree();
+ addProject(kp);
+
+ emit(updateStructure(false, 0L));
+ emit(updateModeStatus());
+ // update undefined references in all project files
+ updateProjectReferences(kp);
+
+ if (step == (max - 1))
+ m_kpd->cancel();
+
+ m_ki->viewManager()->switchToTextView(kp->lastDocument());
+
+ return kp;
+}
+
+// as all labels are gathered in the project, we can check for unsolved references
+void Manager::updateProjectReferences(KileProject *project)
+{
+ KileProjectItemList *list = project->items();
+ for ( uint i=0; i < list->count(); ++i)
+ {
+ emit(updateReferences(list->at(i)->getInfo()));
+ }
+}
+
+KileProject* Manager::projectOpen()
+{
+ KILE_DEBUG() << "==Kile::projectOpen==========================" << endl;
+ KURL url = KFileDialog::getOpenURL( KileConfig::defaultProjectLocation(), i18n("*.kilepr|Kile Project Files\n*|All Files"), m_ki->parentWidget(), i18n("Open Project") );
+
+ if (!url.isEmpty())
+ return projectOpen(url);
+ else
+ return 0L;
+}
+
+
+void Manager::projectSave(KileProject *project /* = 0 */)
+{
+ KILE_DEBUG() << "==Kile::projectSave==========================" << endl;
+ if (project == 0)
+ {
+ //find the project that corresponds to the active doc
+ project= activeProject();
+ }
+
+ if (project == 0 )
+ project = selectProject(i18n("Save Project"));
+
+ if (project)
+ {
+ KileProjectItemList *list = project->items();
+ Kate::Document *doc = NULL;
+ KileProjectItem *item = NULL;
+ TextInfo *docinfo = NULL;
+
+ // determine the order in which the project items are opened
+ QValueVector<KileProjectItem*> viewPositionVector(m_ki->viewManager()->getTabCount(), NULL);
+ for (KileProjectItemList::iterator i = list->begin(); i != list->end(); ++i)
+ {
+ docinfo = (*i)->getInfo();
+ if(docinfo)
+ {
+ Kate::View *view = m_ki->viewManager()->textView(docinfo);
+ if(view)
+ {
+ int position = m_ki->viewManager()->getIndexOf(view);
+ if(position >= 0 && static_cast<unsigned int>(position) < viewPositionVector.size())
+ {
+ viewPositionVector[position] = *i;
+ }
+ }
+ }
+ }
+ int position = 0;
+ for(unsigned int i = 0; i < viewPositionVector.size(); ++i)
+ {
+ if(viewPositionVector[i] != NULL)
+ {
+ viewPositionVector[i]->setOrder(position);
+ ++position;
+ }
+ }
+
+ //update the open-state of the items
+ for (KileProjectItemList::iterator i = list->begin(); i != list->end(); ++i)
+ {
+ item = *i;
+ KILE_DEBUG() << "\tsetOpenState(" << (*i)->url().path() << ") to " << m_ki->isOpen(item->url()) << endl;
+ item->setOpenState(m_ki->isOpen(item->url()));
+ docinfo = item->getInfo();
+
+ if (docinfo != 0L)
+ doc = docinfo->getDoc();
+ if (doc != 0L)
+ storeProjectItem(item, doc);
+
+ doc = 0L;
+ docinfo = 0L;
+ }
+
+ project->save();
+ }
+ else
+ KMessageBox::error(m_ki->parentWidget(), i18n("The current document is not associated to a project. Please activate a document that is associated to the project you want to save, then choose Save Project again."),i18n( "Could Determine Active Project"));
+}
+
+void Manager::projectAddFiles(const KURL & url)
+{
+ KileProject *project = projectFor(url);
+
+ if (project)
+ projectAddFiles(project,url);
+}
+
+void Manager::projectAddFiles(KileProject *project,const KURL & fileUrl)
+{
+ KILE_DEBUG() << "==Kile::projectAddFiles()==========================" << endl;
+ if (project == 0 )
+ project = activeProject();
+
+ if (project == 0 )
+ project = selectProject(i18n("Add Files to Project"));
+
+ if (project)
+ {
+ QString currentDir;
+ if(fileUrl.isEmpty())
+ currentDir=project->url().directory();
+ else
+ currentDir=fileUrl.directory();
+
+ KILE_DEBUG() << "currentDir is " << currentDir << endl;
+ KFileDialog *dlg = new KFileDialog(currentDir, i18n("*|All Files"),m_ki->parentWidget(), 0, true );
+ KPushButton* okButton = dlg->okButton();
+ okButton->setText(i18n("Add"));
+ dlg->setCaption(i18n("Add Files"));
+ KFile::Mode mode = static_cast<KFile::Mode>( KFile::Files | KFile::ExistingOnly);
+ dlg->setMode(mode);
+
+ if(dlg->exec())
+ {
+ KURL::List urls = dlg->selectedURLs();
+ for (uint i=0; i < urls.count(); ++i)
+ {
+ addToProject(project, urls[i]);
+ }
+ // update undefined references in all project files
+ updateProjectReferences(project);
+ }
+ delete dlg;
+
+ //open them
+ }
+ else if (m_projects.count() == 0)
+ KMessageBox::error(m_ki->parentWidget(), i18n("There are no projects opened. Please open the project you want to add files to, then choose Add Files again."),i18n( "Could Not Determine Active Project"));
+}
+
+void Manager::toggleArchive(KileProjectItem *item)
+{
+ item->setArchive(!item->archive());
+}
+
+void Manager::projectOptions(const KURL & url)
+{
+ KileProject *project = projectFor(url);
+
+ if (project)
+ projectOptions(project);
+}
+
+void Manager::projectOptions(KileProject *project /* = 0*/)
+{
+ KILE_DEBUG() << "==Kile::projectOptions==========================" << endl;
+ if (project ==0 )
+ project = activeProject();
+
+ if (project == 0 )
+ project = selectProject(i18n("Project Options For"));
+
+ if (project)
+ {
+ KILE_DEBUG() << "\t" << project->name() << endl;
+ KileProjectOptionsDlg *dlg = new KileProjectOptionsDlg(project, m_ki->extensions(), m_ki->parentWidget());
+ dlg->exec();
+ }
+ else if (m_projects.count() == 0)
+ KMessageBox::error(m_ki->parentWidget(), i18n("The current document is not associated to a project. Please activate a document that is associated to the project you want to modify, then choose Project Options again."),i18n( "Could Not Determine Active Project"));
+}
+
+bool Manager::projectCloseAll()
+{
+ KILE_DEBUG() << "==Kile::projectCloseAll==========================" << endl;
+ bool close = true;
+
+ QPtrListIterator<KileProject> it(m_projects);
+ int i = m_projects.count() + 1;
+ while ( it.current() && close && (i > 0))
+ {
+ close = close && projectClose(it.current()->url());
+ --i;
+ }
+
+ return close;
+}
+
+bool Manager::projectClose(const KURL & url)
+{
+ KILE_DEBUG() << "==Kile::projectClose==========================" << endl;
+ KileProject *project = 0;
+
+ if (url.isEmpty())
+ {
+ project = activeProject();
+
+ if (project == 0 )
+ project = selectProject(i18n("Close Project"));
+ }
+ else
+ {
+ project = projectFor(url);
+ }
+
+ if (project)
+ {
+ KILE_DEBUG() << "\tclosing:" << project->name() << endl;
+ project->setLastDocument(m_ki->getName());
+
+ projectSave(project);
+
+ KileProjectItemList *list = project->items();
+
+ bool close = true;
+ Kate::Document *doc = 0L;
+ TextInfo *docinfo = 0L;
+ for (uint i =0; i < list->count(); ++i)
+ {
+ doc = 0L;
+ docinfo = list->at(i)->getInfo();
+ if (docinfo)
+ {
+ doc = docinfo->getDoc();
+ }
+ else
+ {
+ continue;
+ }
+ if (doc)
+ {
+ KILE_DEBUG() << "\t\tclosing item " << doc->url().path() << endl;
+ bool r = fileClose(doc, true);
+ close = close && r;
+ if (!close)
+ break;
+ }
+ else
+ {
+ // we still need to delete the TextInfo object
+ removeTextDocumentInfo(docinfo, true);
+ }
+ }
+
+ if (close)
+ {
+ m_projects.remove(project);
+ emit removeFromProjectView(project);
+ delete project;
+ emit(updateModeStatus());
+ return true;
+ }
+ else
+ return false;
+ }
+ else if (m_projects.count() == 0)
+ KMessageBox::error(m_ki->parentWidget(), i18n("The current document is not associated to a project. Please activate a document that is associated to the project you want to close, then choose Close Project again."),i18n( "Could Not Close Project"));
+
+ return true;
+}
+
+void Manager::storeProjectItem(KileProjectItem *item, Kate::Document *doc)
+{
+ KILE_DEBUG() << "===Kile::storeProjectItem==============" << endl;
+ KILE_DEBUG() << "\titem = " << item << ", doc = " << doc << endl;
+ item->setEncoding(doc->encoding());
+ item->setHighlight(doc->hlModeName(doc->hlMode()));
+ uint l = 0, c = 0;
+ QPtrList<KTextEditor::View> viewList = doc->views();
+ if(!viewList.isEmpty()) {
+ Kate::View *view = static_cast<Kate::View*>(viewList.first());
+
+ if(view) {
+ view->cursorPosition(&l,&c);
+ }
+ }
+ item->setLineNumber(l);
+ item->setColumnNumber(c);
+
+ KILE_DEBUG() << "\t" << item->encoding() << " " << item->highlight() << " should be " << doc->hlModeName(doc->hlMode()) << endl;
+}
+
+void Manager::cleanUpTempFiles(const KURL &url, bool silent)
+{
+ KILE_DEBUG() << "===void Manager::cleanUpTempFiles(const KURL " << url.path() << ", bool " << silent << ")===" << endl;
+
+ if( url.isEmpty() )
+ return;
+
+ QStringList extlist;
+ QFileInfo fi(url.path());
+ const QStringList templist = QStringList::split(" ", KileConfig::cleanUpFileExtensions());
+ const QString fileName = fi.fileName();
+ const QString dirPath = fi.dirPath(true);
+ const QString baseName = fi.baseName(true);
+
+ for (uint i=0; i < templist.count(); ++i)
+ {
+ fi.setFile( dirPath + '/' + baseName + templist[i] );
+ if ( fi.exists() )
+ extlist.append(templist[i]);
+ }
+
+ if (!silent && ( KileUntitled::isUntitled(fileName) || fileName.isEmpty() ) )
+ return;
+
+ if (!silent && extlist.count() > 0 )
+ {
+ KILE_DEBUG() << "not silent" << endl;
+ KileDialog::Clean *dialog = new KileDialog::Clean(m_ki->parentWidget(), fileName, extlist);
+ if ( dialog->exec() )
+ extlist = dialog->getCleanlist();
+ else
+ {
+ delete dialog;
+ return;
+ }
+
+ delete dialog;
+ }
+
+ if ( extlist.count() == 0 )
+ emit printMsg(KileTool::Warning, i18n("Nothing to clean for %1").arg(fileName), i18n("Clean"));
+ else
+ {
+ for ( uint i = 0 ; i < extlist.count() ; ++i )
+ {
+ QFile file( dirPath + '/' + baseName + extlist[i] );
+ KILE_DEBUG() << "About to remove file = " << file.name() << endl;
+ file.remove();
+ }
+ emit printMsg(KileTool::Info, i18n("Cleaning %1 : %2").arg(fileName).arg(extlist.join(" ")), i18n("Clean"));
+ }
+}
+
+void Manager::openDroppedURLs(QDropEvent *e) {
+ KURL::List urls;
+ Extensions *extensions = m_ki->extensions();
+ if(KURLDrag::decode(e, urls)) {
+ for(KURL::List::iterator i = urls.begin(); i != urls.end(); ++i) {
+ KURL url = *i;
+ if(extensions->isProjectFile(url))
+ {
+ projectOpen(url);
+ }
+ else
+ {
+ fileOpen(url);
+ }
+ }
+ }
+}
+
+// Show all opened projects and switch to another one, if you want
+
+void Manager::projectShow()
+{
+ if ( m_projects.count() <= 1 )
+ return;
+
+ // select the new project
+ KileProject *project = selectProject(i18n("Switch Project"));
+ if ( !project || project==activeProject() )
+ return;
+
+ // get last opened document
+ const KURL lastdoc = project->lastDocument();
+ KileProjectItem *docitem = ( !lastdoc.isEmpty() ) ? itemFor(lastdoc,project) : 0L;
+
+ // if not, we search for the first opened tex file of this project
+ // if no file is opened, we take the first tex file mentioned in the list
+ KileProjectItem *first_texitem = 0L;
+ if ( ! docitem )
+ {
+ KileProjectItemList *list = project->items();
+ for ( KileProjectItem *item=list->first(); item; item=list->next() )
+ {
+ QString itempath = item->path();
+
+ // called from KAction 'Show projects...': find the first opened
+ // LaTeX document or, if that fails, any other opened file
+ QStringList extlist = QStringList::split(" ",m_ki->extensions()->latexDocuments() + ' ' + m_ki->extensions()->latexPackages());
+ for ( QStringList::Iterator it=extlist.begin(); it!=extlist.end(); ++it )
+ {
+ if ( itempath.find( (*it), -(*it).length() ) >= 0 )
+ {
+ if ( m_ki->isOpen(item->url()) )
+ {
+ docitem = item;
+ break;
+ }
+ else if ( ! first_texitem )
+ first_texitem = item;
+ }
+ }
+ if ( docitem )
+ break;
+ }
+ }
+
+ // did we find one opened file or must we take the first entry
+ if ( ! docitem )
+ {
+ if ( ! first_texitem )
+ return;
+ docitem = first_texitem;
+ }
+
+ // ok, we can switch to another project now
+ if ( m_ki->isOpen(docitem->url()) )
+ m_ki->viewManager()->switchToTextView(docitem->url());
+ else
+ fileOpen( docitem->url(),docitem->encoding() );
+}
+
+void Manager::projectRemoveFiles()
+{
+ KileProjectItemList* items = selectProjectFileItems( i18n("Select Files to Remove") );
+ if ( items && items->count() > 0 )
+ for ( KileProjectItemList::Iterator it = items->begin(); it != items->end(); ++it )
+ removeFromProject(*it);
+ delete items;
+}
+
+void Manager::projectShowFiles()
+{
+ KileProjectItem *item = selectProjectFileItem( i18n("Select File") );
+ if ( item )
+ {
+ if ( item->type() == KileProjectItem::ProjectFile )
+ dontOpenWarning( item, i18n("Show Project Files"), i18n("project configuration file") );
+ else if ( item->type() == KileProjectItem::Image )
+ dontOpenWarning( item, i18n("Show Project Files"), i18n("graphics file") );
+ else
+ {
+ // ok, we can switch to another file
+ if ( m_ki->isOpen(item->url()) )
+ m_ki->viewManager()->switchToTextView(item->url());
+ else
+ fileOpen( item->url(),item->encoding() );
+ }
+ }
+}
+
+void Manager::projectOpenAllFiles()
+{
+ KileProject *project = selectProject(i18n("Select Project"));
+ if (project != 0L)
+ {
+ projectOpenAllFiles(project->url());
+ }
+}
+
+void Manager::projectOpenAllFiles(const KURL & url)
+{
+ KileProject* project;
+ Kate::Document* doc = 0L;
+
+ if(!url.isValid())
+ return;
+ project = projectFor(url);
+
+ if(!project)
+ return;
+
+
+ if(m_ki->viewManager()->currentTextView())
+ doc = m_ki->viewManager()->currentTextView()->getDoc();
+ // we remember the actual view, so the user gets the same view back after opening
+
+ KileProjectItemList *list = project->items();
+ for ( KileProjectItem *item=list->first(); item; item = list->next() )
+ {
+ if ( item->type()==KileProjectItem::ProjectFile )
+ dontOpenWarning( item, i18n("Open All Project Files"), i18n("project configuration file") );
+ else if ( item->type()==KileProjectItem::Image )
+ dontOpenWarning( item, i18n("Open All Project Files"), i18n("graphics file") );
+ else if ( ! m_ki->isOpen(item->url()) )
+ fileOpen( item->url(),item->encoding() );
+ }
+
+ if(doc) // we have a doc so switch back to original view
+ m_ki->viewManager()->switchToTextView(doc->url());
+}
+
+QStringList Manager::getProjectFiles()
+{
+ QStringList filelist;
+
+ KileProject *project = activeProject();
+ if ( project )
+ {
+ KileProjectItemList *list = project->items();
+ for ( KileProjectItem *item=list->first(); item; item = list->next() )
+ {
+ if ( item->type()!=KileProjectItem::ProjectFile && item->type()!=KileProjectItem::Image )
+ filelist << item->url().path();
+ }
+ }
+ return filelist;
+}
+
+void Manager::dontOpenWarning(KileProjectItem *item, const QString &action, const QString &filetype)
+{
+ emit printMsg(KileTool::Info, i18n("not opened: %1 (%2)").arg(item->url().path()).arg(filetype), action);
+}
+
+KileProjectItem* Manager::selectProjectFileItem(const QString &label)
+{
+ // select a project
+ KileProject *project = selectProject(i18n("Select Project"));
+ if ( ! project )
+ return 0L;
+
+ // get a list of files
+ QStringList filelist;
+ QMap<QString,KileProjectItem *> map;
+ KileProjectItemList *list = project->items();
+ for ( KileProjectItem *item=list->first(); item; item = list->next() ) {
+ filelist << item->path();
+ map[item->path()] = item;
+ }
+
+ // select one of these files
+ KileProjectItem *item = 0L;
+ KileListSelector *dlg = new KileListSelector(filelist,i18n("Project Files"),label, m_ki->parentWidget());
+ if ( dlg->exec() ) {
+ if ( dlg->currentItem() >= 0 ) {
+ QString name = filelist[dlg->currentItem()];
+ if ( map.contains(name) )
+ item = map[name];
+ else
+ KMessageBox::error(m_ki->parentWidget(), i18n("Could not determine the selected file."),i18n( "Project Error"));
+ }
+ }
+ delete dlg;
+
+ return item;
+}
+
+KileProjectItemList* Manager::selectProjectFileItems(const QString &label)
+{
+ KileProject *project = selectProject(i18n("Select Project"));
+ if ( ! project )
+ return 0L;
+
+ QStringList filelist, selectedfiles;
+ QMap<QString,KileProjectItem *> map;
+
+ KileProjectItemList *list = project->items();
+ for ( KileProjectItem *item=list->first(); item; item = list->next() ) {
+ filelist << item->path();
+ map[item->path()] = item;
+ }
+
+ KileProjectItemList *items = new KileProjectItemList();
+ items->setAutoDelete(false);
+
+ KileListSelectorMultiple *dlg = new KileListSelectorMultiple(filelist,i18n("Project Files"),label, m_ki->parentWidget());
+ if ( dlg->exec() ) {
+ if ( dlg->currentItem() >= 0 ) {
+ selectedfiles = dlg->selected();
+ for ( QStringList::Iterator it = selectedfiles.begin(); it != selectedfiles.end(); ++it ){
+ if ( map.contains(*it) )
+ items->append( map[(*it)] );
+ else
+ KMessageBox::error(m_ki->parentWidget(), i18n("Could not determine the selected file."),i18n( "Project Error"));
+ }
+ }
+ }
+ delete dlg;
+
+ return items;
+}
+
+// add a new file to the project
+// - only when there is an active project
+// - if the file doesn't already belong to it (checked by addToProject)
+
+void Manager::projectAddFile(QString filename, bool graphics)
+{
+ KILE_DEBUG() << "===Kile::projectAddFile==============" << endl;
+ KileProject *project = activeProject();
+ if ( ! project )
+ return;
+
+ QFileInfo fi(filename);
+ if ( ! fi.exists() )
+ {
+ if ( graphics )
+ return;
+
+ // called from InputDialog after a \input- or \include command:
+ // - if the chosen file has an extension: accept
+ // - if not we add the default TeX extension: accept if it exists else reject
+ QString ext = fi.extension();
+ if ( ! ext.isEmpty() )
+ return;
+
+ filename += m_ki->extensions()->latexDocumentDefault();
+ if ( QFileInfo(filename).exists() )
+ return;
+ }
+
+ //ok, we have a project and an existing file
+ KILE_DEBUG() << "\tadd file: " << filename << endl;
+ m_ki->viewManager()->updateStructure(true);
+
+ KURL url;
+ url.setPath(filename);
+ addToProject(project, url);
+}
+
+const KURL Manager::symlinkFreeURL(const KURL& url)
+{
+ KILE_DEBUG() << "===symlinkFreeURL==" << endl;
+
+ if( !url.isLocalFile() )
+ return url;
+
+ QDir dir(url.directory());
+ QString filename=url.path(); // if the directory does not exist we return the old url (just to be sure)
+
+ if(dir.exists())
+ filename= dir.canonicalPath() + '/' + url.filename();
+ else
+ KILE_DEBUG() << "directory " << url.directory() << "does not exist" << endl;
+
+ return KURL::fromPathOrURL(filename);
+}
+
+void Manager::cleanupDocumentInfoForProjectItems(KileDocument::Info *info)
+{
+ KileProjectItemList *itms = itemsFor(info);
+ QPtrListIterator<KileProjectItem> it(*itms);
+ KileProjectItem *current;
+ while((current = it.current()) != 0)
+ {
+ ++it;
+ current->setInfo(0);
+ }
+ delete itms;
+}
+
+}
+
+#include "kiledocmanager.moc"
diff --git a/src/kile/kiledocmanager.h b/src/kile/kiledocmanager.h
new file mode 100644
index 0000000..1b103d0
--- /dev/null
+++ b/src/kile/kiledocmanager.h
@@ -0,0 +1,245 @@
+//
+// C++ Interface: kiledocmanager
+//
+// Description:
+//
+//
+// Author: Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>, (C) 2004
+// Michel Ludwig <michel.ludwig@kdemail.net>, (C) 2006
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEDOCUMENTKILEDOCMANAGER_H
+#define KILEDOCUMENTKILEDOCMANAGER_H
+
+#include <qobject.h>
+
+#include "kileconstants.h"
+#include "kileproject.h"
+
+class KURL;
+class KFileItem;
+class KProgressDialog;
+namespace Kate { class Document; class View;}
+
+class TemplateItem;
+class KileInfo;
+class KileProjectItem;
+class KileProjectItemList;
+
+namespace KileDocument
+{
+
+class Info;
+class TextInfo;
+
+/**
+@author Jeroen Wijnhout
+*/
+class Manager : public QObject
+{
+ Q_OBJECT
+public:
+ Manager(KileInfo *info, QObject *parent = 0, const char *name = 0);
+ ~Manager();
+
+public slots:
+ Kate::View* createNewJScript();
+ Kate::View* createNewLaTeXDocument();
+
+//files
+ void newDocumentStatus(Kate::Document *doc);
+
+ /**
+ * Creates a new file on disk.
+ **/
+ void fileNew(const KURL &);
+ void fileNew();
+
+ void fileSelected(const KURL &);
+ void fileSelected(const KileProjectItem * item);
+ void fileSelected(const KFileItem *file);
+
+ void fileOpen();
+ void fileOpen(const KURL& url, const QString & encoding = QString::null, int index = -1);
+
+ void fileSave();
+ void fileSaveAs(Kate::View* = 0L);
+ void fileSaveCopyAs();
+
+ void saveURL(const KURL &);
+ void fileSaveAll(bool amAutoSaving = false, bool disUntitled = false);
+
+ bool fileCloseAllOthers();
+ bool fileCloseAll();
+ bool fileClose(const KURL & url);
+ bool fileClose(Kate::Document *doc = 0L, bool closingproject = false);
+
+//templates
+ Kate::View* loadTemplate(TemplateItem*);
+ void createTemplate();
+ void removeTemplate();
+ void replaceTemplateVariables(QString &line);
+
+//projects
+ void projectNew();
+ KileProject* projectOpen();
+
+ /**
+ * @param openProjectItemViews Opens project files in the editor iff openProjectItemViews is set to 'true'.
+ **/
+ KileProject* projectOpen(const KURL&, int = 0, int = 1, bool openProjectItemViews = true);
+
+ /**
+ * @param openProjectItemViews Opens project files in the editor iff openProjectItemViews is set to 'true'.
+ **/
+ void projectOpenItem(KileProjectItem *item, bool openProjectItemViews = true);
+
+ /**
+ * Saves the state of the project, if @param project is zero, the active project is saved.
+ **/
+ void projectSave(KileProject * project = 0);
+ void projectAddFiles(const KURL &);
+ void projectAddFiles(KileProject * project = 0,const KURL & url = KURL());
+ void toggleArchive(KileProjectItem *);
+ void buildProjectTree(KileProject *project = 0);
+ void buildProjectTree(const KURL &);
+ void projectOptions(const KURL &);
+ void projectOptions(KileProject *project = 0);
+ bool projectClose(const KURL & url = KURL());
+ bool projectCloseAll();
+
+ void projectShow();
+ void projectRemoveFiles();
+ void projectShowFiles();
+ void projectAddFile(QString filename, bool graphics=false);
+ void projectOpenAllFiles();
+ void projectOpenAllFiles(const KURL &);
+
+ KileProject* selectProject(const QString &);
+
+ void addProject(const KileProject *project);
+ void addToProject(const KURL &);
+ void addToProject(KileProject *, const KURL &);
+ void removeFromProject(const KileProjectItem *);
+ void storeProjectItem(KileProjectItem *item, Kate::Document *doc);
+
+ void cleanUpTempFiles(const KURL &url, bool silent = false);
+
+ void openDroppedURLs(QDropEvent *e);
+
+signals:
+ void projectTreeChanged(const KileProject *);
+ void closingDocument(KileDocument::Info *);
+ void documentInfoCreated(KileDocument::Info *);
+
+ void updateStructure(bool needToParse, KileDocument::Info*);
+ void updateModeStatus();
+ void updateReferences(KileDocument::Info *);
+
+ void documentStatusChanged(Kate::Document *, bool, unsigned char reason);
+
+ void addToRecentFiles(const KURL &);
+ void addToRecentProjects(const KURL &);
+ void removeFromRecentProjects(const KURL &);
+
+ void startWizard();
+
+ void printMsg(int type, const QString & message, const QString &tool = "Kile" );
+
+ void removeFromProjectView(const KURL &);
+ void removeFromProjectView(const KileProject *);
+ void removeItemFromProjectView(const KileProjectItem *, bool);
+ void addToProjectView(const KURL &);
+ void addToProjectView(KileProjectItem *item);
+ void addToProjectView(const KileProject *);
+
+public:
+ QPtrList<KileProject>* projects() { return &m_projects; }
+ QPtrList<TextInfo>* textDocumentInfos() { return &m_textInfoList; }
+
+ Kate::Document* docFor(const KURL &url);
+
+ Info* getInfo() const;
+ // FIXME: "path" should be changed to a URL, i.e. only the next but one function
+ // should be used
+ TextInfo* textInfoFor(const QString &path) const;
+ TextInfo* textInfoForURL(const KURL& url);
+ TextInfo* textInfoFor(Kate::Document* doc) const;
+ void updateInfos();
+
+ KileProject* projectFor(const KURL &projecturl);
+ KileProject* projectFor(const QString & name);
+ KileProject* activeProject();
+ bool isProjectOpen();
+ void updateProjectReferences(KileProject *project);
+ QStringList getProjectFiles();
+
+ KileProjectItem* activeProjectItem();
+ /**
+ * Finds the project item for the file with URL @param url.
+ * @returns a pointer to the project item, 0 if this file does not belong to a project
+ **/
+ KileProjectItem* itemFor(const KURL &url, KileProject *project = 0) const;
+ KileProjectItem* itemFor(Info *docinfo, KileProject *project = 0) const;
+ KileProjectItem* selectProjectFileItem(const QString &label);
+ KileProjectItemList* selectProjectFileItems(const QString &label);
+
+ KileProjectItemList* itemsFor(Info *docinfo) const;
+
+ static const KURL symlinkFreeURL(const KURL& url);
+
+protected:
+ void mapItem(TextInfo *docinfo, KileProjectItem *item);
+
+ void trashDoc(TextInfo *docinfo, Kate::Document *doc = 0L);
+
+ TextInfo* createTextDocumentInfo(KileDocument::Type type, const KURL &url, const KURL& baseDirectory = KURL());
+ void recreateTextDocumentInfo(TextInfo *oldinfo);
+
+ /**
+ * Tries to remove and delete a TextInfo object. The TextInfo object will only be deleted if it isn't referenced
+ * by any project item or if is is only referenced by a project that should be closed.
+ * @param closingproject Indicates whether the TextInfo object should be removed as part of a project close
+ * operation.
+ * @warning This method does not close or delete any Kate documents that are associated with the TextInfo object !
+ **/
+ bool removeTextDocumentInfo(TextInfo *docinfo, bool closingproject = false);
+ Kate::Document* createDocument(const QString& name, const KURL& url, TextInfo *docinfo, const QString & encoding, const QString & highlight);
+
+ /**
+ * Creates a document with the specified text.
+ *
+ * @param extension The extension of the file that should be created without leading "."
+ **/
+ Kate::View* createDocumentWithText(const QString& text, KileDocument::Type type = KileDocument::Text, const QString& extension = QString::null, const KURL& baseDirectory = KURL());
+
+ Kate::View* loadText(KileDocument::Type type, const QString& name, const KURL &url, const QString & encoding = QString::null, bool create = true, const QString & highlight = QString::null, const QString &text = QString::null, int index = -1, const KURL& baseDirectory = KURL());
+ Kate::View* loadItem(KileDocument::Type type, KileProjectItem *item, const QString & text = QString::null, bool openProjectItemViews = true);
+
+private:
+ QPtrList<TextInfo> m_textInfoList;
+ KileInfo *m_ki;
+ QPtrList<KileProject> m_projects;
+ KProgressDialog *m_kpd;
+
+ void dontOpenWarning(KileProjectItem *item, const QString &action, const QString &filetype);
+ void cleanupDocumentInfoForProjectItems(KileDocument::Info *info);
+
+ QStringList autosaveWarnings;
+
+};
+
+}
+
+#endif
diff --git a/src/kile/kiledocumentinfo.cpp b/src/kile/kiledocumentinfo.cpp
new file mode 100644
index 0000000..79d6b16
--- /dev/null
+++ b/src/kile/kiledocumentinfo.cpp
@@ -0,0 +1,1325 @@
+/*********************************************************************************************
+ begin : Sun Jul 20 2003
+ copyright : (C) 2003 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
+ (C) 2005-2007 by Holger Danielsson (holger.danielsson@versanet.de)
+ (C) 2006 by Michel Ludwig (michel.ludwig@kdemail.net)
+ *********************************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// 2005-11-02: dani
+// - cleaning up source of central function updateStruct()
+// - always use 'else if', because all conditions are exclusive or
+// - most often used commands are at the top
+// - add some new types of elements (and levels) for the structure view
+// - new commands, which are passed to the structure listview:
+// \includegraphics, \caption
+// - all user defined commands for labels are recognized
+// - changed folder name of KileStruct::BibItem to "bibs", so that "refs"
+// is still unused and can be used for references (if wanted)
+// - \begin, \end to gather all environments. But only figure and table
+// environments are passed to the structure view
+
+// 2005-11-26: dani
+// - add support for \fref, \Fref and \eqref references commands
+
+// 2005-12-07: dani
+// - add support to enable and disable some structure view items
+
+// 2006-01-16 tbraun
+// - fix #59945 Now we call (through a signal ) project->buildProjectTree so the bib files are correct,
+// and therefore the keys in \cite completion
+
+// 2006-02-09 tbraun/dani
+// - fix #106261#4 improved parsing of (optional) command parameters
+// - all comments are removed
+
+//2006-09-09 mludwig
+// - generalising the different document types
+
+//2007-02-15
+// - signal foundItem() not only sends the cursor position of the parameter,
+// but also the real cursor position of the command
+
+// 2007-03-12 dani
+// - use KileDocument::Extensions
+
+// 2007-03-24 dani
+// - preliminary minimal support for Beamer class
+
+// 2007-03-25 dani
+// - merge labels and sections in document structure view as user configurable option
+
+// 2007-04-06 dani
+// - add TODO/FIXME section to structure view
+
+#include "kiledocumentinfo.h"
+
+#include <qfileinfo.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qregexp.h>
+#include <qdatetime.h>
+
+#include <kio/netaccess.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include "kiledebug.h"
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <kinputdialog.h>
+
+#include "codecompletion.h"
+#include "kileuntitled.h"
+#include "kileconfig.h"
+
+namespace KileDocument
+{
+
+bool Info::containsInvalidCharacters(const KURL& url)
+{
+ QString filename = url.fileName();
+ return filename.contains(" ") || filename.contains("~") || filename.contains("$") || filename.contains("#");
+}
+
+KURL Info::repairInvalidCharacters(const KURL& url, bool checkForFileExistence /* = true */)
+{
+ KURL ret(url);
+ do {
+ bool isOK;
+ QString newURL = KInputDialog::getText(
+ i18n("Invalid Characters"),
+ i18n("The filename contains invalid characters ($~ #).<br>Please provide \
+ another one, or click \"Cancel\" to save anyway."),
+ ret.filename(),
+ &isOK);
+ if(!isOK)
+ break;
+ ret.setFileName(newURL);
+ } while(containsInvalidCharacters(ret));
+
+ return (checkForFileExistence ? renameIfExist(ret) : ret);
+}
+
+KURL Info::renameIfExist(const KURL& url)
+{
+ KURL ret(url);
+ while ( KIO::NetAccess::exists(url, true, kapp->mainWidget()) ) // check for writing possibility
+ {
+ bool isOK;
+ QString newURL = KInputDialog::getText(
+ i18n("File Already Exists"),
+ i18n("A file with filename '%1' already exists.<br>Please provide \
+ another one, or click \"Cancel\" to overwrite it.").arg(ret.fileName()),
+ ret.filename(),
+ &isOK);
+ if(!isOK)
+ break;
+ ret.setFileName(newURL);
+ }
+ return ret;
+}
+
+KURL Info::repairExtension(const KURL& url, bool checkForFileExistence /* = true */)
+{
+ KURL ret(url);
+
+ QString filename = url.fileName();
+ if(filename.contains(".") && filename[0] != '.') // There already is an extension
+ return ret;
+
+ if(KMessageBox::Yes == KMessageBox::questionYesNo(NULL,
+ i18n("The given filename has no extension; do you want one to be automatically added?"),
+ i18n("Missing Extension"),
+ KStdGuiItem::yes(),
+ KStdGuiItem::no(),
+ "AutomaticallyAddExtension"))
+ {
+ ret.setFileName(filename + ".tex");
+ }
+ return (checkForFileExistence ? renameIfExist(ret) : ret);
+}
+
+KURL Info::makeValidTeXURL(const KURL & url, bool istexfile, bool checkForFileExistence)
+{
+ KURL newURL(url);
+
+ //add a .tex extension
+ if ( ! istexfile )
+ newURL = repairExtension(newURL, checkForFileExistence);
+
+ //remove characters TeX does not accept, make sure the newURL does not exists yet
+ if(containsInvalidCharacters(newURL))
+ newURL = repairInvalidCharacters(newURL, checkForFileExistence);
+
+ return newURL;
+}
+
+Info::Info() : m_bIsRoot(false), m_config(kapp->config()), documentTypePromotionAllowed(true)
+{
+ updateStructLevelInfo();
+}
+
+Info::~Info(void)
+{
+ KILE_DEBUG() << "DELETING DOCINFO" << m_url.path() << endl;
+}
+
+void Info::updateStructLevelInfo()
+{
+ KILE_DEBUG() << "===void Info::updateStructLevelInfo()===" << endl;
+ // read config for structureview items
+ m_showStructureLabels = KileConfig::svShowLabels();
+ m_showStructureReferences = KileConfig::svShowReferences();
+ m_showStructureBibitems = KileConfig::svShowBibitems();
+ m_showStructureGraphics = KileConfig::svShowGraphics();
+ m_showStructureFloats = KileConfig::svShowFloats();
+ m_showStructureInputFiles = KileConfig::svShowInputFiles();
+ m_showStructureTodo = KileConfig::svShowTodo();
+ m_showSectioningLabels = KileConfig::svShowSectioningLabels();
+ m_openStructureLabels = KileConfig::svOpenLabels();
+ m_openStructureReferences = KileConfig::svOpenReferences();
+ m_openStructureBibitems = KileConfig::svOpenBibitems();
+ m_openStructureTodo = KileConfig::svOpenTodo();
+}
+
+void Info::setBaseDirectory(const KURL& url)
+{
+ KILE_DEBUG() << "===void Info::setBaseDirectory(const KURL&" << url << ")===" << endl;
+ m_baseDirectory = url;
+}
+
+const KURL& Info::getBaseDirectory() const
+{
+ return m_baseDirectory;
+}
+
+bool Info::isTextDocument()
+{
+ return false;
+}
+
+Type Info::getType()
+{
+ return Undefined;
+}
+
+QString Info::getFileFilter() const
+{
+ return QString::null;
+}
+
+bool Info::isDocumentTypePromotionAllowed()
+{
+ return documentTypePromotionAllowed;
+}
+
+void Info::setDocumentTypePromotionAllowed(bool b)
+{
+ documentTypePromotionAllowed = b;
+}
+
+KURL Info::url()
+{
+ return m_url;
+}
+
+void Info::count(const QString line, long *stat)
+{
+ QChar c;
+ int state = stStandard;
+ bool word = false; // we are in a word
+
+ for (uint p=0; p < line.length(); ++p)
+ {
+ c = line[p];
+
+ switch ( state )
+ {
+ case stStandard :
+ switch ( c )
+ {
+ case TEX_CAT0 :
+ state = stControlSequence;
+ ++stat[1];
+
+ //look ahead to avoid counting words like K\"ahler as two words
+ if (! line[p+1].isPunct() || line[p+1] == '~' || line[p+1] == '^' )
+ word=false;
+ break;
+
+ case TEX_CAT14 :
+ state=stComment;
+ break;
+
+ default:
+ if (c.isLetterOrNumber())
+ {
+ //only start new word if first character is a letter (42test is still counted as a word, but 42.2 not)
+ if (c.isLetter() && !word)
+ {
+ word=true;
+ ++stat[3];
+ }
+ ++stat[0];
+ }
+ else
+ {
+ ++stat[2];
+ word = false;
+ }
+
+ break;
+ }
+ break;
+
+ case stControlSequence :
+ if ( c.isLetter() )
+ {
+ // "\begin{[a-zA-z]+}" is an environment, and you can't define a command like \begin
+ if ( line.mid(p,5) == "begin" )
+ {
+ ++stat[5];
+ state = stEnvironment;
+ stat[1] +=5;
+ p+=4; // after break p++ is executed
+ }
+ else if ( line.mid(p,3) == "end" )
+ {
+ stat[1] +=3;
+ state = stEnvironment;
+ p+=2;
+ } // we don't count \end as new environment, this can give wrong results in selections
+ else
+ {
+ ++stat[4];
+ ++stat[1];
+ state = stCommand;
+ }
+ }
+ else
+ {
+ ++stat[4];
+ ++stat[1];
+ state = stStandard;
+ }
+ break;
+
+ case stCommand :
+ if ( c.isLetter() )
+ ++stat[1];
+ else if ( c == TEX_CAT0 )
+ {
+ ++stat[1];
+ state=stControlSequence;
+ }
+ else if ( c == TEX_CAT14 )
+ state=stComment;
+ else
+ {
+ ++stat[2];
+ state = stStandard;
+ }
+ break;
+
+ case stEnvironment :
+ if ( c == TEX_CAT2 ) // until we find a closing } we have an environment
+ {
+ ++stat[1];
+ state=stStandard;
+ }
+ else if ( c == TEX_CAT14 )
+ state=stComment;
+ else
+ ++stat[1];
+
+ break;
+
+ case stComment : // if we get a selection the line possibly contains \n and so the comment is only valid till \n and not necessarily till line.length()
+ if ( c == '\n')
+ {
+ ++stat[2]; // \n was counted as punctuation in the old implementation
+ state=stStandard;
+ word=false;
+ }
+ break;
+
+ default :
+ kdWarning() << "Unhandled state in getStatistics " << state << endl;
+ break;
+ }
+ }
+}
+
+QString Info::lastModifiedFile(const QStringList *list /* = 0L */)
+{
+ KILE_DEBUG() << "==QString Info::lastModifiedFile()=====" << endl;
+ QFileInfo fileinfo ( url().path() );
+ QString basepath = fileinfo.dirPath(true), last = fileinfo.absFilePath();
+ QDateTime time ( fileinfo.lastModified() );
+
+ if ( list == 0L ) list = &m_deps;
+
+ KILE_DEBUG() << "\t" << fileinfo.absFilePath() << " : " << time.toString() << endl;
+ for ( uint i = 0; i < list->count(); ++i )
+ {
+ fileinfo.setFile( basepath + '/' + (*list)[i] );
+ KILE_DEBUG() << "\t" << fileinfo.absFilePath() << " : " << fileinfo.lastModified().toString() << endl;
+ if ( fileinfo.lastModified() > time )
+ {
+ time = fileinfo.lastModified();
+ last = fileinfo.absFilePath();
+ KILE_DEBUG() << "\t\tlater" << endl;
+ }
+ }
+
+ KILE_DEBUG() << "\treturning " << fileinfo.absFilePath() << endl;
+ return last;
+}
+
+void Info::updateStruct()
+{
+ KILE_DEBUG() << "==Info::updateStruct()=======" << endl;
+ m_labels.clear();
+ m_bibItems.clear();
+ m_deps.clear();
+ m_bibliography.clear();
+ m_packages.clear();
+ m_newCommands.clear();
+ m_bIsRoot = false;
+ m_preamble = QString::null;
+}
+
+void Info::updateBibItems()
+{
+}
+
+void Info::slotCompleted()
+{
+ emit completed(this);
+}
+
+
+TextInfo::TextInfo(Kate::Document *doc, Extensions *extensions, const QString& defaultHighlightMode) : m_doc(0), m_defaultHighlightMode(defaultHighlightMode)
+{
+ setDoc(doc);
+ if (m_doc)
+ {
+ KILE_DEBUG() << "TextInfo created for " << m_doc->docName() << endl;
+ }
+
+ m_arStatistics = new long[SIZE_STAT_ARRAY];
+
+ if (m_doc)
+ {
+ m_url = doc->url();
+ }
+ else
+ {
+ m_url = KURL();
+ }
+ m_extensions = extensions;
+
+}
+
+TextInfo::~TextInfo()
+{
+ delete [] m_arStatistics;
+}
+
+
+const Kate::Document* TextInfo::getDoc() const
+{
+ return m_doc;
+}
+
+Kate::Document* TextInfo::getDoc()
+{
+ return m_doc;
+}
+
+void TextInfo::setDoc(Kate::Document *doc)
+{
+ KILE_DEBUG() << "===void TextInfo::setDoc(Kate::Document *doc)===" << endl;
+
+ if(m_doc == doc)
+ return;
+
+ detach();
+ if(doc)
+ {
+ m_doc = doc;
+ m_url = doc->url();
+ connect(m_doc, SIGNAL(fileNameChanged()), this, SLOT(slotFileNameChanged()));
+ connect(m_doc, SIGNAL(completed()), this, SLOT(slotCompleted()));
+ setHighlightMode(m_defaultHighlightMode);
+ installEventFilters();
+ }
+}
+
+void TextInfo::detach()
+{
+ if(m_doc)
+ {
+ m_doc->disconnect(this);
+ removeInstalledEventFilters();
+ }
+ m_doc = 0L;
+}
+
+const long* TextInfo::getStatistics()
+{
+ /* [0] = #c in words, [1] = #c in latex commands and environments,
+ [2] = #c whitespace, [3] = #words, [4] = # latex_commands, [5] = latex_environments */
+ m_arStatistics[0]=m_arStatistics[1]=m_arStatistics[2]=m_arStatistics[3]=m_arStatistics[4]=m_arStatistics[5]=0;
+
+ return m_arStatistics;
+}
+
+// FIXME for KDE 4.0, rearrange the hole docinfo layout to get rid of this hack
+KURL TextInfo::url()
+{
+ KURL url;
+
+ if(m_doc)
+ url = m_doc->url();
+ else
+ {
+ QFileInfo info(m_url.path());
+ if(info.exists())
+ url = m_url;
+ else
+ url = KURL();
+ }
+// KILE_DEBUG() << "===KURL TextInfo::url()===, url is " << url.path() << endl;
+ return url;
+}
+
+Type TextInfo::getType()
+{
+ return Text;
+}
+
+bool TextInfo::isTextDocument()
+{
+ return true;
+}
+
+void TextInfo::setHighlightMode(const QString &highlight)
+{
+ KILE_DEBUG() << "==Kile::setHighlightMode(" << m_doc->url() << "," << highlight << " )==================" << endl;
+
+ if ( m_doc && !highlight.isEmpty() )
+ {
+ bool found = false;
+ uint c = m_doc->hlModeCount();
+ uint mode = 0;
+ for (uint i = 0; i < c; ++i)
+ {
+ if (m_doc->hlModeName(i) == highlight) {
+ found = true;
+ mode = i;
+ break;
+ }
+ }
+ if (found)
+ {
+ m_doc->setHlMode(mode);
+ }
+ }
+}
+
+void TextInfo::setDefaultHightlightMode(const QString& string)
+{
+ m_defaultHighlightMode = string;
+}
+
+// match a { with the corresponding }
+// pos is the position of the {
+QString TextInfo::matchBracket(QChar obracket, uint &l, uint &pos)
+{
+ QChar cbracket;
+ if ( obracket == '{' ) cbracket = '}';
+ if ( obracket == '[' ) cbracket = ']';
+ if ( obracket == '(' ) cbracket = ')';
+
+ QString line, grab = "";
+ int count=0, len;
+ ++pos;
+
+ TodoResult todo;
+ while ( l <= m_doc->numLines() )
+ {
+ line = getTextline(l,todo);
+ len = line.length();
+ for (int i=pos; i < len; ++i)
+ {
+ if (line[i] == '\\' && ( line[i+1] == obracket || line[i+1] == cbracket) ) ++i;
+ else if (line[i] == obracket) ++count;
+ else if (line[i] == cbracket)
+ {
+ --count;
+ if (count < 0)
+ {
+ pos = i;
+ return grab;
+ }
+ }
+
+ grab += line[i];
+ }
+ ++l;
+ pos=0;
+ }
+
+ return QString::null;
+}
+
+QString TextInfo::getTextline(uint line, TodoResult &todo)
+{
+ static QRegExp::QRegExp reComments("[^\\\\](%.*$)");
+
+ todo.type = -1;
+ QString s = m_doc->textLine(line);
+ if ( ! s.isEmpty() )
+ {
+ // remove comment lines
+ if ( s[0] == '%' )
+ {
+ searchTodoComment(s,0,todo);
+ s = QString::null;
+ }
+ else
+ {
+ //remove escaped \ characters
+ s.replace("\\\\", " ");
+
+ //remove comments
+ int pos = s.find(reComments);
+ if ( pos != -1 )
+ {
+ searchTodoComment(s,pos,todo);
+ s = s.left(reComments.pos(1));
+ }
+ }
+ }
+ return s;
+}
+
+void TextInfo::searchTodoComment(const QString &s, uint startpos, TodoResult &todo)
+{
+ static QRegExp::QRegExp reTodoComment("\\b(TODO|FIXME)\\b(:|\\s)?\\s*(.*)");
+
+ if ( s.find(reTodoComment,startpos) != -1 )
+ {
+ todo.type = ( reTodoComment.cap(1) == "TODO" ) ? KileStruct::ToDo : KileStruct::FixMe;
+ todo.colTag = reTodoComment.pos(1);
+ todo.colComment = reTodoComment.pos(3);
+ todo.comment = reTodoComment.cap(3).stripWhiteSpace();
+ }
+}
+
+KTextEditor::View* TextInfo::createView(QWidget *parent, const char *name)
+{
+ if(!m_doc)
+ {
+ return NULL;
+ }
+ KTextEditor::View *view = m_doc->createView(parent, name);
+ installEventFilters(view);
+ return view;
+}
+
+void TextInfo::slotFileNameChanged()
+{
+ emit urlChanged(this, url());
+}
+
+void TextInfo::installEventFilters(KTextEditor::View* /* view */)
+{
+ /* do nothing */
+}
+
+void TextInfo::removeInstalledEventFilters(KTextEditor::View* /* view */)
+{
+ /* do nothing */
+}
+
+void TextInfo::installEventFilters()
+{
+ if(!m_doc)
+ {
+ return;
+ }
+ QPtrList<KTextEditor::View> views = m_doc->views();
+ KTextEditor::View *view;
+ for(view = views.first(); view; view = views.next())
+ {
+ installEventFilters(view);
+ }
+}
+
+void TextInfo::removeInstalledEventFilters()
+{
+ if(!m_doc)
+ {
+ return;
+ }
+ QPtrList<KTextEditor::View> views = m_doc->views();
+ KTextEditor::View *view;
+ for(view = views.first(); view; view = views.next())
+ {
+ removeInstalledEventFilters(view);
+ }
+}
+
+
+LaTeXInfo::LaTeXInfo (Kate::Document *doc, Extensions *extensions, LatexCommands *commands, const QObject* eventFilter) : TextInfo(doc, extensions, "LaTeX"), m_commands(commands), m_eventFilter(eventFilter)
+{
+ documentTypePromotionAllowed = false;
+ updateStructLevelInfo();
+}
+
+LaTeXInfo::~LaTeXInfo()
+{
+}
+
+const long* LaTeXInfo::getStatistics()
+{
+ /* [0] = #c in words, [1] = #c in latex commands and environments,
+ [2] = #c whitespace, [3] = #words, [4] = # latex_commands, [5] = latex_environments */
+ m_arStatistics[0]=m_arStatistics[1]=m_arStatistics[2]=m_arStatistics[3]=m_arStatistics[4]=m_arStatistics[5]=0;
+ QString line;
+
+ if ( m_doc && m_doc->hasSelection() )
+ {
+ line = m_doc->selection();
+ KILE_DEBUG() << "getStat : line : " << line << endl;
+ count(line, m_arStatistics);
+ }
+ else if (m_doc)
+ for (uint l=0; l < m_doc->numLines(); ++l)
+ {
+ line = m_doc->textLine(l);
+ KILE_DEBUG() << "getStat : line : " << line << endl;
+ count(line, m_arStatistics);
+ }
+ return m_arStatistics;
+}
+
+Type LaTeXInfo::getType()
+{
+ return LaTeX;
+}
+
+QString LaTeXInfo::getFileFilter() const
+{
+ return m_extensions->latexDocumentFileFilter() + '\n' + m_extensions->latexPackageFileFilter();
+}
+
+void LaTeXInfo::updateStructLevelInfo() {
+
+ KILE_DEBUG() << "===void LaTeXInfo::updateStructLevelInfo()===" << endl;
+
+ // read config stuff
+ Info::updateStructLevelInfo();
+
+ // clear all entries
+ m_dictStructLevel.clear();
+
+ //TODO: make sectioning and bibliography configurable
+
+ // sectioning
+ m_dictStructLevel["\\part"]=KileStructData(1, KileStruct::Sect, "part");
+ m_dictStructLevel["\\chapter"]=KileStructData(2, KileStruct::Sect, "chapter");
+ m_dictStructLevel["\\section"]=KileStructData(3, KileStruct::Sect, "section");
+ m_dictStructLevel["\\subsection"]=KileStructData(4, KileStruct::Sect, "subsection");
+ m_dictStructLevel["\\subsubsection"]=KileStructData(5, KileStruct::Sect, "subsubsection");
+ m_dictStructLevel["\\paragraph"]=KileStructData(6, KileStruct::Sect, "subsubsection");
+ m_dictStructLevel["\\subparagraph"]=KileStructData(7, KileStruct::Sect, "subsubsection");
+ m_dictStructLevel["\\bibliography"]=KileStructData(0,KileStruct::Bibliography, "viewbib");
+
+ // hidden commands
+ m_dictStructLevel["\\usepackage"]=KileStructData(KileStruct::Hidden, KileStruct::Package);
+ m_dictStructLevel["\\newcommand"]=KileStructData(KileStruct::Hidden, KileStruct::NewCommand);
+ m_dictStructLevel["\\newlength"]=KileStructData(KileStruct::Hidden, KileStruct::NewCommand);
+ m_dictStructLevel["\\newenvironment"]=KileStructData(KileStruct::Hidden, KileStruct::NewEnvironment);
+ m_dictStructLevel["\\addunit"]=KileStructData(KileStruct::Hidden, KileStruct::NewCommand); // hack to get support for the fancyunits package until we can configure the commands in the gui (tbraun)
+ m_dictStructLevel["\\DeclareMathOperator"]=KileStructData(KileStruct::Hidden, KileStruct::NewCommand); // amsmath package
+ m_dictStructLevel["\\caption"]=KileStructData(KileStruct::Hidden,KileStruct::Caption);
+
+ // bibitems
+ if ( m_showStructureBibitems )
+ {
+ m_dictStructLevel["\\bibitem"]= KileStructData(KileStruct::NotSpecified, KileStruct::BibItem, QString::null, "bibs");
+ }
+
+ // graphics
+ if ( m_showStructureGraphics )
+ {
+ m_dictStructLevel["\\includegraphics"]=KileStructData(KileStruct::Object,KileStruct::Graphics, "graphics");
+ }
+
+ // float environments
+ if ( m_showStructureFloats )
+ {
+ m_dictStructLevel["\\begin"]=KileStructData(KileStruct::Object,KileStruct::BeginEnv);
+ m_dictStructLevel["\\end"]=KileStructData(KileStruct::Hidden,KileStruct::EndEnv);
+
+ // some entries, which could never be found (but they are set manually)
+ m_dictStructLevel["\\begin{figure}"]=KileStructData(KileStruct::Object,KileStruct::BeginFloat, "frame_image");
+ m_dictStructLevel["\\begin{figure*}"]=KileStructData(KileStruct::Object,KileStruct::BeginFloat, "frame_image");
+ m_dictStructLevel["\\begin{table}"]=KileStructData(KileStruct::Object,KileStruct::BeginFloat, "frame_spreadsheet");
+ m_dictStructLevel["\\end{float}"]=KileStructData(KileStruct::Hidden,KileStruct::EndFloat);
+ }
+
+ // preliminary minimal beamer support
+ m_dictStructLevel["\\frame"]=KileStructData(KileStruct::Object, KileStruct::BeamerFrame, "beamerframe");
+ m_dictStructLevel["\\frametitle"]=KileStructData(KileStruct::Hidden, KileStruct::BeamerFrametitle);
+ m_dictStructLevel["\\begin{frame}"]=KileStructData(KileStruct::Object, KileStruct::BeamerBeginFrame, "beamerframe");
+ m_dictStructLevel["\\end{frame}"]=KileStructData(KileStruct::Hidden, KileStruct::BeamerEndFrame);
+ m_dictStructLevel["\\begin{block}"]=KileStructData(KileStruct::Object, KileStruct::BeamerBeginBlock, "beamerblock");
+
+ // add user defined commands
+
+ QStringList list;
+ QStringList::ConstIterator it;
+
+ // labels, we also gather them
+ m_commands->commandList(list,KileDocument::CmdAttrLabel,false);
+ for ( it=list.begin(); it != list.end(); ++it )
+ m_dictStructLevel[*it]= KileStructData(KileStruct::NotSpecified, KileStruct::Label, QString::null, "labels");
+
+ // input files
+ if ( m_showStructureInputFiles )
+ {
+ m_commands->commandList(list,KileDocument::CmdAttrIncludes,false);
+ for ( it=list.begin(); it != list.end(); ++it )
+ m_dictStructLevel[*it]= KileStructData(KileStruct::File, KileStruct::Input, "include");
+ }
+
+ // references
+ if ( m_showStructureReferences )
+ {
+ m_commands->commandList(list,KileDocument::CmdAttrReference,false);
+ for ( it=list.begin(); it != list.end(); ++it )
+ m_dictStructLevel[*it]= KileStructData(KileStruct::Hidden, KileStruct::Reference);
+ }
+}
+
+void LaTeXInfo::installEventFilters(KTextEditor::View *view)
+{
+ view->focusProxy()->installEventFilter(m_eventFilter);
+}
+
+void LaTeXInfo::removeInstalledEventFilters(KTextEditor::View *view)
+{
+ view->focusProxy()->removeEventFilter(m_eventFilter);
+}
+
+BracketResult LaTeXInfo::matchBracket(uint &l, uint &pos)
+{
+ BracketResult result;
+ TodoResult todo;
+
+ if ( m_doc->textLine(l)[pos] == '[' )
+ {
+ result.option = TextInfo::matchBracket('[', l, pos);
+ int p = 0;
+ while ( l < m_doc->numLines() )
+ {
+ if ( (p = getTextline(l,todo).find('{', pos)) != -1 )
+ {
+ pos = p;
+ break;
+ }
+ else
+ {
+ pos = 0;
+ ++l;
+ }
+ }
+ }
+
+ if ( m_doc->textLine(l)[pos] == '{' )
+ {
+ result.line = l;
+ result.col = pos;
+ result.value = TextInfo::matchBracket('{', l, pos);
+ }
+
+ return result;
+}
+
+//FIXME refactor, clean this mess up
+void LaTeXInfo::updateStruct()
+{
+ KILE_DEBUG() << "==void TeXInfo::updateStruct: (" << url() << ")=========" << endl;
+
+ if ( getDoc() == 0L )
+ return;
+
+ Info::updateStruct();
+
+ QMapConstIterator<QString,KileStructData> it;
+ static QRegExp::QRegExp reCommand("(\\\\[a-zA-Z]+)\\s*\\*?\\s*(\\{|\\[)");
+ static QRegExp::QRegExp reRoot("\\\\documentclass|\\\\documentstyle");
+ static QRegExp::QRegExp reBD("\\\\begin\\s*\\{\\s*document\\s*\\}");
+ static QRegExp::QRegExp reReNewCommand("\\\\renewcommand.*$");
+ static QRegExp::QRegExp reNumOfParams("\\s*\\[([1-9]+)\\]");
+ static QRegExp::QRegExp reNumOfOptParams("\\s*\\[([1-9]+)\\]\\s*\\[([^\\{]*)\\]"); // the quantifier * isn't used by mistake, because also emtpy optional brackets are correct.
+
+ int teller=0, tagStart, bd = 0;
+ uint tagEnd, tagLine = 0, tagCol = 0;
+ uint tagStartLine = 0, tagStartCol = 0;
+ BracketResult result;
+ QString m, s, shorthand;
+ bool foundBD = false; // found \begin { document }
+ bool fire = true; //whether or not we should emit a foundItem signal
+ bool fireSuspended; // found an item, but it should not be fired (this time)
+ TodoResult todo;
+
+ for(uint i = 0; i < m_doc->numLines(); ++i)
+ {
+ if (teller > 100)
+ {
+ teller=0;
+ kapp->processEvents();
+ }
+ else
+ ++teller;
+
+ tagStart=tagEnd=0;
+ fire = true;
+ s = getTextline(i,todo);
+ if ( todo.type!=-1 && m_showStructureTodo )
+ {
+ QString folder = ( todo.type == KileStruct::ToDo ) ? "todo" : "fixme";
+ emit( foundItem(todo.comment, i+1, todo.colComment, todo.type, KileStruct::Object, i+1, todo.colTag, QString::null, folder) );
+ }
+
+
+ if ( s.isEmpty() )
+ continue;
+
+ //ignore renewcommands
+ s.replace(reReNewCommand, "");
+
+ //find all commands in this line
+ while (tagStart != -1)
+ {
+ if ( (!foundBD) && ( (bd = s.find(reBD, tagEnd)) != -1))
+ {
+ KILE_DEBUG() << "\tfound \\begin{document}" << endl;
+ foundBD = true;
+ if ( bd == 0 ) m_preamble = m_doc->text(0, 0, i - 1, m_doc->textLine(i - 1).length() );
+ else m_preamble = m_doc->text(0, 0, i, bd);
+ }
+
+ if ((!foundBD) && (s.find(reRoot, tagEnd) != -1))
+ {
+ KILE_DEBUG() << "\tsetting m_bIsRoot to true" << endl;
+ tagEnd += reRoot.cap(0).length();
+ m_bIsRoot = true;
+ }
+
+ tagStart = reCommand.search(s,tagEnd);
+ m=QString::null;
+ shorthand = QString::null;
+
+ if (tagStart != -1)
+ {
+ tagEnd = tagStart + reCommand.cap(0).length()-1;
+
+ //look up the command in the dictionary
+ it = m_dictStructLevel.find(reCommand.cap(1));
+
+ //if it is was a structure element, find the title (or label)
+ if (it != m_dictStructLevel.end())
+ {
+ tagLine = i+1;
+ tagCol = tagEnd+1;
+ tagStartLine = tagLine;
+ tagStartCol = tagStart+1;
+ if ( reCommand.cap(1) != "\\frame" )
+ {
+ result = matchBracket(i, static_cast<uint&>(tagEnd));
+ m = result.value.stripWhiteSpace();
+ shorthand = result.option.stripWhiteSpace();
+ if ( i >= tagLine ) //matching brackets spanned multiple lines
+ s = m_doc->textLine(i);
+ if ( result.line>0 || result.col>0 )
+ {
+ tagLine = result.line + 1;
+ tagCol = result.col + 1;
+ }
+ //KILE_DEBUG() << "\tgrabbed: " << reCommand.cap(1) << "[" << shorthand << "]{" << m << "}" << endl;
+ }
+ else
+ {
+ m = i18n("Frame");
+ }
+ }
+
+ //title (or label) found, add the element to the listview
+ if ( !m.isNull() )
+ {
+ // no problems so far ...
+ fireSuspended = false;
+
+ // remove trailing ./
+ if ( (*it).type & (KileStruct::Input | KileStruct::Graphics) )
+ {
+ if ( m.left(2) == "./" )
+ m = m.mid(2,m.length()-2);
+ }
+ // update parameter for environments, because only
+ // floating environments and beamer frames are passed
+ if ( (*it).type == KileStruct::BeginEnv )
+ {
+ if ( m=="figure" || m=="figure*" || m=="table" )
+ {
+ it = m_dictStructLevel.find("\\begin{" + m +'}');
+ }
+ else if ( m == "frame" )
+ {
+ it = m_dictStructLevel.find("\\begin{frame}");
+ m = i18n("Frame");
+ }
+ else if ( m=="block" || m=="exampleblock" || m=="alertblock")
+ {
+ const QString untitledBlockDisplayName = i18n("Untitled Block");
+ it = m_dictStructLevel.find("\\begin{block}");
+ if ( s.at(tagEnd+1) == '{' )
+ {
+ tagEnd++;
+ result = matchBracket(i, static_cast<uint&>(tagEnd));
+ m = result.value.stripWhiteSpace();
+ if(m.isEmpty()) {
+ m = untitledBlockDisplayName;
+ }
+ }
+ else
+ m = untitledBlockDisplayName;
+ }
+ else
+ fireSuspended = true; // only floats and beamer frames, no other environments
+ }
+
+ // tell structure view that a floating environment or a beamer frame must be closed
+ else if ( (*it).type == KileStruct::EndEnv )
+ {
+ if ( m=="figure" || m== "figure*" || m=="table")
+ {
+ it = m_dictStructLevel.find("\\end{float}");
+ }
+ else if ( m == "frame" )
+ {
+ it = m_dictStructLevel.find("\\end{frame}");
+ }
+ else
+ fireSuspended = true; // only floats, no other environments
+ }
+
+ // sectioning commands
+ else if ( (*it).type == KileStruct::Sect )
+ {
+ if ( ! shorthand.isNull() )
+ m = shorthand;
+ }
+
+ // update the label list
+ else if ( (*it).type == KileStruct::Label )
+ {
+ m_labels.append(m);
+ // label entry as child of sectioning
+ if ( m_showSectioningLabels )
+ {
+ emit( foundItem(m, tagLine, tagCol, KileStruct::Label, KileStruct::Object, tagStartLine, tagStartCol, "label", "root") );
+ fireSuspended = true;
+ }
+ }
+
+ // update the references list
+ else if ( (*it).type == KileStruct::Reference )
+ {
+ // m_references.append(m);
+ //fireSuspended = true; // don't emit references
+ }
+
+ // update the dependencies
+ else if ((*it).type == KileStruct::Input)
+ {
+ // \input- or \include-commands can be used without extension. So we check
+ // if an extension exists. If not the default extension is added
+ // ( LaTeX reference says that this is '.tex'). This assures that
+ // all files, which are listed in the structure view, have an extension.
+ QString ext = QFileInfo(m).extension();
+ if ( ext.isEmpty() )
+ m += m_extensions->latexDocumentDefault();
+ m_deps.append(m);
+ }
+
+ // update the referenced Bib files
+ else if( (*it).type == KileStruct::Bibliography )
+ {
+ KILE_DEBUG() << "===TeXInfo::updateStruct()===appending Bibiliograph file(s) " << m << endl;
+
+ QStringList bibs = QStringList::split(",", m);
+ QString biblio;
+
+ // assure that all files have an extension
+ QString bibext = m_extensions->bibtexDefault();
+ int bibextlen = bibext.length();
+
+ uint cumlen = 0;
+ int nextbib = 0; // length to add to jump to the next bibliography
+ for (uint b = 0; b < bibs.count(); ++b)
+ {
+ nextbib = 0;
+ biblio=bibs[b];
+ m_bibliography.append(biblio);
+ if ( biblio.left(2) == "./" )
+ { nextbib += 2;
+ biblio = biblio.mid(2,biblio.length()-2);
+ }
+ if ( biblio.right(bibextlen) != bibext )
+ {
+ biblio += bibext;
+ nextbib -= bibextlen;
+ }
+ m_deps.append(biblio);
+ emit( foundItem(biblio, tagLine, tagCol+cumlen, (*it).type, (*it).level, tagStartLine, tagStartCol, (*it).pix, (*it).folder) );
+ cumlen += biblio.length() + 1 + nextbib;
+ }
+ fire = false;
+ }
+
+ // update the bibitem list
+ else if ( (*it).type == KileStruct::BibItem )
+ {
+ //KILE_DEBUG() << "\tappending bibitem " << m << endl;
+ m_bibItems.append(m);
+ }
+
+ // update the package list
+ else if ( (*it).type == KileStruct::Package )
+ {
+ QStringList pckgs = QStringList::split(",", m);
+ uint cumlen = 0;
+ for (uint p = 0; p < pckgs.count(); ++p)
+ {
+ QString package = pckgs[p].stripWhiteSpace();
+ if ( ! package.isEmpty() ) {
+ m_packages.append(package);
+ // hidden, so emit is useless
+ // emit( foundItem(package, tagLine, tagCol+cumlen, (*it).type, (*it).level, tagStartLine, tagStartCol, (*it).pix, (*it).folder) );
+ cumlen += package.length() + 1;
+ }
+ }
+ fire = false;
+ }
+
+ // newcommand found, add it to the newCommands list
+ else if ( (*it).type & ( KileStruct::NewCommand | KileStruct::NewEnvironment ) )
+ {
+ QString optArg, mandArgs;
+
+ //find how many parameters this command takes
+ if ( s.find(reNumOfParams, tagEnd + 1) != -1 )
+ {
+ bool ok;
+ int noo = reNumOfParams.cap(1).toInt(&ok);
+
+ if ( ok )
+ {
+ if(s.find(reNumOfOptParams, tagEnd + 1) != -1)
+ {
+ KILE_DEBUG() << "Opt param is " << reNumOfOptParams.cap(2) << "%EOL" << endl;
+ noo--; // if we have an opt argument, we have one mandatory argument less, and noo=0 can't occur because then latex complains (and we don't macht them with reNumOfParams either)
+ optArg = '[' + reNumOfOptParams.cap(2) + ']';
+ }
+
+ for ( int noo_index = 0; noo_index < noo; ++noo_index)
+ {
+ mandArgs += '{' + s_bullet + '}';
+ }
+
+ }
+ if( !optArg.isEmpty() )
+ {
+ if( (*it).type == KileStruct::NewEnvironment)
+ {
+ m_newCommands.append(QString("\\begin{%1}%2%3").arg(m).arg(optArg).arg(mandArgs));
+ }
+ else
+ m_newCommands.append(m + optArg + mandArgs);
+ }
+ }
+ if( (*it).type == KileStruct::NewEnvironment)
+ {
+ m_newCommands.append(QString("\\begin{%1}%3").arg(m).arg(mandArgs));
+ m_newCommands.append(QString("\\end{%1}").arg(m));
+ }
+ else
+ m_newCommands.append(m + mandArgs);
+
+ //FIXME set tagEnd to the end of the command definition
+ break;
+ }
+ // and some other commands, which don't need special actions:
+ // \caption, ...
+
+ // KILE_DEBUG() << "\t\temitting: " << m << endl;
+ if ( fire && !fireSuspended )
+ emit( foundItem(m, tagLine, tagCol, (*it).type, (*it).level, tagStartLine, tagStartCol, (*it).pix, (*it).folder) );
+ } //if m
+ } // if tagStart
+ } // while tagStart
+ } //for
+
+ checkChangedDeps();
+ emit(doneUpdating());
+ emit(isrootChanged(isLaTeXRoot()));
+}
+
+void LaTeXInfo::checkChangedDeps()
+{
+ if( m_depsPrev != m_deps )
+ {
+ KILE_DEBUG() << "===void LaTeXInfo::checkChangedDeps()===, deps have changed"<< endl;
+ emit(depChanged());
+ m_depsPrev = m_deps;
+ }
+}
+
+BibInfo::BibInfo (Kate::Document *doc, Extensions *extensions, LatexCommands* /* commands */) : TextInfo(doc, extensions, "BibTeX")
+{
+ documentTypePromotionAllowed = false;
+}
+
+BibInfo::~BibInfo()
+{
+}
+
+bool BibInfo::isLaTeXRoot()
+{
+ return false;
+}
+
+void BibInfo::updateStruct()
+{
+ if ( getDoc() == 0L ) return;
+
+ Info::updateStruct();
+
+ KILE_DEBUG() << "==void BibInfo::updateStruct()========" << endl;
+
+ static QRegExp::QRegExp reItem("^(\\s*)@([a-zA-Z]+)");
+ static QRegExp::QRegExp reSpecial("string|preamble|comment");
+
+ QString s, key;
+ int col = 0, startcol, startline = 0;
+
+ for(uint i = 0; i < m_doc->numLines(); ++i)
+ {
+ s = m_doc->textLine(i);
+ if ( (s.find(reItem) != -1) && !reSpecial.exactMatch(reItem.cap(2).lower()) )
+ {
+ KILE_DEBUG() << "found: " << reItem.cap(2) << endl;
+ //start looking for key
+ key = "";
+ bool keystarted = false;
+ int state = 0;
+ startcol = reItem.cap(1).length();
+ col = startcol + reItem.cap(2).length();
+
+ while ( col < static_cast<int>(s.length()) )
+ {
+ ++col;
+ if ( col == static_cast<int>(s.length()) )
+ {
+ do
+ {
+ ++i;
+ s = m_doc->textLine(i);
+ } while ( (s.length() == 0) && (i < m_doc->numLines()) );
+
+ if ( i == m_doc->numLines() ) break;
+ col = 0;
+ }
+
+ if ( state == 0 )
+ {
+ if ( s[col] == '{' ) state = 1;
+ else if ( ! s[col].isSpace() ) break;
+ }
+ else if ( state == 1 )
+ {
+ if ( s[col] == ',' )
+ {
+ key = key.stripWhiteSpace();
+ KILE_DEBUG() << "found: " << key << endl;
+ m_bibItems.append(key);
+ emit(foundItem(key, startline+1, startcol, KileStruct::BibItem, 0, startline+1, startcol, "viewbib", reItem.cap(2).lower()) );
+ break;
+ }
+ else
+ {
+ key += s[col];
+ if (!keystarted) { startcol = col; startline = i; }
+ keystarted=true;
+ }
+ }
+ }
+ }
+ }
+
+ emit(doneUpdating());
+}
+
+Type BibInfo::getType()
+{
+ return BibTeX;
+}
+
+QString BibInfo::getFileFilter() const
+{
+ return m_extensions->bibtexFileFilter();
+}
+
+ScriptInfo::ScriptInfo(Kate::Document *doc, Extensions *extensions ) : TextInfo(doc, extensions, "JavaScript")
+{
+ documentTypePromotionAllowed = false;
+}
+
+ScriptInfo::~ScriptInfo()
+{
+}
+
+bool ScriptInfo::isLaTeXRoot()
+{
+ return false;
+}
+
+Type ScriptInfo::getType()
+{
+ return Script;
+}
+
+QString ScriptInfo::getFileFilter() const
+{
+ return m_extensions->scriptFileFilter();
+}
+
+}
+
+#include "kiledocumentinfo.moc"
diff --git a/src/kile/kiledocumentinfo.h b/src/kile/kiledocumentinfo.h
new file mode 100644
index 0000000..fc534ef
--- /dev/null
+++ b/src/kile/kiledocumentinfo.h
@@ -0,0 +1,389 @@
+/*************************************************************************************
+ begin : Sun Jul 20 2003
+ copyright : (C) 2003 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
+ (C) 2006 by Michel Ludwig (michel.ludwig@kdemail.net)
+ *************************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEDOCUMENTINFO_H
+#define KILEDOCUMENTINFO_H
+
+#include <kate/document.h>
+#include "kiledebug.h"
+#include <klistview.h>
+#include <kurl.h>
+#include <kdialogbase.h>
+#include <latexcmd.h>
+
+#include "kileconstants.h"
+#include "kileextensions.h"
+
+#define TEX_CAT0 '\\'
+#define TEX_CAT1 '{'
+#define TEX_CAT2 '}'
+#define TEX_CAT3 '$'
+#define TEX_CAT4 '&'
+#define TEX_CAT6 '#'
+#define TEX_CAT7 '^'
+#define TEX_CAT8 '_'
+#define TEX_CAT13 '~'
+#define TEX_CAT14 '%'
+
+#define SIZE_STAT_ARRAY 6
+
+namespace KileStruct
+{
+ //Different types of elements in the structure view
+ enum
+ {
+ None = 0x1, Label = 0x2, Sect = 0x4, Input = 0x8,
+ BibItem = 0x10, Bibliography = 0x20, Package = 0x40, NewCommand = 0x80,
+ Graphics = 0x100, Reference = 0x200, BeginEnv = 0x400, EndEnv = 0x800,
+ BeginFloat = 0x1000, EndFloat = 0x2000, Caption = 0x4000, BeamerFrame = 0x8000,
+ BeamerBeginFrame = 0x10000, BeamerEndFrame = 0x20000, BeamerFrametitle = 0x40000, BeamerBeginBlock = 0x80000,
+ ToDo = 0x100000, FixMe = 0x200000, NewEnvironment = 0x400000
+ };
+
+ //Different levels (in the parent-child hierarchy) in the structure view
+ enum
+ {
+ Hidden = -4, NotSpecified = -3, Object = -2, File = -1
+ };
+}
+
+/**
+ * A convenience class to store info about how LaTeX elements should appear in the
+ * structure view. A QMap<QString, KileStructData> should be created, so that the
+ * actual LaTeX elements can be mapped to this class.
+ **/
+class KileStructData
+{
+public:
+ KileStructData(int lvl = 0, int tp = KileStruct::None, QString px = QString::null, QString fldr = "root" ) : level(lvl), type(tp), pix(px), folder(fldr) {}
+ /** At which level the element should be visible **/
+ int level;
+ /** The type of element (see @ref KileStruct) **/
+ int type;
+ /** The name of the icon that goes with this element. The icon is located using SmallIcon(pix). **/
+ QString pix, folder;
+};
+
+/**
+ * KileDocument::Info is a decorator class for the Document class. We can't derive a class from an interface
+ * without implementing the interface, a decorator class is a way to add some functionality to the Document class.
+ **/
+
+namespace KileDocument
+{
+
+struct BracketResult
+{
+ BracketResult() : option(QString::null), value(QString::null), line(0), col(0) {}
+ QString option, value;
+ int line, col;
+};
+
+struct TodoResult
+{
+ int type;
+ uint colTag;
+ uint colComment;
+ QString comment;
+};
+
+class Info : public QObject
+{
+ Q_OBJECT
+
+public:
+ static bool containsInvalidCharacters(const KURL&);
+ static KURL repairInvalidCharacters(const KURL&, bool checkForFileExistence = true);
+ static KURL repairExtension(const KURL&, bool checkForFileExistence = true);
+ static KURL makeValidTeXURL(const KURL & url, bool istexfile, bool checkForFileExistence = true);
+ static KURL renameIfExist(const KURL& url);
+
+public:
+ Info();
+ ~Info();
+
+ const QStringList* labels() const{ return &m_labels; }
+ const QStringList* bibItems() const { return &m_bibItems; }
+ const QStringList* dependencies() const {return &m_deps; }
+ const QStringList* bibliographies() const { return &m_bibliography; }
+ const QStringList* packages() const { return &m_packages; }
+ const QStringList* newCommands() const { return &m_newCommands; }
+
+ QString lastModifiedFile(const QStringList *list = 0L);
+
+ bool openStructureLabels() { return m_openStructureLabels; }
+ bool openStructureReferences() { return m_openStructureReferences; }
+ bool openStructureBibitems() { return m_openStructureBibitems; }
+ bool openStructureTodo() { return m_openStructureTodo; }
+
+ bool showStructureLabels() { return m_showStructureLabels; }
+
+
+ const QString & preamble() const { return m_preamble; }
+
+ virtual bool isLaTeXRoot() { return m_bIsRoot; }
+
+ virtual KURL url();
+
+ virtual void updateStructLevelInfo();
+
+ void setBaseDirectory(const KURL& url);
+ const KURL& getBaseDirectory() const;
+
+ virtual bool isTextDocument();
+ virtual Type getType();
+
+ /**
+ * Returns a file filter suitable for loading and saving files of this class' type.
+ **/
+ virtual QString getFileFilter() const;
+
+ virtual bool isDocumentTypePromotionAllowed();
+ void setDocumentTypePromotionAllowed(bool b);
+
+public slots:
+ /**
+ * Never call this function directly, use KileWidget::Structure::update(KileDocument::Info *, bool) instead
+ **/
+ virtual void updateStruct();
+ virtual void updateBibItems();
+
+signals:
+ void urlChanged(KileDocument::Info* info, const KURL& url);
+ void isrootChanged(bool);
+
+ void foundItem(const QString &title, uint line, uint column, int type, int level, uint startline, uint startcol,
+ const QString & pix, const QString & folder);
+ void doneUpdating();
+ void depChanged();
+ void completed(KileDocument::Info* info);
+
+protected slots:
+ void slotCompleted();
+
+protected:
+ void count(const QString line, long *stat);
+
+protected:
+ enum State
+ {
+ stStandard=0, stComment=1, stControlSequence=3, stControlSymbol=4,
+ stCommand=5,stEnvironment=6
+ };
+
+protected:
+ bool m_bIsRoot;
+ QStringList m_labels;
+ QStringList m_bibItems;
+ QStringList m_deps, m_depsPrev;
+ QStringList m_bibliography;
+ QStringList m_packages;
+ QStringList m_newCommands;
+ QString m_preamble;
+ QMap<QString,KileStructData> m_dictStructLevel;
+ KURL m_url;
+ KConfig *m_config;
+ bool m_showStructureLabels;
+ bool m_showStructureBibitems;
+ bool m_showStructureGraphics;
+ bool m_showStructureFloats;
+ bool m_showStructureReferences;
+ bool m_showStructureInputFiles;
+ bool m_showStructureTodo;
+ bool m_showSectioningLabels;
+ bool m_openStructureLabels;
+ bool m_openStructureReferences;
+ bool m_openStructureBibitems;
+ bool m_openStructureTodo;
+ KURL m_baseDirectory;
+ bool documentTypePromotionAllowed;
+ Extensions *m_extensions;
+};
+
+
+/**
+ * The URL of a text document is managed directly by the corresponding Kate::Document.
+ **/
+class TextInfo : public Info
+{
+ Q_OBJECT
+public:
+ /**
+ * @param defaultHighlightMode the highlight mode that will be set automatically
+ * once a new document is installed
+ **/
+ TextInfo(Kate::Document *doc, Extensions *extensions, const QString& defaultHighlightMode = QString::null);
+ virtual ~TextInfo();
+
+ /**
+ * @returns the document for which this class is a decorator
+ **/
+ const Kate::Document* getDoc() const;
+ Kate::Document* getDoc();
+ void setDoc(Kate::Document *doc);
+ void detach();
+
+ /**
+ * Used by @ref KileDocInfoDlg to display statistics of the Document.
+ * @returns an array with some statistical data of the document.
+ * The array is filled as follows: [0] = #c in words, [1] = #c in latex commands and environments,
+ [2] = #c whitespace, [3] = #words, [4] = # latex_commands, [5] = latex_environments **/
+
+ virtual const long* getStatistics();
+
+ /**
+ * @returns the URL of the Kate::Document.
+ **/
+ virtual KURL url();
+
+ virtual Type getType();
+
+ bool isTextDocument();
+
+ void setHighlightMode(const QString & highlight = QString::null);
+
+ void setDefaultHightlightMode(const QString& string);
+
+ /**
+ * "Overridden" method that installs custom event filters by using the "installEventFilters"
+ * method.
+ * @warning Only this method should be used to create new views for text documents !
+ * @return NULL if no document is set (m_doc == NULL)
+ **/
+ KTextEditor::View* createView(QWidget *parent, const char *name=0);
+
+protected slots:
+ void slotFileNameChanged();
+
+protected:
+ Kate::Document *m_doc;
+ long *m_arStatistics;
+ QString m_defaultHighlightMode;
+
+ QString matchBracket(QChar c, uint &, uint &);
+ QString getTextline(uint line, TodoResult &todo);
+ void searchTodoComment(const QString &s, uint startpos, TodoResult &todo);
+
+ /**
+ * Installs an event filter on a view. Subclasses can override this method to
+ * provide custom event filters. The default implementation does nothing. Whenever this
+ * method is overridden, "removeInstalledEventFilters" should be overridden as well.
+ * @param view the view that is considered
+ **/
+ virtual void installEventFilters(KTextEditor::View *view);
+
+ /**
+ * Removes the event filters that were previously installed by the "installEventFilters"
+ * function. Subclasses can override this method to remove custom event filters. The
+ * default implementation does nothing.
+ * @param view the view that is considered
+ **/
+ virtual void removeInstalledEventFilters(KTextEditor::View *view);
+
+ /**
+ * Installs the event filters on all the views that are currently open for the
+ * managed document object. The function "installEventFilters(KTextEditor::View *view)
+ * function is used for a specific view.
+ **/
+ void installEventFilters();
+
+ /**
+ * Removes the event filters from all the views that are currently open for the
+ * managed document object. The function "removeInstalledEventFilters(KTextEditor::View *view)
+ * function is used for a specific view.
+ **/
+ void removeInstalledEventFilters();
+};
+
+
+
+class LaTeXInfo : public TextInfo
+{
+ Q_OBJECT
+
+public:
+ /**
+ * @param eventFilter the event filter that will be installed on managed documents
+ **/
+ LaTeXInfo(Kate::Document *doc, Extensions *extensions, LatexCommands *commands, const QObject* eventFilter);
+ virtual ~LaTeXInfo();
+
+ const long* getStatistics();
+
+ virtual Type getType();
+
+ virtual QString getFileFilter() const;
+
+public slots:
+ virtual void updateStruct();
+
+protected:
+ LatexCommands *m_commands;
+ const QObject *m_eventFilter;
+
+ virtual void updateStructLevelInfo();
+ virtual void checkChangedDeps();
+ /**
+ * Installs a custom event filter.
+ **/
+ virtual void installEventFilters(KTextEditor::View *view);
+
+ /**
+ * Revmoves the custom event filter.
+ **/
+ virtual void removeInstalledEventFilters(KTextEditor::View *view);
+
+private:
+ BracketResult matchBracket(uint &, uint &);
+};
+
+
+
+class BibInfo : public TextInfo
+{
+ Q_OBJECT
+
+public:
+ BibInfo (Kate::Document *doc, Extensions *extensions, LatexCommands* commands);
+ virtual ~BibInfo();
+
+ virtual bool isLaTeXRoot();
+
+ virtual Type getType();
+
+ virtual QString getFileFilter() const;
+
+public slots:
+ virtual void updateStruct();
+};
+
+class ScriptInfo : public TextInfo
+{
+ Q_OBJECT
+
+public:
+ ScriptInfo(Kate::Document *doc, Extensions *extensions);
+ virtual ~ScriptInfo();
+
+ virtual bool isLaTeXRoot();
+
+ virtual Type getType();
+
+ virtual QString getFileFilter() const;
+};
+
+}
+#endif
+
diff --git a/src/kile/kileedit.cpp b/src/kile/kileedit.cpp
new file mode 100644
index 0000000..44c0ba4
--- /dev/null
+++ b/src/kile/kileedit.cpp
@@ -0,0 +1,2728 @@
+/***************************************************************************
+ date : Mar 12 2007
+ version : 0.46
+ copyright : (C) 2004-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kileedit.h"
+
+#include <qfileinfo.h>
+#include <qvaluestack.h>
+#include <qclipboard.h>
+#include <qapplication.h>
+
+#include <kate/view.h>
+#include <kate/document.h>
+#include <ktexteditor/searchinterface.h>
+#include <ktexteditor/editinterfaceext.h>
+#include <klocale.h>
+#include <kinputdialog.h>
+#include <kstandarddirs.h>
+
+#include "kilekonsolewidget.h"
+#include "kileinfo.h"
+#include "kileviewmanager.h"
+#include "kileconfig.h"
+#include "kileactions.h"
+
+#include "kiletool_enums.h"
+#include "kilelogwidget.h"
+#include "kileextensions.h"
+#include "quickpreview.h"
+
+namespace KileDocument
+{
+
+EditorExtension::EditorExtension(KileInfo *info) : m_ki(info)
+{
+ m_complete = new KileDocument::CodeCompletion(m_ki);
+ m_latexCommands = m_ki->latexCommands();
+
+ // init regexp
+ m_reg.setPattern("(\\\\(begin|end)\\s*\\{([A-Za-z]+\\*?)\\})|(\\\\\\[|\\\\\\])");
+ // 1 2 3 4
+ m_regexpEnter.setPattern("^(.*)((\\\\begin\\s*\\{([^\\{\\}]*)\\})|(\\\\\\[))");
+ // 1 23 4 5
+
+ // init double quotes
+ m_quoteList
+ << "English quotes: `` ''"
+ << "French quotes: \"< \">"
+ << "German quotes: \"` \"'"
+ << "French quotes (long): \\flqq \\frqq"
+ << "German quotes (long): \\glqq \\grqq"
+ << "Icelandic quotes (v1): \\ilqq \\irqq"
+ << "Icelandic quotes (v2): \\iflqq \\ifrqq"
+ << "Czech quotes: \\uv{ }"
+ ;
+
+ readConfig();
+}
+
+EditorExtension::~EditorExtension()
+{
+ delete m_complete;
+}
+
+//////////////////// read configuration ////////////////////
+
+void EditorExtension::readConfig(void)
+{
+ // init insertion of double quotes
+ initDoubleQuotes();
+
+ // calculate indent for autoindent of environments
+ m_envAutoIndent = QString::null;
+ if ( KileConfig::envIndentation() )
+ {
+ if ( KileConfig::envIndentSpaces() )
+ {
+ int num = KileConfig::envIndentNumSpaces();
+ if ( num<1 || num>9 )
+ num = 1;
+ m_envAutoIndent.fill(' ',num);
+ }
+ else
+ {
+ m_envAutoIndent = "\t";
+ }
+ }
+}
+
+void EditorExtension::insertTag(const KileAction::TagData& data, Kate::View *view)
+{
+ Kate::Document *doc = view->getDoc();
+ if ( !doc) return;
+
+ //whether or not to wrap tag around selection
+ bool wrap = ( (!data.tagEnd.isNull()) && doc->hasSelection());
+
+ //%C before or after the selection
+ bool before = data.tagBegin.contains("%C");
+ bool after = data.tagEnd.contains("%C");
+
+ //save current cursor position
+ int para=view->cursorLine();
+ int para_begin=para;
+ int index=view->cursorColumnReal();
+ int index_begin=index;
+ int para_end=0;
+ int index_cursor=index;
+ int para_cursor=index;
+ // offset for autoindentation of environments
+ int dxIndentEnv = 0;
+
+ // environment tag
+ bool envtag = data.tagBegin.contains("%E") || data.tagEnd.contains("%E");
+ QString whitespace = getWhiteSpace( doc->textLine(para).left(index) );
+
+ //if there is a selection act as if cursor is at the beginning of selection
+ if (wrap)
+ {
+ index = doc->selStartCol();
+ para = doc->selStartLine();
+ para_end = doc->selEndLine();
+ }
+
+ QString ins = data.tagBegin;
+ QString tagEnd = data.tagEnd;
+
+ //start an atomic editing sequence
+ KTextEditor::EditInterfaceExt *editInterfaceExt = KTextEditor::editInterfaceExt( doc );
+ if ( editInterfaceExt ) editInterfaceExt->editBegin();
+
+ //cut the selected text
+ QString trailing;
+ if (wrap)
+ {
+ QString sel = doc->selection();
+ doc->removeSelectedText();
+
+ // no autoindentation of environments, when text is selected
+ if ( envtag )
+ {
+ ins.remove("%E");
+ tagEnd.remove("%E\n");
+ }
+
+ // strip one of two consecutive line ends
+ int len = sel.length();
+ if ( tagEnd.at(0)=='\n' && len>0 && sel.find('\n',-1)==len-1 )
+ sel.truncate( len-1 );
+
+ // now add the selection
+ ins += sel;
+
+ // place the cursor behind this tag, if there is no other wish
+ if ( !before && !after )
+ {
+ trailing = "%C";
+ after = true;
+ }
+ }
+ else if ( envtag )
+ {
+ ins.replace("%E",whitespace+m_envAutoIndent);
+ tagEnd.replace("%E",whitespace+m_envAutoIndent);
+ if ( data.dy > 0 )
+ dxIndentEnv = whitespace.length() + m_envAutoIndent.length();
+ }
+
+ tagEnd.replace("\\end{",whitespace+"\\end{");
+ ins += tagEnd + trailing;
+
+ //do some replacements
+ QFileInfo fi( doc->url().path());
+ ins.replace("%S", fi.baseName(true));
+ ins.replace("%B", s_bullet);
+
+ //insert first part of tag at cursor position
+ doc->insertText(para,index,ins);
+
+ //move cursor to the new position
+ if ( before || after )
+ {
+ int n = data.tagBegin.contains("\n")+ data.tagEnd.contains("\n");
+ if (wrap) n += para_end > para ? para_end-para : para-para_end;
+ for (int line = para_begin; line <= para_begin+n; ++line)
+ {
+ if (doc->textLine(line).contains("%C"))
+ {
+ int i=doc->textLine(line).find("%C");
+ para_cursor = line; index_cursor = i;
+ doc->removeText(line,i,line,i+2);
+ break;
+ }
+ index_cursor=index;
+ para_cursor=line;
+ }
+ }
+ else
+ {
+ int py = para_begin, px = index_begin;
+ if (wrap) //act as if cursor was at beginning of selected text (which is the point where the tagBegin is inserted)
+ {
+ py = para;
+ px = index;
+ }
+ para_cursor = py+data.dy; index_cursor = px+data.dx+dxIndentEnv;
+ }
+
+ //end the atomic editing sequence
+ if ( editInterfaceExt ) editInterfaceExt->editEnd();
+
+ //set the cursor position (it is important that this is done outside of the atomic editing sequence)
+ view->setCursorPositionReal(para_cursor, index_cursor);
+
+ doc->clearSelection();
+}
+
+//////////////////// goto environment tag (begin or end) ////////////////////
+
+// goto the next non-nested environment tag
+
+Kate::View* EditorExtension::determineView(Kate::View *view)
+{
+ if (view == 0L)
+ view = m_ki->viewManager()->currentTextView();
+
+ m_overwritemode = (view == 0L) ? false : view->isOverwriteMode();
+
+ return view;
+}
+
+void EditorExtension::gotoEnvironment(bool backwards, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint row,col;
+ EnvData env;
+ bool found;
+
+ // get current position
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+
+ // start searching
+ if ( backwards )
+ {
+ found = findBeginEnvironment(doc,row,col,env);
+ //KILE_DEBUG() << " goto begin env: " << env.row << "/" << env.col << endl;
+
+ }
+ else
+ {
+ found = findEndEnvironment(doc,row,col,env);
+ if ( !m_overwritemode )
+ env.col += env.len;
+ }
+
+ if ( found )
+ view->setCursorPositionReal(env.row,env.col);
+}
+
+// match the opposite environment tag
+
+void EditorExtension::matchEnvironment(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint row,col;
+ EnvData env;
+
+ // get current position
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+
+ // we only start, when we are at an environment tag
+ if ( !isEnvironmentPosition(doc,row,col,env) )
+ return;
+
+ gotoEnvironment( env.tag != EnvBegin,view);
+}
+
+//////////////////// close opened environments ////////////////////
+
+// search for the last opened environment and close it
+
+void EditorExtension::closeEnvironment(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint row,col,currentRow,currentCol;
+ QString name;
+
+ view->cursorPositionReal(&currentRow,&currentCol);
+ if ( findOpenedEnvironment(row,col,name,view) )
+ {
+ if ( name == "\\[" )
+ view->getDoc()->insertText( currentRow,currentCol, "\\]" );
+ else
+ view->getDoc()->insertText( currentRow,currentCol, "\\end{" + name + '}' );
+// view->setCursorPositionReal(row+1,0);
+ }
+}
+
+// close all opened environments
+
+void EditorExtension::closeAllEnvironments(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ QStringList envlist = findOpenedEnvironmentList(view,true);
+ if ( envlist.count() == 0 )
+ return;
+
+ uint currentRow,currentCol,outputCol;
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&currentRow,&currentCol);
+
+ bool indent = ! m_envAutoIndent.isEmpty();
+ if ( indent && currentCol > 0 )
+ {
+ doc->insertText(currentRow,currentCol,"\n");
+ currentRow++;
+ currentCol = 0;
+ }
+
+ bool ok1,ok2;
+ for ( QStringList::Iterator it=envlist.begin(); it!=envlist.end(); ++it )
+ {
+ QStringList entry = QStringList::split(',',*it);
+ if ( entry[0] == "document" )
+ break;
+
+ uint row = entry[1].toUInt(&ok1);
+ uint col = entry[2].toUInt(&ok2);
+ if ( !ok1 || !ok2 )
+ continue;
+
+ outputCol = currentCol;
+ if ( indent )
+ {
+ QString whitespace = getWhiteSpace( doc->textLine(row).left(col) );
+ doc->insertText(currentRow,outputCol,whitespace);
+ outputCol += whitespace.length();
+ }
+ QString endtag = ( entry[0] == "\\[" ) ? "\\]\n" : "\\end{"+entry[0]+"}\n";
+ doc->insertText(currentRow,outputCol,endtag);
+ currentRow++;
+ }
+}
+
+//////////////////// mathgroup ////////////////////
+
+void EditorExtension::selectMathgroup(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint row1,col1,row2,col2;
+ if ( getMathgroup(view,row1,col1,row2,col2) )
+ view->getDoc()->setSelection(row1,col1,row2,col2);
+}
+
+void EditorExtension::deleteMathgroup(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint row1,col1,row2,col2;
+ if ( getMathgroup(view,row1,col1,row2,col2) )
+ {
+ view->getDoc()->clearSelection();
+ view->getDoc()->removeText(row1,col1,row2,col2);
+ view->setCursorPosition(row1,0);
+ }
+}
+
+bool EditorExtension::hasMathgroup(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view )
+ return false;
+
+ uint row1,col1,row2,col2;
+ return getMathgroup(view,row1,col1,row2,col2);
+}
+
+QString EditorExtension::getMathgroupText(uint &row, uint &col, Kate::View *view)
+{
+ uint row1,col1,row2,col2;
+
+ view = determineView(view);
+ if ( view && getMathgroup(view,row1,col1,row2,col2) )
+ {
+ row = row1;
+ col = col1;
+ return view->getDoc()->text(row1,col1,row2,col2);
+ }
+ else
+ return QString::null;
+}
+
+
+bool EditorExtension::getMathgroup(Kate::View *view, uint &row1, uint &col1, uint &row2, uint &col2)
+{
+ QRegExp reg( QString("\\$")
+ + "|\\\\begin\\s*\\{([A-Za-z]+\\*?)\\}"
+ + "|\\\\end\\s*\\{([A-Za-z]+\\*?)\\}"
+ + "|\\\\\\[|\\\\\\]"
+ + "|\\\\\\(|\\\\\\)"
+ );
+
+ uint row,col,r,c;
+ MathData begin,end;
+
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+
+ QString textline = getTextLineReal(doc,row);
+
+ // check for '\ensuremath{...}'
+ QString word;
+ uint x1,x2;
+ if ( getCurrentWord(doc,row,col,smTex,word,x1,x2) && word=="\\ensuremath" )
+ view->setCursorPositionReal(row,x2);
+
+ BracketData open,close;
+ if ( getTexgroup(false,open,close,view) )
+ {
+ QString s = getTextLineReal(doc,open.row);
+ if ( open.col>=11 && s.mid(open.col-11,11)=="\\ensuremath" )
+ {
+ view->setCursorPositionReal(row,col);
+ row1 = open.row;
+ col1 = open.col-11;
+ row2 = close.row;
+ col2 = close.col;
+ return true;
+ }
+ }
+
+ // do we need to restore the cursor position
+ view->setCursorPositionReal(row,col);
+
+ // '$' is difficult, because it is used as opening and closing tag
+ int mode = 0;
+ if ( textline[col] == '$' )
+ mode = 1;
+ else if ( col>0 && textline[col-1]=='$' )
+ mode = 2;
+
+ if ( mode > 0 )
+ {
+ // first look, if this is a closing '$'
+ r = row;
+ c = ( mode == 1 ) ? col : col-1;
+ if ( decreaseCursorPosition(doc,r,c) && findOpenMathTag(doc,r,c,reg,begin) )
+ {
+ if ( begin.tag==mmMathDollar && (begin.numdollar & 1) )
+ {
+ row1 = begin.row;
+ col1 = begin.col;
+ row2 = row;
+ col2 = ( mode == 1 ) ? col+1 : col;
+ return true;
+ }
+ }
+
+ // perhaps an opening '$'
+ r = row;
+ c = ( mode == 1 ) ? col+1 : col;
+ if ( findCloseMathTag(doc,r,c,reg,end) )
+ {
+ if ( end.tag==mmMathDollar )
+ {
+ row1 = row;
+ col1 = ( mode == 1 ) ? col : col-1;
+ row2 = end.row;
+ col2 = end.col + end.len;
+ return true;
+ }
+ }
+
+ // found no mathgroup with '$'
+ return false;
+ }
+
+ // now let's search for all other math tags:
+ // if a mathgroup tag starts in the current column, we save this
+ // position and move the cursor one column to the right
+ bool openingtag = isOpeningMathTagPosition(doc,row,col,begin);
+ if ( openingtag )
+ {
+ // try to find the corresponding closing tag at the right
+ bool closetag = findCloseMathTag(doc,row,col+1,reg,end);
+ if ( closetag && checkMathtags(begin,end) )
+ {
+ row1 = begin.row;
+ col1 = begin.col;
+ row2 = end.row;
+ col2 = end.col + end.len;
+ return true;
+ }
+ }
+
+ r = row;
+ c = col;
+ bool closingtag = isClosingMathTagPosition(doc,row,col,end);
+ if ( closingtag )
+ {
+ c = end.col;
+ if ( ! decreaseCursorPosition(doc,r,c) )
+ return false;
+ }
+
+ // now try to search to opening tag of the math group
+ if ( ! findOpenMathTag(doc,r,c,reg,begin) )
+ return false;
+
+ if ( begin.tag==mmMathDollar && !(begin.numdollar & 1) )
+ {
+ //KILE_DEBUG() << "error: even number of '$' --> no math mode" << endl;
+ return false;
+ }
+
+ // and now the closing tag
+ if ( ! findCloseMathTag(doc,r,c,reg,end) )
+ return false;
+
+ // both tags were found, but they must be of the same type
+ if ( checkMathtags(begin,end) )
+ {
+ row1 = begin.row;
+ col1 = begin.col;
+ row2 = end.row;
+ col2 = end.col + end.len;
+ return true;
+ }
+ else
+ return false;
+}
+
+//////////////////// mathgroup tags ////////////////////
+
+bool EditorExtension::checkMathtags(const MathData &begin,const MathData &end)
+{
+ // both tags were found, but they must be of the same type
+ if ( begin.tag != end.tag )
+ {
+ //KILE_DEBUG() << "error: opening and closing tag of mathmode don't match" << endl;
+ return false;
+ }
+
+ // and additionally: if it is a math env, both tags must have the same name
+ if ( begin.tag==mmDisplaymathEnv && begin.envname!=end.envname )
+ {
+ //KILE_DEBUG() << "error: opening and closing env tags have different names" << endl;
+ return false;
+ }
+
+ return true;
+}
+
+bool EditorExtension::isOpeningMathTagPosition(Kate::Document *doc, uint row, uint col, MathData &mathdata)
+{
+ QString textline = getTextLineReal(doc,row);
+
+ QRegExp reg("\\\\begin\\s*\\{([A-Za-z]+\\*?)\\}|\\\\\\[|\\\\\\(");
+ if ( (int)col != reg.search(textline,col) )
+ return false;
+
+ QChar id = reg.cap(0)[1];
+ QString envname = reg.cap(1);
+
+ mathdata.row = row;
+ mathdata.col = col;
+ mathdata.len = reg.cap(0).length();
+
+ switch ( id )
+ {
+ case 'b' : if ( !(m_latexCommands->isMathEnv(envname) || envname=="math") || m_latexCommands->needsMathMode(envname) )
+ return false;
+ mathdata.tag = ( envname=="math" ) ? mmMathEnv : mmDisplaymathEnv;
+ mathdata.envname = envname;
+ break;
+ case '[' : mathdata.tag = mmDisplaymathParen;
+ break;
+ case '(' : mathdata.tag = mmMathParen;
+ break;
+ }
+
+ return true;
+}
+
+bool EditorExtension::isClosingMathTagPosition(Kate::Document *doc, uint row, uint col,MathData &mathdata)
+{
+ QString textline = doc->textLine(row);
+
+ QRegExp reg("\\\\end\\s*\\{([A-Za-z]+\\*?)\\}|\\\\\\]|\\\\\\)");
+ int pos = reg.searchRev(textline,col);
+ if ( pos<0 || (int)col>pos+reg.matchedLength() )
+ return false;
+
+ QChar id = reg.cap(0)[1];
+ QString envname = reg.cap(1);
+
+ mathdata.row = row;
+ mathdata.col = pos;
+ mathdata.len = reg.cap(0).length();
+
+ switch ( id )
+ {
+ case 'e' : if ( !(m_latexCommands->isMathEnv(envname) || envname=="math") || m_latexCommands->needsMathMode(envname) )
+ return false;
+ mathdata.tag = ( envname=="math" ) ? mmMathEnv : mmDisplaymathEnv;
+ mathdata.envname = envname;
+ break;
+ case ']' : mathdata.tag = mmDisplaymathParen;
+ break;
+ case ')' : mathdata.tag = mmMathParen;
+ break;
+ }
+
+ return true;
+}
+
+bool EditorExtension::findOpenMathTag(Kate::Document *doc, uint row, uint col, QRegExp &reg, MathData &mathdata)
+{
+ uint lastrow,lastcol;
+ QString mathname;
+
+ bool foundDollar= false;
+ uint numDollar = 0;
+
+ KTextEditor::SearchInterface *iface;
+ iface = dynamic_cast<KTextEditor::SearchInterface *>(doc);
+
+ QString textline = getTextLineReal(doc,row);
+ int column = (int)col;
+
+ bool continueSearch = true;
+ while ( continueSearch )
+ {
+ while ( (column = reg.searchRev(textline,col)) != -1 )
+ {
+ col = column;
+
+ mathdata.row = row;
+ mathdata.col = col;
+ mathdata.len = reg.cap(0).length();
+ mathname = reg.cap(0).left(2);
+
+ // should be better called 'isValidChar()', because it checks for comments
+ // and escaped chars like backslash and dollar in '\\' and '\$'
+ if ( mathname == "$" )
+ {
+ // count and continue search
+ numDollar++;
+
+ // but remember the first dollar found backwards
+ if ( ! foundDollar )
+ {
+ lastrow = row;
+ lastcol = col;
+ foundDollar = true;
+ }
+ }
+ else if ( mathname=="\\[" || mathname=="\\(" )
+ {
+ // found start of mathmode
+ if ( numDollar == 0 )
+ {
+ mathdata.tag = ( mathname == "\\[" ) ? mmDisplaymathParen : mmMathParen;
+ mathdata.numdollar = 0;
+ return true;
+ }
+ else
+ {
+ //KILE_DEBUG() << "error: dollar not allowed in \\[ or \\( mode" << endl;
+ return false;
+ }
+ }
+ else if ( mathname=="\\]" || mathname=="\\)" )
+ {
+ continueSearch = false;
+ break;
+ }
+ else if ( mathname=="\\b" )
+ {
+ // save name of environment
+ QString envname = reg.cap(1);
+
+ // if we found the opening tag of a math env
+ if ( m_latexCommands->isMathEnv(envname) || envname=="math" )
+ {
+ if ( numDollar > 0 )
+ {
+ //KILE_DEBUG() << "error: dollar not allowed in math env numdollar=" << numDollar << endl;
+ return false;
+ }
+
+ // if this is a math env with its own mathmode, we have found the starting position
+ if ( envname == "math" )
+ {
+ mathdata.tag = mmMathEnv;
+ mathdata.envname = envname;
+ return true;
+ }
+
+ if ( ! m_latexCommands->needsMathMode(envname) )
+ {
+ mathdata.tag = mmDisplaymathEnv;
+ mathdata.envname = envname;
+ return true;
+ }
+ }
+ // no math env, we found the opening tag of a normal env
+ else
+ {
+ continueSearch = false;
+ break;
+ }
+ }
+ else if ( mathname == "\\e" )
+ {
+ QString envname = reg.cap(2);
+
+ // if we found the closing tag of a math env
+ if ( m_latexCommands->isMathEnv(envname) || envname=="math" )
+ {
+ // if this is a math env with its own mathmode
+ if ( ! m_latexCommands->needsMathMode(envname) || envname=="math" )
+ {
+ continueSearch = false;
+ break;
+ }
+
+ // if this is a math env which needs $..$
+ if ( m_latexCommands->isMathModeEnv(envname) )
+ {
+ if ( numDollar >= 1 )
+ {
+ numDollar--;
+ continueSearch = false;
+ break;
+ }
+ // else continue search
+ }
+ }
+ // if we found the closing tag of a normal env
+ else
+ {
+ continueSearch = false;
+ break;
+ }
+ }
+ else
+ {
+ //KILE_DEBUG() << "error: unknown match" << endl;
+ return false;
+ }
+
+ // continue search one column left of the last match (if this is possible)
+ if ( col == 0 )
+ break;
+
+ col--;
+ }
+
+ if ( row > 0 )
+ {
+ textline = getTextLineReal(doc,--row);
+ col = textline.length();
+ }
+
+ if ( column == -1 )
+ {
+ continueSearch = false;
+ break;
+ }
+ }
+
+ // nothing else found, so math mode starts a the last dollar (the first one found backwards)
+ mathdata.row = lastrow;
+ mathdata.col = lastcol;
+ mathdata.len = 1;
+ mathdata.numdollar = numDollar;
+
+ mathdata.tag = ( numDollar > 0 ) ? mmMathDollar : mmNoMathMode;
+
+ return true;
+}
+
+bool EditorExtension::findCloseMathTag(Kate::Document *doc, uint row, uint col, QRegExp &reg, MathData &mathdata)
+{
+ KTextEditor::SearchInterface *iface;
+ iface = dynamic_cast<KTextEditor::SearchInterface *>(doc);
+
+ uint rowFound,colFound,lenFound;
+ while ( iface->searchText(row,col,reg,&rowFound,&colFound,&lenFound,false) )
+ {
+ // should be better called 'isValidChar()', because it checks for comments
+ // and escaped chars like backslash and dollar in '\\' and '\$'
+ if ( isValidBackslash(doc,rowFound,colFound) )
+ {
+ QString mathname = reg.cap(0).left(2);
+
+ // always remember behind the last match
+ mathdata.row = rowFound;
+ mathdata.col = colFound;
+ mathdata.len = lenFound;
+
+ if ( mathname=="$" )
+ {
+ mathdata.tag = mmMathDollar;
+ return true;
+ }
+ else if ( mathname=="\\]" )
+ {
+ mathdata.tag = mmDisplaymathParen;
+ return true;
+ }
+ else if ( mathname=="\\)" )
+ {
+ mathdata.tag = mmMathParen;
+ return true;
+ }
+ else if ( mathname=="\\[" || mathname=="\\(" )
+ {
+ //KILE_DEBUG() << "error: current mathgroup was not closed" << endl;
+ return false;
+ }
+ else if ( mathname=="\\b" )
+ {
+ QString envname = reg.cap(1);
+
+ if ( ! (m_latexCommands->isMathEnv(envname) || envname=="math") )
+ {
+ //KILE_DEBUG() << "error: only math env are allowed in mathmode (found begin tag)" << endl;
+ return false;
+ }
+
+ if ( !m_latexCommands->needsMathMode(envname) || envname=="math" )
+ {
+ //KILE_DEBUG() << "error: mathenv with its own mathmode are not allowed in mathmode " << endl;
+ return false;
+ }
+ // else continue search
+ }
+ else if ( mathname=="\\e" )
+ {
+ QString envname = reg.cap(2);
+ if ( ! (m_latexCommands->isMathEnv(envname) || envname=="math") )
+ {
+ //KILE_DEBUG() << "error: only math env are allowed in mathmode (found end tag)" << endl;
+ return false;
+ }
+
+ if ( envname == "math" )
+ {
+ mathdata.tag = mmMathEnv;
+ mathdata.envname = envname;
+ return true;
+ }
+
+ if ( ! m_latexCommands->needsMathMode(envname) )
+ {
+ mathdata.tag = mmDisplaymathEnv;
+ mathdata.envname = envname;
+ return true;
+ }
+
+ // else continue search
+ }
+ }
+
+ // continue search one column right of the last match (if this is possible)
+ row = rowFound;
+ col = colFound;
+ if ( ! increaseCursorPosition(doc,row,col) )
+ break;
+ }
+
+ return false;
+}
+
+//////////////////// insert newlines inside an environment ////////////////////
+
+// intelligent newlines: look for the last opened environment
+// and decide what to insert
+// or continue the comment
+
+void EditorExtension::insertIntelligentNewline(Kate::View *view)
+{
+ KILE_DEBUG() << "void EditorExtension::insertIntelligentNewline(Kate::View *view)" << endl;
+
+ view = determineView(view);
+
+ if ( !view )
+ return;
+
+ Kate::Document* doc = view->getDoc();
+
+ if( !doc )
+ return;
+
+ uint row,col;
+ QString name;
+
+ view->cursorPositionReal(&row,&col);
+
+ if(isCommentPosition(doc,row,col))
+ {
+ KILE_DEBUG() << "found comment" << endl;
+ view->keyReturn();
+ view->insertText("% ");
+ return;
+ }
+ else if ( findOpenedEnvironment(row,col,name,view) )
+ {
+ if ( m_latexCommands->isListEnv(name) )
+ {
+ view->keyReturn();
+ view->insertText("\\item " );
+ return;
+ }
+ else if ( m_latexCommands->isTabularEnv(name) || m_latexCommands->isMathEnv(name) )
+ {
+ view->insertText(" \\\\");
+ }
+ }
+ // - no comment position
+ // - found no opened environment
+ // - unknown environment
+ // - finish tabular or math environment
+ view->keyReturn();
+}
+
+bool EditorExtension::findOpenedEnvironment(uint &row,uint &col, QString &envname, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return false;
+
+ // get current cursor position
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+
+ EnvData env;
+ uint startrow = row;
+ uint startcol = col;
+
+ //KILE_DEBUG() << " close - start " << endl;
+ // accept a starting place outside an environment
+ bool env_position = isEnvironmentPosition(doc,row,col,env);
+
+ // We can also accept a column, if we are on the left side of an environment.
+ // But we should decrease the current cursor position for the search.
+ if ( env_position && env.cpos!=EnvInside )
+ {
+ if ( env.cpos==EnvLeft && !decreaseCursorPosition(doc,startrow,startcol) )
+ return false;
+ env_position = false;
+ }
+
+ if ( !env_position && findEnvironmentTag(doc,startrow,startcol,env,true) )
+ {
+ //KILE_DEBUG() << " close - found begin env at: " << env.row << "/" << env.col << " " << env.name << endl;
+ row = env.row;
+ col = env.col;
+ envname = env.name;
+ return true;
+ }
+ else
+ return false;
+}
+
+QStringList EditorExtension::findOpenedEnvironmentList(Kate::View *view, bool position)
+{
+ QStringList envlist;
+
+ view = determineView(view);
+ if ( view )
+ {
+ uint currentRow,currentCol;
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&currentRow,&currentCol);
+
+ uint row = currentRow;
+ uint col = currentCol;
+ EnvData env;
+
+ // check the starting position
+ bool env_position = isEnvironmentPosition(doc,row,col,env);
+ if ( env_position )
+ {
+ // we are inside an environment tag: bad to complete
+ if ( env.cpos == EnvInside )
+ return envlist;
+ // we are left of an environment tag: go one position to the left
+ if ( env.cpos == EnvLeft )
+ {
+ if ( ! decreaseCursorPosition(doc,row,col) )
+ return envlist;
+ }
+ }
+
+ while ( findEnvironmentTag(doc,row,col,env,true) )
+ {
+ row = env.row;
+ col = env.col;
+
+ if ( position )
+ envlist << env.name + QString(",%1,%2").arg(row).arg(col);
+ else
+ envlist << env.name;
+
+ if ( col == 0 )
+ {
+ if ( ! decreaseCursorPosition(doc,row,col) )
+ break;
+ }
+ view->setCursorPositionReal(row,col);
+ }
+
+ // reset cursor original position
+ view->setCursorPositionReal(currentRow,currentCol);
+ }
+
+ return envlist;
+}
+
+//////////////////// select an environment ////////////////////
+
+void EditorExtension::selectEnvironment(bool inside, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ EnvData envbegin,envend;
+
+ if ( !view->getDoc()->hasSelection() || !expandSelectionEnvironment(inside,view) )
+ {
+ if ( getEnvironment(inside,envbegin,envend,view) )
+ view->getDoc()->setSelection(envbegin.row,envbegin.col,envend.row,envend.col);
+ }
+}
+
+void EditorExtension::deleteEnvironment(bool inside, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ EnvData envbegin,envend;
+
+ if ( getEnvironment(inside,envbegin,envend,view) )
+ {
+ Kate::Document *doc = view->getDoc();
+ doc->clearSelection();
+ doc->removeText(envbegin.row,envbegin.col,envend.row,envend.col);
+ view->setCursorPosition(envbegin.row,0);
+ }
+}
+
+// calculate start and end of an environment
+
+bool EditorExtension::getEnvironment(bool inside, EnvData &envbegin, EnvData &envend, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return false;
+
+ uint row,col;
+
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+ if ( !findBeginEnvironment(doc,row,col,envbegin) )
+ return false;
+ if ( !findEndEnvironment(doc,row,col,envend) )
+ return false;
+
+ if ( inside )
+ {
+ // check first line
+ envbegin.col += envbegin.len;
+ if ( envbegin.col >= (uint)doc->lineLength(envbegin.row) )
+ {
+ ++envbegin.row;
+ envbegin.col = 0;
+ }
+ }
+ else
+ {
+ envend.col += envend.len;
+ // check last line
+ if ( envbegin.col==0 && envend.col==(uint)doc->lineLength(envend.row) )
+ {
+ ++envend.row;
+ envend.col = 0;
+ }
+ }
+
+ return true;
+}
+
+// determine text, startrow and startcol of current environment
+
+QString EditorExtension::getEnvironmentText(uint &row, uint &col, QString &name, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return QString::null;
+
+ EnvData envbegin,envend;
+
+ if ( getEnvironment(false,envbegin,envend,view) && envbegin.name!="document" )
+ {
+ row = envbegin.row;
+ col = envbegin.col;
+ name = envbegin.name;
+ return view->getDoc()->text(envbegin.row,envbegin.col,envend.row,envend.col);
+ }
+ else
+ {
+ return QString::null;
+ }
+}
+
+bool EditorExtension::hasEnvironment(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view )
+ return false;
+
+ EnvData envbegin,envend;
+ return ( getEnvironment(false,envbegin,envend,view) && envbegin.name!="document" );
+}
+
+// when an environment is selected (inside or outside),
+// the selection is expanded to the surrounding environment
+
+bool EditorExtension::expandSelectionEnvironment(bool inside, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return false;
+
+ Kate::Document *doc = view->getDoc();
+ if ( ! doc->hasSelection() )
+ return false;
+
+ // get current position
+ uint row,col;
+ view->cursorPositionReal(&row,&col);
+
+ // get current selection
+ uint row1 = doc->selStartLine();
+ uint col1 = doc->selStartCol();
+ uint row2 = doc->selEndLine();
+ uint col2 = doc->selEndCol();
+
+ // determine current environment outside
+ EnvData oenvbegin,oenvend;
+ if ( ! getEnvironment(false,oenvbegin,oenvend,view) )
+ return false;
+
+ bool newselection = false;
+ // first look, if this environment is selected outside
+ if ( row1==oenvbegin.row && col1==oenvbegin.col && row2==oenvend.row && col2==oenvend.col ) {
+ if ( ! decreaseCursorPosition(doc,oenvbegin.row,oenvbegin.col) )
+ return newselection;
+ view->setCursorPositionReal(oenvbegin.row,oenvbegin.col);
+ // search the surrounding environment and select it
+ if ( getEnvironment(inside,oenvbegin,oenvend,view) ) {
+ doc->setSelection(oenvbegin.row,oenvbegin.col,oenvend.row,oenvend.col);
+ newselection = true;
+ }
+ } else {
+ // then determine current environment inside
+ EnvData ienvbegin,ienvend;
+ getEnvironment(true,ienvbegin,ienvend,view);
+ // and look, if this environment is selected inside
+ if ( row1==ienvbegin.row && col1==ienvbegin.col && row2==ienvend.row && col2==ienvend.col ) {
+ if ( ! decreaseCursorPosition(doc,oenvbegin.row,oenvbegin.col) )
+ return newselection;
+ view->setCursorPositionReal(oenvbegin.row,oenvbegin.col);
+ // search the surrounding environment and select it
+ if ( getEnvironment(inside,ienvbegin,ienvend,view) ) {
+ doc->setSelection(ienvbegin.row,ienvbegin.col,ienvend.row,ienvend.col);
+ newselection = true;
+ }
+ }
+ }
+
+ // restore old cursor position
+ view->setCursorPositionReal(row,col);
+ return newselection;
+}
+
+//////////////////// search for \begin{env} ////////////////////
+
+// Find the last \begin{env} tag. If the current cursor is over
+// - \begin{env} tag: we will stop immediately
+// - \end{env} tag: we will start before this tag
+
+bool EditorExtension::findBeginEnvironment(Kate::Document *doc, uint row, uint col,EnvData &env)
+{
+ // KILE_DEBUG() << " find begin: " << endl;
+ if ( isEnvironmentPosition(doc,row,col,env) )
+ {
+ // already found position?
+ //KILE_DEBUG() << " found env at: " << env.row << "/" << env.col << " " << env.name << endl;
+ if ( env.tag == EnvBegin )
+ {
+ //KILE_DEBUG() << " is begin env at: " << env.row << "/" << env.col << " " << env.name << endl;
+ return true;
+ }
+
+ // go one position back
+ //KILE_DEBUG() << " is end env at: " << env.row << "/" << env.col << " " << env.name << endl;
+ row = env.row;
+ col = env.col;
+ if ( ! decreaseCursorPosition(doc,row,col) )
+ return false;
+ }
+
+ // looking back for last environment
+ //KILE_DEBUG() << " looking back from pos: " << row << "/" << col << " " << env.name << endl;
+ return findEnvironmentTag(doc,row,col,env,true);
+}
+
+//////////////////// search for \end{env} ////////////////////
+
+// Find the last \end{env} tag. If the current cursor is over
+// - \end{env} tag: we will stop immediately
+// - \begin{env} tag: we will start behind this tag
+
+bool EditorExtension::findEndEnvironment(Kate::Document *doc, uint row, uint col,EnvData &env)
+{
+ if ( isEnvironmentPosition(doc,row,col,env) )
+ {
+ // already found position?
+ if ( env.tag == EnvEnd )
+ return true;
+
+ // go one position forward
+ row = env.row;
+ col = env.col + 1;
+ }
+
+ // looking forward for the next environment
+ return findEnvironmentTag(doc,row,col,env,false);
+}
+
+//////////////////// search for an environment tag ////////////////////
+
+// find the last/next non-nested environment tag
+
+bool EditorExtension::findEnvironmentTag(Kate::Document *doc, uint row, uint col,
+ EnvData &env,bool backwards)
+{
+ KTextEditor::SearchInterface *iface;
+ iface = dynamic_cast<KTextEditor::SearchInterface *>(doc);
+
+ uint envcount = 0;
+
+ EnvTag wrong_env = ( backwards ) ? EnvEnd : EnvBegin;
+ while ( iface->searchText(row,col,m_reg,&env.row,&env.col,&env.len,backwards) )
+ {
+ if ( isValidBackslash(doc,env.row,env.col) )
+ {
+ EnvTag found_env = ( m_reg.cap(2)=="begin" || m_reg.cap(4)=="\\[" ) ? EnvBegin : EnvEnd;
+ if ( found_env == wrong_env )
+ {
+ ++envcount;
+ }
+ else
+ {
+ if ( envcount > 0 )
+ --envcount;
+ else
+ {
+ if ( found_env == EnvBegin )
+ {
+ env.name = ( m_reg.cap(2)=="begin" ) ? m_reg.cap(3) : "\\[";
+ }
+ else
+ {
+ env.name = ( m_reg.cap(2)=="end" ) ? m_reg.cap(3) : "\\]";
+ }
+ env.tag = found_env;
+ return true;
+ }
+ }
+ }
+
+ // new start position
+ if ( !backwards )
+ {
+ row = env.row;
+ col = env.col + 1;
+ }
+ else
+ {
+ row = env.row;
+ col = env.col;
+ if ( ! decreaseCursorPosition(doc,row,col) )
+ return false;
+ }
+ }
+
+ return false;
+}
+
+//////////////////// check for an environment position ////////////////////
+
+// Check if the current position belongs to an environment. The result is set
+// to the beginning backslash of the environment tag. The same algorithms as
+// matching brackets is used.
+
+bool EditorExtension::isEnvironmentPosition(Kate::Document *doc, uint row, uint col, EnvData &env)
+{
+ // get real textline without comments, quoted characters and pairs of backslashes
+ QString textline = getTextLineReal(doc,row);
+
+ if ( col > textline.length() )
+ return false;
+
+ EnvData envright;
+ bool left = false;
+ bool right = false;
+
+ //KTextEditor::SearchInterface *iface;
+ //iface = dynamic_cast<KTextEditor::SearchInterface *>(doc);
+
+ // check if there is a match in this line from the current position to the left
+ int startcol = ( textline[col] == '\\' ) ? col - 1 : col;
+ if ( startcol >= 1 )
+ {
+ int pos = textline.findRev(m_reg,startcol);
+ env.len = m_reg.matchedLength();
+ if ( pos!=-1 && (uint)pos<col && col<=(uint)pos+env.len )
+ {
+ env.row = row;
+ env.col = pos;
+ QChar ch = textline.at(pos+1);
+ if ( ch=='b' || ch=='e' )
+ {
+ env.tag = ( ch == 'b' ) ? EnvBegin : EnvEnd;
+ env.name = m_reg.cap(3);
+ }
+ else
+ {
+ env.tag = ( ch == '[' ) ? EnvBegin : EnvEnd;
+ env.name = m_reg.cap(4);
+ }
+ env.cpos = ( col < (uint)pos+env.len ) ? EnvInside : EnvRight;
+ // we have already found a tag, if the cursor is inside, but not behind this tag
+ if ( env.cpos == EnvInside )
+ return true;
+ left = true;
+ //KILE_DEBUG() << " is - found left: pos=" << pos << " " << env.name << " " << QString(textline.at(pos+1)) << endl;
+ }
+ }
+
+ // check if there is a match in this line from the current position to the right
+ if ( textline[col]=='\\' && col==(uint)textline.find(m_reg,col) )
+ {
+ envright.row = row;
+ envright.col = col;
+ envright.len = m_reg.matchedLength();
+ QChar ch = textline.at(col+1);
+ if ( ch=='b' || ch=='e' ) // found "\begin" or "\end"
+ {
+ envright.tag = ( ch == 'b' ) ? EnvBegin : EnvEnd;
+ envright.name = m_reg.cap(3);
+ }
+ else // found "\[" or "\\]"
+ {
+ envright.tag = ( ch == '[' ) ? EnvBegin : EnvEnd;
+ envright.name = m_reg.cap(4);
+ }
+ envright.cpos = EnvLeft;
+ right = true;
+ //KILE_DEBUG() << " is - found right: pos=" <<col << " " << envright.name << " " << QString(textline.at(col+1)) << endl;
+ }
+
+ //KILE_DEBUG() << "found left/right: " << left << "/" << right << endl;
+ // did we find a tag?
+ if ( ! (left || right) )
+ return false;
+
+ // now check, which tag we should be taken (algorithm like matching brackets)
+
+ if ( m_overwritemode )
+ {
+ if ( right && envright.tag==EnvBegin )
+ {
+ env = envright;
+ return true;
+ }
+ else if ( left && env.tag==EnvEnd )
+ return true;
+ else
+ return false;
+ }
+ else if ( left && env.tag==EnvEnd )
+ {
+ //KILE_DEBUG() << " 1: accept left end: " << env.name << endl;
+ return true;
+ }
+ else if ( right && envright.tag==EnvBegin )
+ {
+ //KILE_DEBUG() << " 2: accept right begin: " << envright.name << endl;
+ env = envright;
+ }
+ else if ( left && env.tag==EnvBegin )
+ {
+ // KILE_DEBUG() << " 3: accept left begin: " << env.name << endl;
+ return true;
+ }
+ else if ( right && envright.tag==EnvEnd )
+ {
+ //KILE_DEBUG() << " 4: accept right end: " << envright.name << endl;
+ env = envright;
+ }
+ else
+ return false;
+
+ return true;
+}
+
+//////////////////// check for a comment ////////////////////
+
+// check if the current position is within a comment
+
+bool EditorExtension::isCommentPosition(Kate::Document *doc, uint row, uint col)
+{
+ QString textline = doc->textLine(row);
+
+ bool backslash = false;
+ for ( uint i=0; i<col; ++i )
+ {
+ if ( textline[i] == '%' )
+ {
+ if ( !backslash )
+ return true; // found a comment sign
+ else
+ backslash = false;
+ }
+ else if ( textline[i] == '\\' ) // count number of backslashes
+ backslash = !backslash;
+ else
+ backslash = false; // no backslash
+ }
+
+ return false;
+}
+
+// check if the character at text[col] is a valid backslash:
+// - there is no comment sign in this line before
+// - there is not a odd number of backslashes directly before
+
+bool EditorExtension::isValidBackslash(Kate::Document *doc, uint row, uint col)
+{
+ QString textline = doc->textLine(row);
+
+ bool backslash = false;
+ for ( uint i=0; i<col; ++i )
+ {
+ if ( textline[i] == '%' )
+ {
+ if ( !backslash )
+ return false; // found a comment sign
+ else
+ backslash = false;
+ }
+ else if ( textline[i] == '\\' ) // count number of backslashes
+ backslash = !backslash;
+ else
+ backslash = false; // no backslash
+ }
+
+ return !backslash;
+}
+
+//////////////////// goto next bullet ////////////////////
+
+void EditorExtension::gotoBullet(bool backwards, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint row,col,ypos,xpos,len;
+
+ // get current position
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+
+ // change the start position or we will stay at this place
+ if ( backwards )
+ {
+ if ( ! decreaseCursorPosition(doc,row,col) )
+ return;
+ }
+ else
+ {
+ if ( ! increaseCursorPosition(doc,row,col) )
+ return;
+ }
+
+ if ( doc->searchText(row,col,s_bullet,&ypos,&xpos,&len,true,backwards) )
+ {
+ doc->setSelection(ypos,xpos,ypos,xpos+1);
+ view->setCursorPositionReal(ypos,xpos);
+ }
+}
+
+//////////////////// increase/decrease cursor position ////////////////////
+
+bool EditorExtension::increaseCursorPosition(Kate::Document *doc, uint &row, uint &col)
+{
+ bool ok = true;
+
+ if ( (int)col < doc->lineLength(row)-1 )
+ ++col;
+ else if ( row < doc->numLines() - 1 )
+ {
+ ++row;
+ col=0;
+ }
+ else
+ ok = false;
+
+ return ok;
+}
+
+bool EditorExtension::decreaseCursorPosition(Kate::Document *doc, uint &row, uint &col)
+{
+ bool ok = true;
+
+ if (col > 0)
+ --col;
+ else if ( row > 0 )
+ {
+ --row;
+ col = doc->lineLength(row);
+ }
+ else
+ ok = false;
+
+ return ok;
+}
+
+//////////////////// texgroups ////////////////////
+
+// goto the next non-nested bracket
+
+void EditorExtension::gotoTexgroup(bool backwards, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint row,col;
+ bool found;
+ BracketData bracket;
+
+ // get current position
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+ m_overwritemode = view->isOverwriteMode();
+
+ // start searching
+ if ( backwards )
+ found = findOpenBracket(doc,row,col,bracket);
+ else
+ {
+ found = findCloseBracket(doc,row,col,bracket);
+ // go behind the bracket
+ if ( ! m_overwritemode )
+ ++bracket.col;
+ }
+
+ if ( found )
+ view->setCursorPositionReal(bracket.row,bracket.col);
+}
+
+// match the opposite bracket
+
+void EditorExtension::matchTexgroup(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint row,col;
+ BracketData bracket;
+
+ // get current position
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+ m_overwritemode = view->isOverwriteMode();
+
+ // this operation is only allowed at a bracket position
+ if ( !isBracketPosition(doc,row,col,bracket) )
+ return;
+
+ // start searching
+ bool found = false;
+ if ( bracket.open )
+ {
+ found = findCloseBracketTag(doc,bracket.row,bracket.col+1,bracket);
+ // go behind the bracket
+ if ( ! m_overwritemode )
+ ++bracket.col;
+ }
+ else
+ {
+ if ( !decreaseCursorPosition(doc,bracket.row,bracket.col) )
+ return;
+ found = findOpenBracketTag(doc,bracket.row,bracket.col,bracket);
+ }
+
+ if ( found )
+ view->setCursorPositionReal(bracket.row,bracket.col);
+}
+
+//////////////////// close an open texgroup ////////////////////
+
+// search for the last opened texgroup and close it
+
+void EditorExtension::closeTexgroup(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint row,col;
+ BracketData bracket;
+
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+
+ uint rowtemp = row;
+ uint coltemp = col;
+ if ( !decreaseCursorPosition(doc,rowtemp,coltemp) )
+ return;
+
+ if ( findOpenBracketTag(doc,rowtemp,coltemp,bracket) )
+ {
+ doc->insertText( row,col,"}" );
+ view->setCursorPositionReal(row,col+1);
+ }
+}
+
+//////////////////// select a texgroup ////////////////////
+
+void EditorExtension::selectTexgroup(bool inside, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ BracketData open,close;
+
+ if ( getTexgroup(inside,open,close,view) )
+ {
+ Kate::Document *doc = view->getDoc();
+ doc->setSelection(open.row,open.col,close.row,close.col);
+ }
+}
+
+void EditorExtension::deleteTexgroup(bool inside, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ BracketData open,close;
+
+ if ( getTexgroup(inside,open,close,view) )
+ {
+ Kate::Document *doc = view->getDoc();
+ doc->clearSelection();
+ doc->removeText(open.row,open.col,close.row,close.col);
+ view->setCursorPositionReal(open.row,open.col+1);
+ }
+}
+
+// calculate start and end of an environment
+
+bool EditorExtension::getTexgroup(bool inside, BracketData &open, BracketData &close, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return false;
+
+ uint row,col;
+
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+
+ if ( !findOpenBracket(doc,row,col,open) )
+ {
+ //KILE_DEBUG() << "no open bracket" << endl;
+ return false;
+ }
+ if ( !findCloseBracket(doc,row,col,close) )
+ {
+ //KILE_DEBUG() << "no close bracket" << endl;
+ return false;
+ }
+
+ if ( inside )
+ ++open.col;
+ else
+ ++close.col;
+
+ return true;
+}
+
+//////////////////// search for a bracket position ////////////////////
+
+// Find the last opening bracket. If the current cursor is over
+// - '{': we will stop immediately
+// - '}': we will start before this character
+
+bool EditorExtension::findOpenBracket(Kate::Document *doc, uint row, uint col, BracketData &bracket)
+{
+ if ( isBracketPosition(doc,row,col,bracket) )
+ {
+ // already found position?
+ if ( bracket.open ) return true;
+
+
+ // go one position back
+ row = bracket.row;
+ col = bracket.col;
+ if ( ! decreaseCursorPosition(doc,row,col) ) return false;
+ }
+
+ // looking back for last bracket
+ return findOpenBracketTag(doc,row,col,bracket);
+}
+
+// Find the last closing bracket. If the current cursor is over
+// - '}': we will stop immediately
+// - '{': we will start behind this character
+
+bool EditorExtension::findCloseBracket(Kate::Document *doc, uint row, uint col, BracketData &bracket)
+{
+ if ( isBracketPosition(doc,row,col,bracket) )
+ {
+ // already found position?
+ if ( ! bracket.open ) return true;
+
+ // go one position forward
+ row = bracket.row;
+ col = bracket.col + 1;
+ }
+
+ // looking forward for next bracket
+ return findCloseBracketTag(doc,row,col,bracket);
+}
+
+/*
+ Bracket matching uses the following algorithm (taken from Kate):
+ 1) If in overwrite mode, match the bracket currently underneath the cursor.
+ 2) Otherwise, if the character to the left of the cursor is an ending bracket,
+ match it.
+ 3) Otherwise if the character to the right of the cursor is a
+ starting bracket, match it.
+ 4) Otherwise, if the the character to the left of the cursor is an
+ starting bracket, match it.
+ 5) Otherwise, if the character to the right of the cursor is an
+ ending bracket, match it.
+ 6) Otherwise, don't match anything.
+*/
+
+bool EditorExtension::isBracketPosition(Kate::Document *doc, uint row, uint col, BracketData &bracket)
+{
+ // default results
+ bracket.row = row;
+ bracket.col = col;
+
+ QString textline = getTextLineReal(doc,row);
+ QChar right = textline[col];
+ QChar left = ( col > 0 ) ? textline[col-1] : QChar(' ');
+
+ if ( m_overwritemode )
+ {
+ if ( right == '{' )
+ {
+ bracket.open = true;
+ }
+ else if ( left == '}' )
+ {
+ bracket.open = false;
+ }
+ else
+ return false;
+ }
+ else if ( left == '}' )
+ {
+ bracket.open = false;
+ --bracket.col;
+ }
+ else if ( right == '{' )
+ {
+ bracket.open = true;
+ }
+ else if ( left == '{' )
+ {
+ bracket.open = true;
+ --bracket.col;
+ }
+ else if ( right == '}' )
+ {
+ bracket.open = false;
+ }
+ else
+ return false;
+
+ return true;
+}
+
+// find next non-nested closing bracket
+
+bool EditorExtension::findCloseBracketTag(Kate::Document *doc, uint row, uint col,BracketData &bracket)
+{
+ uint brackets = 0;
+ for ( uint line=row; line<doc->numLines(); ++line )
+ {
+ uint start = ( line == row ) ? col : 0;
+ QString textline = getTextLineReal(doc,line);
+ for ( uint i=start; i<textline.length(); ++i )
+ {
+ if ( textline[i] == '{' )
+ {
+ ++brackets;
+ }
+ else if ( textline[i] == '}' )
+ {
+ if ( brackets > 0 )
+ --brackets;
+ else
+ {
+ bracket.row = line;
+ bracket.col = i;
+ bracket.open = false;
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
+// find next non-nested opening bracket
+
+bool EditorExtension::findOpenBracketTag(Kate::Document *doc, uint row, uint col, BracketData &bracket)
+{
+ uint brackets = 0;
+ for ( int line=row; line>=0; --line )
+ {
+ QString textline = getTextLineReal(doc,line);
+ int start = ( line == (int)row ) ? col : textline.length()-1;
+ for ( int i=start; i>=0; --i )
+ {
+ //KILE_DEBUG() << "findOpenBracketTag: (" << line << "," << i << ") = " << textline[i].latin1() << endl;
+ if ( textline[i] == '{' )
+ {
+ if ( brackets > 0 )
+ --brackets;
+ else
+ {
+ bracket.row = line;
+ bracket.col = i;
+ bracket.open = true;
+ return true;
+ }
+ }
+ else if ( textline[i] == '}' )
+ {
+ ++brackets;
+ }
+ }
+ }
+
+ //KILE_DEBUG() << "nothting found" << endl;
+ return false;
+}
+
+//////////////////// get real text ////////////////////
+
+// get current textline and remove
+// - all pairs of backslashes: '\\'
+// - all quoted comment signs: '\%'
+// - all quoted brackets: '\{' and '\}'
+// - all comments
+// replace these characters one one, which never will be looked for
+
+QString EditorExtension::getTextLineReal(Kate::Document *doc, uint row)
+{
+ QString textline = doc->textLine(row);
+ uint len = textline.length();
+ if ( len == 0)
+ return QString::null;
+
+ bool backslash = false;
+ for (uint i=0; i<len; ++i )
+ {
+ if ( textline[i]=='{' || textline[i]=='}' || textline[i]=='$')
+ {
+ if ( backslash )
+ {
+ textline[i-1] = '&';
+ textline[i] = '&';
+ }
+ backslash = false;
+ }
+ else if ( textline[i]=='\\' )
+ {
+ if ( backslash )
+ {
+ textline[i-1] = '&';
+ textline[i] = '&';
+ backslash = false;
+ }
+ else
+ backslash = true;
+ }
+ else if ( textline[i]=='%' )
+ {
+ if ( backslash )
+ {
+ textline[i-1] = '&';
+ textline[i] = '&';
+ }
+ else
+ {
+ len = i;
+ break;
+ }
+ backslash = false;
+ }
+ else
+ backslash = false;
+
+ }
+
+ // return real text
+ return textline.left(len);
+}
+
+//////////////////// capture the current word ////////////////////
+
+// Capture the current word from the cursor position to the left and right.
+// The result depens on the given search mode;
+// - smTex only letters, except backslash as first and star as last character
+// - smLetter: only letters
+// - smWord: letters and digits
+// - smNospace: everything except white space
+
+bool EditorExtension::getCurrentWord(Kate::Document *doc, uint row, uint col, EditorExtension::SelectMode mode, QString &word,uint &x1,uint &x2)
+{
+ // get real textline without comments, quoted characters and pairs of backslashes
+ QString textline = getTextLineReal(doc,row);
+ if ( col > textline.length() )
+ return false;
+
+ QRegExp reg;
+ QString pattern1,pattern2;
+ switch ( mode )
+ {
+ case smLetter :
+ pattern1 = "[^a-zA-Z]+";
+ pattern2 = "[a-zA-Z]+";
+ break;
+ case smWord :
+ pattern1 = "[^a-zA-Z0-9]";
+ pattern2 = "[a-zA-Z0-9]+";
+ break;
+ case smNospace:
+ pattern1 = "\\s";
+ pattern2 = "\\S+";
+ break;
+ default :
+ pattern1 = "[^a-zA-Z]";
+ pattern2 = "\\\\?[a-zA-Z]+\\*?";
+ break;
+ }
+ x1 = x2 = col;
+
+ int pos;
+ // search to the left side
+ if ( col > 0 )
+ {
+ reg.setPattern(pattern1);
+ pos = textline.findRev(reg,col-1);
+ if ( pos != -1 ) { // found an illegal character
+ x1 = pos + 1;
+ if ( mode == smTex ) {
+ if ( textline[pos] == '\\' )
+ x1 = pos;
+ col = x1;
+ }
+ } else {
+ x1 = 0; // pattern matches from beginning of line
+ }
+ }
+
+ // search at the current position
+ reg.setPattern(pattern2);
+ pos = textline.find(reg,col);
+ if ( pos!=-1 && (uint)pos==col )
+ {
+ x2 = pos + reg.matchedLength();
+ }
+
+ // get all characters
+ if ( x1 != x2 )
+ {
+ word = textline.mid(x1,x2-x1);
+ return true;
+ }
+ else
+ return false;
+}
+
+
+//////////////////// paragraph ////////////////////
+
+void EditorExtension::selectParagraph(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint startline,endline;
+
+ if ( findCurrentTexParagraph(startline,endline,view) )
+ {
+ view->getDoc()->setSelection(startline,0,endline+1,0);
+ }
+}
+
+void EditorExtension::deleteParagraph(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint startline,endline;
+
+ if ( findCurrentTexParagraph(startline,endline,view) )
+ {
+ Kate::Document *doc = view->getDoc();
+ doc->clearSelection();
+ if ( startline > 0 )
+ --startline;
+ else if ( endline < doc->numLines()-1 )
+ ++endline;
+ doc->removeText(startline,0,endline+1,0);
+ view->setCursorPosition(startline,0);
+ }
+}
+
+// get the range of the current paragraph
+
+bool EditorExtension::findCurrentTexParagraph(uint &startline, uint &endline, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return false;
+
+ uint row,col;
+
+ // get current position
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+
+ // don't accept an empty line as part of a paragraph
+ if ( doc->textLine(row).stripWhiteSpace().isEmpty() )
+ return false;
+
+ // settings default results
+ startline = row;
+ endline = row;
+
+ // find the previous empty line
+ for ( int line=row-1; line>=0; --line )
+ {
+ if ( doc->textLine(line).stripWhiteSpace().isEmpty() )
+ break;
+ startline = line;
+ }
+
+ // find the next empty line
+ for ( uint line=row+1; line<doc->numLines(); ++line )
+ {
+ if ( doc->textLine(line).stripWhiteSpace().isEmpty() )
+ break;
+ endline = line;
+ }
+
+ // settings result
+ return true;
+}
+
+void EditorExtension::gotoNextParagraph(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ bool found;
+ uint startline,endline;
+ Kate::Document *doc = view->getDoc();
+
+ endline = view->cursorLine();
+ if ( doc->textLine(endline).stripWhiteSpace().isEmpty() )
+ found = true;
+ else
+ found = findCurrentTexParagraph(startline,endline,view);
+
+ // we are in an empty line or in the last line of a paragraph
+ if ( found )
+ {
+ // find the next non empty line
+ for ( uint line=endline+1; line<doc->numLines(); ++line )
+ {
+ if ( ! doc->textLine(line).stripWhiteSpace().isEmpty() )
+ {
+ view->setCursorPositionReal(line,0);
+ return;
+ }
+ }
+ }
+}
+
+void EditorExtension::gotoPrevParagraph(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ bool found;
+ uint startline,endline;
+ Kate::Document *doc = view->getDoc();
+
+ startline = view->cursorLine();
+ if ( doc->textLine(startline).stripWhiteSpace().isEmpty() )
+ {
+ startline++;
+ found = true;
+ }
+ else
+ found = findCurrentTexParagraph(startline,endline,view);
+
+ // we are in an empty line or in the first line of a paragraph
+ if ( found )
+ {
+ // find the last line of the previous paragraph
+ int foundline = -1;
+ for ( int line=startline-1; line>=0; --line )
+ {
+ if ( ! doc->textLine(line).stripWhiteSpace().isEmpty() )
+ break;
+ foundline = line;
+ }
+ if ( foundline < 0 )
+ return;
+
+ // and finally the first line of this paragraph
+ int prevstartline = -1;
+ for ( int line=foundline-1; line>=0; --line )
+ {
+ if ( doc->textLine(line).stripWhiteSpace().isEmpty() )
+ break;
+ prevstartline = line;
+ }
+
+ if ( prevstartline >= 0 )
+ view->setCursorPositionReal((uint)prevstartline,0);
+ }
+}
+
+//////////////////// gotoLine ////////////////////
+
+void EditorExtension::gotoLine(Kate::View *view)
+{
+ view = determineView(view);
+ if ( view )
+ view->gotoLine();
+}
+
+//////////////////// one line of text////////////////////
+
+void EditorExtension::selectLine(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ // get current position
+ uint row,col;
+ QString word;
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+
+ if ( doc->lineLength(row) > 0 )
+ {
+ doc->setSelection(row,0,row+1,0);
+ }
+}
+
+void EditorExtension::deleteEndOfLine(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint row,col;
+ view->cursorPositionReal(&row,&col);
+
+ Kate::Document *doc = view->getDoc();
+ doc->clearSelection();
+ doc->removeText(row,col,row,doc->lineLength(row));
+}
+
+//////////////////// LaTeX command ////////////////////
+
+void EditorExtension::selectWord(EditorExtension::SelectMode mode, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ // get current position
+ uint row,col,col1,col2;
+ QString word;
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+
+ if ( getCurrentWord(doc,row,col,mode,word,col1,col2) )
+ {
+ doc->setSelection(row,col1,row,col2);
+ }
+}
+
+void EditorExtension::deleteWord(EditorExtension::SelectMode mode, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ // get current position
+ uint row,col,col1,col2;
+ QString word;
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+
+ if ( getCurrentWord(doc,row,col,mode,word,col1,col2) )
+ {
+ doc->removeText(row,col1,row,col2);
+ }
+}
+
+void EditorExtension::nextBullet(Kate::View* view)
+{
+ gotoBullet(false, view);
+}
+
+void EditorExtension::prevBullet(Kate::View* view)
+{
+ gotoBullet(true, view);
+}
+
+void EditorExtension::insertBullet(Kate::View* view)
+{
+ uint col, pos;
+ view = determineView(view);
+ if(!view)
+ {
+ return;
+ }
+ view->cursorPositionReal(&col, &pos);
+ view->getDoc()->insertText(col, pos, s_bullet);
+}
+
+void EditorExtension::completeWord()
+{
+ complete()->editComplete(m_ki->viewManager()->currentTextView(), KileDocument::CodeCompletion::cmLatex);
+}
+
+void EditorExtension::completeEnvironment()
+{
+ complete()->editComplete(m_ki->viewManager()->currentTextView(), KileDocument::CodeCompletion::cmEnvironment);
+}
+
+void EditorExtension::completeAbbreviation()
+{
+ complete()->editComplete(m_ki->viewManager()->currentTextView(), KileDocument::CodeCompletion::cmAbbreviation);
+}
+
+//////////////////// double quotes ////////////////////
+
+void EditorExtension::initDoubleQuotes()
+{
+ m_dblQuotes = KileConfig::insertDoubleQuotes();
+
+ int index = KileConfig::doubleQuotes();
+ if ( index<0 && index>=(int)m_quoteList.count() )
+ index = 0;
+
+ QStringList quotes = QStringList::split(QRegExp("\\s{2,}"), m_quoteList[index] );
+ m_leftDblQuote= quotes[1];
+ m_rightDblQuote = quotes[2];
+ KILE_DEBUG() << "new quotes: " << m_dblQuotes << " left=" << m_leftDblQuote << " right=" << m_rightDblQuote<< endl;
+}
+
+bool EditorExtension::insertDoubleQuotes()
+{
+ // don't insert double quotes, if konsole has focus
+ // return false, because if this is called from an event
+ // handler, because this event has to be passed on
+ if ( m_ki->texKonsole()->hasFocus() )
+ return false;
+
+ // insert double quotes, normal mode or autocompletion mode
+ // always return true for event handler
+ Kate::View *view = determineView(0L);
+ if ( !view ) return true;
+
+ uint row,col;
+ view->cursorPositionReal(&row,&col);
+ Kate::Document *doc = view->getDoc();
+
+ if( doc && m_ki->extensions()->isTexFile(doc->url()) )
+ doc->removeSelectedText();
+ else
+ return false;
+
+ // simply insert, if we are inside a verb command
+ if ( insideVerb(view) || insideVerbatim(view) )
+ return false;
+
+ // simply insert, if autoinsert mode is not active or the char bevor is \ (typically for \"a useful)
+ if ( !m_dblQuotes || ( col > 0 && doc->text(row,col-1,row,col) == QString("\\") ) )
+ return false;
+
+ // insert with auto mode
+ KTextEditor::SearchInterface *iface;
+ iface = dynamic_cast<KTextEditor::SearchInterface *>(doc);
+
+ QString pattern1 = QRegExp::escape(m_leftDblQuote);
+ if ( m_leftDblQuote.at(m_leftDblQuote.length()-1).isLetter() )
+ pattern1 += "(\\b|(\\{\\}))";
+ QString pattern2 = QRegExp::escape(m_rightDblQuote);
+ if ( m_rightDblQuote.at(m_rightDblQuote.length()-1).isLetter() )
+ pattern2 += "(\\b|(\\{\\}))";
+
+ QRegExp reg('(' + pattern1 + ")|(" + pattern2 + ')');
+
+ uint r,c,l;
+ bool openfound = false;
+ if ( iface->searchText(row,col,reg,&r,&c,&l,true) )
+ {
+ openfound = ( doc->textLine(r).find(m_leftDblQuote,c) == (int)c );
+ //KILE_DEBUG() << "pattern=" << reg.pattern() << " " << reg.cap(1) << " r=" << r << " c=" << c << " open=" << openfound<< endl;
+ }
+
+ QString textline = doc->textLine(row);
+ //KILE_DEBUG() << "text=" << textline << " open=" << openfound << endl;
+ if ( openfound )
+ {
+ // If we last inserted a language specific doublequote open,
+ // we have to change it to a normal doublequote. If not we
+ // insert a language specific doublequote close
+ int startcol = col - m_leftDblQuote.length();
+ //KILE_DEBUG() << "startcol=" << startcol << " col=" << col << endl;
+ if ( startcol>=0 && textline.find(m_leftDblQuote,startcol) == (int)startcol )
+ {
+ doc->removeText(row,startcol,row,startcol+m_leftDblQuote.length());
+ doc->insertText(row,startcol,"\"");
+ }
+ else
+ {
+ doc->insertText(row,col,m_rightDblQuote);
+ }
+ }
+ else
+ {
+ // If we last inserted a language specific doublequote close,
+ // we have to change it to a normal doublequote. If not we
+ // insert a language specific doublequote open
+ int startcol = col - m_rightDblQuote.length();
+ //KILE_DEBUG() << "startcol=" << startcol << " col=" << col << endl;
+ if ( startcol>=0 && textline.find(m_rightDblQuote,startcol) == (int)startcol )
+ {
+ doc->removeText(row,startcol,row,startcol+m_rightDblQuote.length());
+ doc->insertText(row,startcol,"\"");
+ }
+ else
+ {
+ doc->insertText(row,col,m_leftDblQuote);
+ }
+ }
+ return true;
+}
+
+//////////////////// insert tabulator ////////////////////
+
+void EditorExtension::insertIntelligentTabulator()
+{
+ Kate::View *view = determineView(0L);
+ if ( !view ) return;
+
+ uint row,col,currentRow,currentCol;
+ QString envname,tab;
+ QString prefix = " ";
+
+ view->cursorPositionReal(&currentRow,&currentCol);
+ if ( findOpenedEnvironment(row,col,envname,view) )
+ {
+ // look if this is an environment with tabs
+ tab = m_latexCommands->getTabulator(envname);
+
+ // try to align tabulator with textline above
+ if ( currentRow >= 1 )
+ {
+ int tabpos = view->getDoc()->textLine(currentRow-1).find('&',currentCol);
+ if ( tabpos >= 0 )
+ {
+ currentCol = tabpos;
+ prefix = QString::null;
+ }
+ }
+ }
+
+ if ( tab == QString::null )
+ tab = "&";
+ tab = prefix + tab + ' ';
+
+ view->getDoc()->insertText(currentRow,currentCol,tab);
+ view->setCursorPositionReal(currentRow,currentCol+tab.length());
+}
+
+//////////////////// autocomplete environment ////////////////////
+
+// should we complete the current environment (call from KileEventFilter)
+
+bool EditorExtension::eventInsertEnvironment(Kate::View *view)
+{
+ // don't complete environment, if we are
+ // still working inside the completion box
+ if ( m_complete->inProgress() )
+ return false;
+
+ int row = view->cursorLine();
+ int col = view->cursorColumnReal();
+ QString line = view->getDoc()->textLine(row).left(col);
+
+ int pos = m_regexpEnter.search(line);
+ if (pos != -1 )
+ {
+ line = m_regexpEnter.cap(1);
+ for (uint i=0; i < line.length(); ++i)
+ if ( ! line[i].isSpace() ) line[i] = ' ';
+
+ QString envname, endenv;
+ if ( m_regexpEnter.cap(2) == "\\[" )
+ {
+ envname = m_regexpEnter.cap(2);
+ endenv = "\\]\n";
+ }
+ else
+ {
+ envname = m_regexpEnter.cap(4);
+ endenv = m_regexpEnter.cap(2).replace("\\begin","\\end") + '\n';
+ }
+
+ if ( shouldCompleteEnv(envname, view) )
+ {
+ QString item = m_latexCommands->isListEnv(envname) ? "\\item " : QString::null;
+ view->getDoc()->insertText(row,col, '\n'+line+m_envAutoIndent+item +'\n'+line+endenv);
+ view->setCursorPositionReal(row+1, line.length()+m_envAutoIndent.length()+item.length());
+ return true;
+ }
+ }
+ return false;
+}
+
+bool EditorExtension::shouldCompleteEnv(const QString &env, Kate::View *view)
+{
+ KILE_DEBUG() << "===EditorExtension::shouldCompleteEnv( " << env << " )===" << endl;
+ QRegExp reTestBegin,reTestEnd;
+ if ( env == "\\[" )
+ {
+ KILE_DEBUG() << "display style" << endl;
+ reTestBegin.setPattern("(?:[^\\\\]|^)\\\\\\[");
+ // the first part is a non-capturing bracket (?:...) and we check if we don't have a backslash in front,
+ // or that we are at the begin of the line
+ reTestEnd.setPattern("(?:[^\\\\]|^)\\\\\\]");
+ }
+ else
+ {
+ reTestBegin.setPattern("(?:[^\\\\]|^)\\\\begin\\s*\\{" + QRegExp::escape(env) + "\\}");
+ reTestEnd.setPattern("(?:[^\\\\]|^)\\\\end\\s*\\{" + QRegExp::escape(env) + "\\}");
+ }
+
+ int num = view->getDoc()->numLines();
+ int numBeginsFound = 0;
+ int numEndsFound = 0;
+ uint realLine, realColumn;
+ view->cursorPositionReal(&realLine, &realColumn);
+ for ( int i = realLine; i < num; ++i)
+ {
+ numBeginsFound += view->getDoc()->textLine(i).contains(reTestBegin);
+ numEndsFound += view->getDoc()->textLine(i).contains(reTestEnd);
+ KILE_DEBUG() << "line is " << i << " numBeginsFound = " << numBeginsFound << " , " << "numEndsFound = " << numEndsFound << endl;
+ if ( numEndsFound >= numBeginsFound )
+ return false;
+ else if ( numEndsFound == 0 && numBeginsFound > 1 )
+ return true;
+ else if ( numBeginsFound > 2 || numEndsFound > 1 )
+ return true; // terminate the search
+ }
+
+ return true;
+}
+
+QString EditorExtension::getWhiteSpace(const QString &s)
+{
+ QString whitespace = s;
+ for ( uint i=0; i<whitespace.length(); ++i )
+ {
+ if ( ! whitespace[i].isSpace() )
+ whitespace[i] = ' ';
+ }
+ return whitespace;
+}
+
+//////////////////// inside verbatim commands ////////////////////
+
+bool EditorExtension::insideVerbatim(Kate::View *view)
+{
+ uint rowEnv,colEnv;
+ QString nameEnv;
+
+ if ( findOpenedEnvironment(rowEnv,colEnv,nameEnv,view) )
+ {
+ if ( m_latexCommands->isVerbatimEnv(nameEnv) )
+ return true;
+ }
+
+ return false;
+}
+
+bool EditorExtension::insideVerb(Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return false;
+
+ // get current position
+ uint row,col;
+ view->cursorPositionReal(&row,&col);
+
+ int startpos = 0;
+ QString textline = getTextLineReal(view->getDoc(),row);
+ QRegExp reg("\\\\verb(\\*?)(.)");
+ while ( true )
+ {
+ int pos = textline.find(reg,startpos);
+ if ( pos<0 || col<(uint)pos+6+reg.cap(1).length() )
+ return false;
+
+ pos = textline.find(reg.cap(2),pos+6+reg.cap(1).length());
+ if ( pos<0 || col<=(uint)pos )
+ return true;
+
+ startpos = pos + 1;
+ }
+}
+
+//////////////////// goto sectioning command ////////////////////
+
+void EditorExtension::gotoNextSectioning()
+{
+ gotoSectioning(false);
+}
+
+void EditorExtension::gotoPrevSectioning()
+{
+ gotoSectioning(true);
+}
+
+void EditorExtension::gotoSectioning(bool backwards, Kate::View *view)
+{
+ view = determineView(view);
+ if ( !view ) return;
+
+ uint rowFound,colFound;
+ m_ki->viewManager()->updateStructure(true);
+ if ( m_ki->structureWidget()->findSectioning(NULL, view->getDoc(), view->cursorLine(), view->cursorColumn(),
+ backwards, false, rowFound, colFound))
+ {
+ view->setCursorPositionReal(rowFound,colFound);
+ }
+}
+
+//////////////////// sectioning popup ////////////////////
+
+void EditorExtension::sectioningCommand(KileListViewItem *item, int id)
+{
+ Kate::View *view = determineView(0L);
+ if ( !view ) return;
+
+ if ( ! item )
+ return;
+ Kate::Document *doc = view->getDoc();
+
+ // try to determine the whole secting
+ // get the start auf the selected sectioning
+ uint row,col,row1,col1,row2,col2;
+ row = row1 = item->startline() - 1;
+ col = col1 = item->startcol() - 1;
+
+ // FIXME tbraun make this more clever, introdoce in kiledocinfo a flag which can be easily queried for that, so that we don't have to hardcode the names of the sections here (which is definitly a bad idea)
+ // check, if the document was changed in the meantime
+ QRegExp reg( "\\\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)\\*?\\s*(\\{|\\[)" );
+ QString textline = getTextLineReal(doc,row1);
+ if ( reg.search(textline,col1) != (int)col1 )
+ {
+ m_ki->logWidget()->clear();
+ m_ki->logWidget()->printMsg(KileTool::Error,
+ i18n("The document was modified and the structure view should be updated, before starting such an operation."),
+ i18n("Structure View Error") );
+ return;
+ }
+
+ // increase cursor position and find the following sectioning command
+ if ( ! increaseCursorPosition(doc,row,col) )
+ return;
+ if (!m_ki->structureWidget()->findSectioning(item, doc, row, col, false, true, row2, col2))
+ {
+ // or the end of the document
+ // if there is a '\end{document} command, we have to exclude it
+ if ( ! findEndOfDocument(doc,row,col,row2,col2) )
+ {
+ row2 = doc->numLines() - 1;
+ col2 = 0;
+ }
+ }
+
+ // clear selection and make cursor position visible
+ doc->clearSelection();
+ view->setCursorPositionReal(row1,col1);
+
+ QString text;
+ KTextEditor::EditInterfaceExt *iface = KTextEditor::editInterfaceExt( doc );
+ if ( iface ) iface->editBegin();
+ switch ( id )
+ {
+ case KileWidget::Structure::SectioningCut:
+ QApplication::clipboard()->setText( doc->text(row1,col1,row2,col2) ); // copy -> clipboard
+ doc->removeText(row1,col1,row2,col2); // delete
+ break;
+ case KileWidget::Structure::SectioningCopy:
+ QApplication::clipboard()->setText( doc->text(row1,col1,row2,col2) ); // copy -> clipboard
+ break;
+ case KileWidget::Structure::SectioningPaste:
+ text = QApplication::clipboard()->text(); // clipboard -> text
+ if ( ! text.isEmpty() )
+ {
+ view->setCursorPositionReal(row2,col2); // insert
+ view->insertText(text + '\n');
+ }
+ break;
+ case KileWidget::Structure::SectioningSelect:
+ doc->setSelection(row1,col1,row2,col2); // select
+ break;
+ case KileWidget::Structure::SectioningDelete:
+ doc->removeText(row1,col1,row2,col2); // delete
+ break;
+ case KileWidget::Structure::SectioningComment:
+ doc->setSelection(row1,col1,row2,col2);
+ view->comment();
+ doc->clearSelection();
+ break;
+ case KileWidget::Structure::SectioningPreview:
+ doc->setSelection(row1,col1,row2,col2); // quick preview
+ m_ki->quickPreview()->previewSelection(doc,false);
+ doc->clearSelection();
+ break;
+ }
+ if ( iface ) iface->editEnd();
+
+ // update structure view, because it has changed
+ if ( id==KileWidget::Structure::SectioningDelete || id==KileWidget::Structure::SectioningComment )
+ m_ki->viewManager()->updateStructure(true);
+
+}
+
+bool EditorExtension::findEndOfDocument(Kate::Document *doc, uint row, uint col, uint &rowFound, uint &colFound)
+{
+ KTextEditor::SearchInterface *iface;
+ iface = dynamic_cast<KTextEditor::SearchInterface *>(doc);
+
+ uint lenFound;
+ QString textline;
+ while ( iface->searchText(row,col,"\\end{document}",&rowFound,&colFound,&lenFound) )
+ {
+ textline = getTextLineReal(doc,rowFound);
+ if ( textline.find("\\end{document}",colFound) == (int)colFound )
+ return true;
+
+ row = rowFound;
+ col = colFound;
+ if ( ! increaseCursorPosition(doc,row,col) )
+ break;
+ }
+
+ return false;
+}
+
+}
+
+#include "kileedit.moc"
diff --git a/src/kile/kileedit.h b/src/kile/kileedit.h
new file mode 100644
index 0000000..aec503e
--- /dev/null
+++ b/src/kile/kileedit.h
@@ -0,0 +1,260 @@
+/***************************************************************************
+ date : Feb 20 2007
+ version : 0.45
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEEDIT_H
+#define KILEEDIT_H
+
+#include <qobject.h>
+#include <qregexp.h>
+#include <qmap.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+#include <kate/document.h>
+
+#include "kilestructurewidget.h"
+#include "codecompletion.h"
+#include "latexcmd.h"
+
+/**
+ *@author Holger Danielsson
+ */
+
+class KileInfo;
+namespace KileAction { class TagData; }
+
+namespace KileDocument
+{
+
+class EditorExtension : public QObject
+{
+ Q_OBJECT
+
+public:
+ EditorExtension(KileInfo *);
+ ~EditorExtension();
+
+ enum EnvType { EnvNone, EnvList, EnvTab, EnvCrTab };
+
+ enum SelectMode { smTex, smLetter, smWord, smNospace };
+
+ void readConfig(void);
+
+ void insertTag(const KileAction::TagData& data, Kate::View *view);
+
+ QString getTextLineReal(Kate::Document *doc, uint row);
+ void gotoBullet(bool backwards, Kate::View *view = 0L);
+
+ void gotoEnvironment(bool backwards, Kate::View *view = 0L);
+ void matchEnvironment(Kate::View *view = 0L);
+ void closeEnvironment(Kate::View *view = 0L);
+ void closeAllEnvironments(Kate::View *view = 0L);
+ void selectEnvironment(bool inside, Kate::View *view = 0L);
+ void deleteEnvironment(bool inside, Kate::View *view = 0L);
+ QString autoIndentEnvironment() { return m_envAutoIndent; }
+
+ void gotoTexgroup(bool backwards, Kate::View *view = 0L);
+ void selectTexgroup(bool inside, Kate::View *view = 0L);
+ void deleteTexgroup(bool inside, Kate::View *view = 0L);
+
+ const QStringList doubleQuotesList() { return m_quoteList; }
+
+ // get current word
+ bool getCurrentWord(Kate::Document *doc,uint row,uint col, SelectMode mode,QString &word,uint &x1,uint &x2);
+ QString getEnvironmentText(uint &row, uint &col, QString &name, Kate::View *view = 0L);
+ bool hasEnvironment(Kate::View *view = 0L);
+
+ // complete environment
+ bool eventInsertEnvironment(Kate::View *view);
+
+ // mathgroup
+ QString getMathgroupText(uint &row, uint &col, Kate::View *view = 0L);
+ bool hasMathgroup(Kate::View *view = 0L);
+
+public slots:
+ void insertIntelligentNewline(Kate::View *view = 0L);
+
+ void selectEnvInside() { selectEnvironment(true); }
+ void selectEnvOutside() { selectEnvironment(false); }
+ void deleteEnvInside() { deleteEnvironment(true); }
+ void deleteEnvOutside() {deleteEnvironment(false); }
+ void gotoBeginEnv() { gotoEnvironment(true); }
+ void gotoEndEnv() { gotoEnvironment(false); }
+ void matchEnv() { matchEnvironment(); }
+ void closeEnv() {closeEnvironment(); }
+ void closeAllEnv() {closeAllEnvironments(); }
+
+ void selectTexgroupInside() { selectTexgroup(true); }
+ void selectTexgroupOutside() { selectTexgroup(false); }
+ void deleteTexgroupInside() { deleteTexgroup(true); }
+ void deleteTexgroupOutside() { deleteTexgroup(false); }
+ void gotoBeginTexgroup() { gotoTexgroup(true); }
+ void gotoEndTexgroup() { gotoTexgroup(false); }
+ void matchTexgroup(Kate::View *view = 0L);
+ void closeTexgroup(Kate::View *view = 0L);
+
+ void selectParagraph(Kate::View *view = 0L);
+ void selectLine(Kate::View *view = 0L);
+ void selectWord(SelectMode mode = smTex, Kate::View *view = 0L);
+ void deleteParagraph(Kate::View *view = 0L);
+ void deleteEndOfLine(Kate::View *view = 0L);
+ void deleteWord(SelectMode mode = smTex, Kate::View *view = 0L);
+
+ void selectMathgroup(Kate::View *view = 0L);
+ void deleteMathgroup(Kate::View *view = 0L);
+
+ void nextBullet(Kate::View* view = 0L);
+ void prevBullet(Kate::View* view = 0L);
+ void insertBullet(Kate::View* view = 0L);
+
+ void gotoLine(Kate::View *view = 0L);
+ void gotoNextParagraph(Kate::View *view = 0L);
+ void gotoPrevParagraph(Kate::View *view = 0L);
+
+ void gotoNextSectioning();
+ void gotoPrevSectioning();
+ void sectioningCommand(KileListViewItem *item, int id);
+
+ bool insertDoubleQuotes();
+ void initDoubleQuotes();
+
+ void insertIntelligentTabulator();
+private:
+
+ enum EnvTag { EnvBegin, EnvEnd };
+
+ enum EnvPos { EnvLeft, EnvInside, EnvRight };
+
+ enum MathTag { mmNoMathMode, mmMathDollar, mmMathParen, mmDisplaymathParen, mmMathEnv, mmDisplaymathEnv };
+
+ struct EnvData
+ {
+ uint row;
+ uint col;
+ QString name;
+ uint len;
+ EnvPos cpos;
+ EnvTag tag;
+ EnvType type;
+ };
+
+ struct MathData
+ {
+ uint row;
+ uint col;
+ uint len;
+ uint numdollar;
+ MathTag tag;
+ QString envname;
+ };
+
+ struct BracketData
+ {
+ uint row;
+ uint col;
+ bool open;
+ };
+
+ QRegExp m_reg;
+ bool m_overwritemode;
+ QString m_envAutoIndent;
+
+ // change cursor position
+ bool increaseCursorPosition(Kate::Document *doc, uint &row, uint &col);
+ bool decreaseCursorPosition(Kate::Document *doc, uint &row, uint &col);
+
+ // check position
+ bool isValidBackslash(Kate::Document *doc, uint row, uint col);
+ bool isCommentPosition(Kate::Document *doc, uint row, uint col);
+ bool isEnvironmentPosition(Kate::Document *doc, uint row, uint col,EnvData &env);
+
+ // find environment tags
+ bool findBeginEnvironment(Kate::Document *doc, uint row, uint col,EnvData &env);
+ bool findEndEnvironment(Kate::Document *doc, uint row, uint col,EnvData &env);
+ bool findEnvironmentTag(Kate::Document *doc, uint row, uint col,EnvData &env, bool backwards=false);
+ bool findOpenedEnvironment(uint &row,uint &col, QString &envname, Kate::View *view);
+ QStringList findOpenedEnvironmentList(Kate::View *view, bool position = false);
+
+ // get current environment
+ bool getEnvironment(bool inside, EnvData &envbegin, EnvData &envend,Kate::View *view);
+ bool expandSelectionEnvironment(bool inside, Kate::View *view);
+
+ // find brackets
+ bool isBracketPosition(Kate::Document *doc, uint row, uint col, BracketData &bracket);
+ bool findOpenBracket(Kate::Document *doc, uint row, uint col, BracketData &bracket);
+ bool findCloseBracket(Kate::Document *doc, uint row, uint col, BracketData &bracket);
+ bool findCloseBracketTag(Kate::Document *doc, uint row, uint col,BracketData &bracket);
+ bool findOpenBracketTag(Kate::Document *doc, uint row, uint col, BracketData &bracket);
+
+ // find math tags
+ bool isOpeningMathTagPosition(Kate::Document *doc, uint row, uint col, MathData &mathdata);
+ bool isClosingMathTagPosition(Kate::Document *doc, uint row, uint col, MathData &mathdata);
+ bool findOpenMathTag(Kate::Document *doc, uint row, uint col, QRegExp &reg, MathData &mathdata);
+ bool findCloseMathTag(Kate::Document *doc, uint row, uint col, QRegExp &reg, MathData &mathdata);
+ bool checkMathtags(const MathData &begin,const MathData &end);
+
+ // mathgroup
+ bool getMathgroup(Kate::View *view, uint &row1, uint &col1, uint &row2, uint &col2);
+
+ // get current Texgroup
+ bool getTexgroup(bool inside, BracketData &open, BracketData &close, Kate::View *view);
+
+ // find current paragraph
+ bool findCurrentTexParagraph(uint &startline, uint &endline, Kate::View *view);
+
+ // sectioning commands
+ void gotoSectioning(bool backwards, Kate::View *view = 0L);
+ bool findEndOfDocument(Kate::Document *doc, uint row,uint col, uint &rowFound, uint &colFound);
+
+ // check environment type
+ KileDocument::LatexCommands *m_latexCommands;
+ bool shouldCompleteEnv(const QString &envname, Kate::View *view);
+ QString getWhiteSpace(const QString &s);
+
+ // verbatim text
+ bool insideVerb(Kate::View *view);
+ bool insideVerbatim(Kate::View *view);
+
+ // complete environments
+ QRegExp m_regexpEnter;
+
+ // double Quotes
+ bool m_dblQuotes;
+ QStringList m_quoteList;
+ QString m_leftDblQuote, m_rightDblQuote;
+
+ // help
+ void readHelpList(QString const &filename);
+
+ Kate::View *determineView(Kate::View *);
+
+ KileInfo *m_ki;
+
+//code completion
+public slots:
+ void completeWord();
+ void completeEnvironment();
+ void completeAbbreviation();
+
+public:
+ CodeCompletion* complete() const { return m_complete; }
+
+private:
+ CodeCompletion *m_complete;
+};
+
+}
+
+#endif
diff --git a/src/kile/kileerrorhandler.cpp b/src/kile/kileerrorhandler.cpp
new file mode 100644
index 0000000..abfad07
--- /dev/null
+++ b/src/kile/kileerrorhandler.cpp
@@ -0,0 +1,213 @@
+/***************************************************************************
+ begin : Tue May 25 2004
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kileerrorhandler.h"
+
+#include <ktabwidget.h>
+#include <qfileinfo.h>
+#include <qregexp.h>
+
+#include <klocale.h>
+#include <kurl.h>
+#include <kate/document.h>
+#include <kate/view.h>
+
+#include "kiletool_enums.h"
+#include "kilelogwidget.h"
+#include "kileoutputwidget.h"
+#include "kileinfo.h"
+#include "latexoutputfilter.h"
+#include "latexoutputinfo.h"
+#include "kiledocmanager.h"
+#include "kilesidebar.h"
+
+KileErrorHandler::KileErrorHandler(QObject *parent, KileInfo *info, const char *name)
+ : QObject(parent, name), m_ki(info), m_nCurrentError(-1)
+{
+}
+
+
+KileErrorHandler::~KileErrorHandler()
+{
+}
+
+
+void KileErrorHandler::reset()
+{
+ m_ki->setLogPresent(false);
+ m_nCurrentError = -1;
+}
+
+void KileErrorHandler::ViewLog()
+{
+ m_ki->outputView()->showPage(m_ki->logWidget());
+ m_ki->setLogPresent(false);
+
+ QString cn = m_ki->getCompileName();
+ if ( m_ki->outputFilter()->source() != cn )
+ {
+ m_ki->outputFilter()->setSource(cn);
+ m_ki->outputFilter()->Run(cn.replace(QRegExp("\\..*$"),".log"));
+ }
+
+ QString log = m_ki->outputFilter()->log();
+
+ if (!log.isNull())
+ {
+ m_ki->logWidget()->setText(log);
+ m_ki->logWidget()->highlight();
+ m_ki->logWidget()->scrollToBottom();
+ m_ki->setLogPresent(true);
+ }
+ else
+ {
+ m_ki->logWidget()->printProblem(KileTool::Error, i18n("Cannot open log file; did you run LaTeX?"));
+ }
+}
+
+void KileErrorHandler::jumpToFirstError()
+{
+ int sz = m_ki->outputInfo()->size();
+ for (int i = 0; i < sz; ++i )
+ {
+ if ( (*m_ki->outputInfo())[i].type() == LatexOutputInfo::itmError )
+ {
+ jumpToProblem(&(*m_ki->outputInfo())[i]);
+ m_nCurrentError = i;
+ m_ki->logWidget()->highlightByIndex(i, sz, -1);
+ break;
+ }
+ }
+}
+
+void KileErrorHandler::jumpToProblem(OutputInfo *info)
+{
+ QString file = m_ki->getFullFromPrettyName(info->source());
+
+ if ( !file.isNull() )
+ {
+ m_ki->docManager()->fileOpen(KURL::fromPathOrURL(file));
+ int line = info->sourceLine() > 0 ? (info->sourceLine() - 1) : 0;
+
+ Kate::Document *doc = m_ki->docManager()->docFor(KURL::fromPathOrURL(file));
+ if ( doc )
+ {
+ Kate::View* view = (Kate::View*)doc->views().first();
+ if (view) view->setCursorPosition(line, 0);
+ }
+ }
+}
+
+void KileErrorHandler::showLogResults(const QString &src)
+{
+ m_ki->logWidget()->clear();
+ m_ki->setLogPresent(false);
+ m_ki->outputFilter()->setSource(src);
+ QFileInfo fi(src);
+ QString lf = fi.dirPath(true) + '/' + fi.baseName(true) + ".log";
+ m_ki->logWidget()->printMsg(KileTool::Info, i18n("Detecting errors (%1), please wait ...").arg(lf), i18n("Log") );
+ if ( ! m_ki->outputFilter()->Run( lf ) )
+ {
+
+ m_ki->outputFilter()->setSource(QString::null);
+ return;
+ }
+ else
+ m_ki->logWidget()->printMsg(KileTool::Info, i18n("Done."), i18n("Log") );
+}
+
+void KileErrorHandler::jumpToProblem(int type, bool forward)
+{
+ static LatexOutputInfoArray::iterator it;
+
+ //if the current log file does not belong to the files the user is viewing
+ //reparse the correct log file
+ QString cn = m_ki->getCompileName();
+ bool correctlogfile = (cn == m_ki->outputFilter()->source());
+ if ( ! correctlogfile ) showLogResults(cn);
+
+ if (!m_ki->outputInfo()->isEmpty())
+ {
+ int sz = m_ki->outputInfo()->size();
+ int pl = forward ? 1 : -1;
+ bool found = false;
+
+ //look for next problem of requested type
+ for ( int i = 0; i < sz; ++i )
+ {
+ //always look at the whole outputInfo array, but start
+ //at the problem adjacent to the current error
+ //if we go beyond the bounds of the array we use
+ //a simple "modulo" calculation to get within bounds again
+ int index = (m_nCurrentError + (i + 1) *pl) % sz;
+ while ( index < 0 ) index += sz;
+
+ if ( (*m_ki->outputInfo())[index].type() == type )
+ {
+ m_nCurrentError = index;
+ found = true;
+ break;
+ }
+ }
+
+ if ( !found ) return;
+
+ //If the log file is being viewed, use this to jump to the errors,
+ //otherwise, use the error summary display
+ if (m_ki->logPresent())
+ m_ki->logWidget()->highlight( (*m_ki->outputInfo())[m_nCurrentError].outputLine(), pl );
+ else
+ m_ki->logWidget()->highlightByIndex(m_nCurrentError, sz, pl);
+
+ jumpToProblem(&(*m_ki->outputInfo())[m_nCurrentError]);
+ }
+
+ if (m_ki->outputInfo()->isEmpty() && correctlogfile)
+ {
+ m_ki->logWidget()->append("\n<font color=\"#008800\">"+ i18n("No LaTeX errors detected.") + "</font>");
+ }
+}
+
+void KileErrorHandler::NextError()
+{
+ jumpToProblem(LatexOutputInfo::itmError, true);
+}
+
+void KileErrorHandler::PreviousError()
+{
+ jumpToProblem(LatexOutputInfo::itmError, false);
+}
+
+void KileErrorHandler::NextWarning()
+{
+ jumpToProblem(LatexOutputInfo::itmWarning, true);
+}
+
+void KileErrorHandler::PreviousWarning()
+{
+ jumpToProblem(LatexOutputInfo::itmWarning, false);
+}
+
+void KileErrorHandler::NextBadBox()
+{
+ jumpToProblem(LatexOutputInfo::itmBadBox, true);
+}
+
+void KileErrorHandler::PreviousBadBox()
+{
+ jumpToProblem(LatexOutputInfo::itmBadBox, false);
+}
+
+#include "kileerrorhandler.moc"
diff --git a/src/kile/kileerrorhandler.h b/src/kile/kileerrorhandler.h
new file mode 100644
index 0000000..413d1bf
--- /dev/null
+++ b/src/kile/kileerrorhandler.h
@@ -0,0 +1,60 @@
+/***************************************************************************
+ begin : Tue May 25 2004
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEERRORHANDLER_H
+#define KILEERRORHANDLER_H
+
+#include <qobject.h>
+
+/**
+@author Jeroen Wijnhout
+*/
+
+class KileInfo;
+class OutputInfo;
+
+class KileErrorHandler : public QObject
+{
+ Q_OBJECT
+public:
+ KileErrorHandler(QObject *parent, KileInfo *info, const char *name = 0);
+
+ ~KileErrorHandler();
+
+/* log view, error handling */
+private slots:
+ void ViewLog();
+ void NextError();
+ void PreviousError();
+ void NextWarning();
+ void PreviousWarning();
+ void NextBadBox();
+ void PreviousBadBox();
+
+private:
+ void jumpToProblem(int type, bool);
+ void jumpToProblem(OutputInfo *);
+
+public slots:
+ void jumpToFirstError();
+ void reset();
+ void showLogResults(const QString &);
+
+private:
+ KileInfo *m_ki;
+ int m_nCurrentError;
+};
+
+#endif
diff --git a/src/kile/kileeventfilter.cpp b/src/kile/kileeventfilter.cpp
new file mode 100644
index 0000000..9879488
--- /dev/null
+++ b/src/kile/kileeventfilter.cpp
@@ -0,0 +1,71 @@
+//
+// C++ Implementation: kileeventfilter
+//
+// Description:
+//
+//
+// Author: Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+// 2007-03-17 dani
+// - select a single LaTeX command with CTRL+MouseDblClick-left
+// (such a double click on the middle part '\def' of '\abd\def\ghi'
+// will select only '\def\', not the whole text, as it does now)
+
+#include "kileeventfilter.h"
+
+#include <qevent.h>
+
+#include <kate/view.h>
+#include <kate/document.h>
+#include "kiledebug.h"
+
+#include "kileedit.h"
+#include "kileconfig.h"
+
+KileEventFilter::KileEventFilter(KileDocument::EditorExtension *edit) : m_edit(edit)
+{
+ readConfig();
+}
+
+void KileEventFilter::readConfig()
+{
+ m_bCompleteEnvironment = KileConfig::completeEnvironment();
+}
+
+// KateViewInternal as a child of Kate::View has the focus
+// This was set with Kate::View::setFocusProxy(viewInternal)
+
+bool KileEventFilter::eventFilter(QObject *o, QEvent *e)
+{
+ if ( e->type() == QEvent::KeyPress)
+ {
+ QKeyEvent *ke = (QKeyEvent*) e;
+ if ( ke->key()==Qt::Key_QuoteDbl && ke->ascii()==Qt::Key_QuoteDbl )
+ {
+ return m_edit->insertDoubleQuotes();
+ }
+ if ( m_bCompleteEnvironment && ke->key()==Qt::Key_Return && ke->state()==0)
+ {
+ return m_edit->eventInsertEnvironment( (Kate::View*) o->parent() );
+ }
+ }
+ else if ( e->type() == QEvent::MouseButtonDblClick)
+ {
+ QMouseEvent *me = (QMouseEvent*) e;
+ if ( me->button()==LeftButton && ((me->state() & Qt::ControlButton) == Qt::ControlButton) )
+ {
+ m_edit->selectWord(KileDocument::EditorExtension::smTex);
+ return true;
+ }
+ }
+
+ //pass this event on
+ return false;
+}
+
+
+#include "kileeventfilter.moc"
diff --git a/src/kile/kileeventfilter.h b/src/kile/kileeventfilter.h
new file mode 100644
index 0000000..d9a99eb
--- /dev/null
+++ b/src/kile/kileeventfilter.h
@@ -0,0 +1,46 @@
+//
+// C++ Interface: kileeventfilter
+//
+// Description:
+//
+//
+// Author: Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KILEEVENTFILTER_H
+#define KILEEVENTFILTER_H
+
+#include <qobject.h>
+#include <qregexp.h>
+
+class QEvent;
+
+namespace Kate {class View; }
+namespace KileDocument { class EditorExtension; };
+
+/**
+ * This class is capable of intercepting key-strokes from the editor. It can complete a \begin{env}
+ * with a \end{env} when enter is pressed.
+ **/
+class KileEventFilter : public QObject
+{
+ Q_OBJECT
+
+public:
+ KileEventFilter(KileDocument::EditorExtension *edit);
+
+public slots:
+ void readConfig();
+
+protected:
+ bool eventFilter(QObject *o, QEvent *e);
+
+private:
+ bool m_bCompleteEnvironment;
+ KileDocument::EditorExtension *m_edit;
+
+};
+
+#endif
diff --git a/src/kile/kileextensions.cpp b/src/kile/kileextensions.cpp
new file mode 100644
index 0000000..9c01b6c
--- /dev/null
+++ b/src/kile/kileextensions.cpp
@@ -0,0 +1,167 @@
+/***************************************************************************
+ begin : Mar 12 2007
+ copyright : 2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kileextensions.h"
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qfileinfo.h>
+
+#include <klocale.h>
+#include "kiledebug.h"
+
+namespace KileDocument
+{
+
+//////////////////// Extensions ////////////////////
+
+Extensions::Extensions()
+{
+ m_documents = ".tex .ltx .latex .dtx .ins";
+ m_packages = ".cls .sty";
+ m_bibtex = ".bib";
+ m_metapost = ".mp";
+ m_script = ".js";
+ m_project = ".kilepr";
+ //m_images = ".eps .pdf .dvi .ps .fig .gif .jpg .jpeg .png";
+ m_images = ".eps .jpg .jpeg .png .pdf .ps .fig .gif";
+
+ m_latexDefault = ".tex";
+ m_bibtexDefault = ".bib";
+ m_metapostDefault = ".mp";
+ m_scriptDefault = ".js";
+ m_projectDefault = ".kilepr";
+}
+
+//////////////////// file filter ////////////////////
+
+QString Extensions::fileFilter(uint type)
+{
+ QString ext,text;
+ switch ( type )
+ {
+ case LATEX_EXT_DOC:
+ ext = m_documents;
+ text = i18n("(La)TeX Source Files");
+ break;
+ case LATEX_EXT_PKG:
+ ext = m_packages;
+ text = i18n("(La)TeX Packages");
+ break;
+ case LATEX_EXT_BIB:
+ ext = m_bibtex;
+ text = i18n("BibTeX Files");
+ break;
+ case LATEX_EXT_MP:
+ ext = m_metapost;
+ text = i18n("Metapost Files");
+ break;
+ case LATEX_EXT_JS:
+ ext = m_script;
+ text = i18n("Kile Script Files");
+ break;
+ case LATEX_EXT_PROJ:
+ ext = m_project;
+ text = i18n("Kile Project Files");
+ break;
+ default:
+ return QString::null;
+ }
+
+ ext.replace(".","*.");
+ return ext + '|' + text;
+}
+
+//////////////////// document type ////////////////////
+
+bool Extensions::isTexFile(const QString &fileName) const
+{
+ //TODO use mimetype
+ QString ext = '.' + QFileInfo(fileName).extension(false);
+ return isLatexDocument(ext) || isLatexPackage(ext);
+}
+
+bool Extensions::isBibFile(const QString &fileName) const
+{
+ QString ext = '.' + QFileInfo(fileName).extension(false);
+ return isBibtex(ext);
+}
+
+bool Extensions::isScriptFile(const QString &fileName) const
+{
+ QString ext = '.' + QFileInfo(fileName).extension(false);
+ return isScript(ext);
+}
+
+bool Extensions::isProjectFile(const QString &fileName) const
+{
+ QString ext = '.' + QFileInfo(fileName).extension(false);
+ return isProject(ext);
+}
+
+bool Extensions::validExtension(const QString &ext, const QString &extensions) const
+{
+ QStringList extlist = QStringList::split(" ",extensions);
+ for ( QStringList::ConstIterator it=extlist.begin(); it!=extlist.end(); ++it )
+ {
+ if ( (*it) == ext )
+ return true;
+ }
+
+ return false;
+}
+
+Type Extensions::determineDocumentType(const KURL& url) const
+{
+ if ( isTexFile(url) )
+ {
+ return KileDocument::LaTeX;
+ }
+ else if ( isBibFile(url) )
+ {
+ return KileDocument::BibTeX;
+ }
+ else if ( isScriptFile(url) )
+ {
+ return KileDocument::Script;
+ }
+ else
+ {
+ return KileDocument::Text;
+ }
+}
+
+QString Extensions::defaultExtensionForDocumentType(KileDocument::Type type) const
+{
+ switch(type) {
+ case KileDocument::LaTeX:
+ return m_latexDefault;
+
+ case KileDocument::BibTeX:
+ return m_bibtexDefault;
+
+ case KileDocument::Script:
+ return m_scriptDefault;
+
+ case KileDocument::Text:
+ /* fall through */
+ case KileDocument::Undefined:
+ /* do nothing */
+ break;
+ }
+ return QString();
+}
+
+}
diff --git a/src/kile/kileextensions.h b/src/kile/kileextensions.h
new file mode 100644
index 0000000..1f1807e
--- /dev/null
+++ b/src/kile/kileextensions.h
@@ -0,0 +1,92 @@
+/***************************************************************************
+ begin : Mar 12 2007
+ copyright : 2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEEXTENSIONS_H
+#define KILEEXTENSIONS_H
+
+#include "kileconstants.h"
+
+#include <qstring.h>
+#include <qstringlist.h>
+
+#include <kurl.h>
+
+namespace KileDocument
+{
+
+class Extensions
+{
+public:
+ Extensions();
+ ~Extensions() {}
+
+ enum { LATEX_EXT_DOC=1, LATEX_EXT_PKG=2, LATEX_EXT_BIB=4, LATEX_EXT_IMG=8, LATEX_EXT_MP=16, LATEX_EXT_JS=32, LATEX_EXT_PROJ=64 };
+
+ QString latexDocuments() { return m_documents; }
+ QString latexPackages() { return m_packages; }
+ QString bibtex() { return m_bibtex; }
+ QString images() { return m_images; }
+ QString metapost() { return m_metapost; }
+
+ QString latexDocumentDefault() { return m_latexDefault; }
+ QString bibtexDefault() { return m_bibtexDefault; }
+ QString metapostDefault() { return m_metapostDefault; }
+
+ QString latexDocumentFileFilter() { return fileFilter(LATEX_EXT_DOC); }
+ QString latexPackageFileFilter() { return fileFilter(LATEX_EXT_PKG); }
+ QString bibtexFileFilter() { return fileFilter(LATEX_EXT_BIB); }
+ QString imageFileFilter() { return fileFilter(LATEX_EXT_IMG); }
+ QString metapostFileFilter() { return fileFilter(LATEX_EXT_MP); }
+ QString scriptFileFilter() { return fileFilter(LATEX_EXT_JS); }
+ QString projectFileFilter() { return fileFilter(LATEX_EXT_PROJ); }
+
+ bool isTexFile(const QString &fileName) const;
+ bool isTexFile(const KURL &url) const { return isTexFile(url.fileName()); }
+ bool isBibFile(const QString &fileName) const;
+ bool isBibFile(const KURL &url) const { return isBibFile(url.fileName()); }
+ bool isScriptFile(const QString &fileName) const;
+ bool isScriptFile(const KURL & url) const { return isScriptFile(url.fileName()); }
+ bool isProjectFile(const QString &fileName) const;
+ bool isProjectFile(const KURL &url) const { return isProjectFile(url.fileName()); }
+
+ bool isLatexDocument(const QString &ext) const { return validExtension(ext,m_documents); }
+ bool isLatexPackage(const QString &ext) const { return validExtension(ext,m_packages); }
+ bool isImage(const QString &ext) const { return validExtension(ext,m_images); }
+
+ KileDocument::Type determineDocumentType(const KURL &url) const;
+ QString defaultExtensionForDocumentType(KileDocument::Type type) const;
+
+private:
+ QString m_documents, m_packages;
+ QString m_bibtex, m_metapost;
+ QString m_images, m_script;
+ QString m_project;
+
+ QString m_latexDefault, m_bibtexDefault;
+ QString m_metapostDefault, m_scriptDefault;
+ QString m_projectDefault;
+
+ bool isBibtex(const QString &ext) const { return validExtension(ext,m_bibtex); }
+ bool isMetapost(const QString &ext) const { return validExtension(ext,m_metapost); }
+ bool isScript(const QString &ext) const { return validExtension(ext,m_script); }
+ bool isProject(const QString &ext) const { return validExtension(ext,m_project); }
+ bool validExtension(const QString &ext, const QString &extensions) const;
+
+ QString fileFilter(uint type);
+};
+
+}
+
+#endif
diff --git a/src/kile/kilefileselect.cpp b/src/kile/kilefileselect.cpp
new file mode 100644
index 0000000..1c67980
--- /dev/null
+++ b/src/kile/kilefileselect.cpp
@@ -0,0 +1,169 @@
+/***************************************************************************
+ begin : Wed Aug 14 2002
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email :
+
+from Kate (C) 2001 by Matt Newell
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// 2007-03-12 dani
+// - use KileDocument::Extensions
+
+#include "kilefileselect.h"
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qstrlist.h>
+#include <qtooltip.h>
+
+#include <ktoolbar.h>
+#include <kiconloader.h>
+#include <kprotocolinfo.h>
+#include <kconfig.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kcombobox.h>
+#include <kcharsets.h>
+#include "kiledebug.h"
+
+#include "kileconfig.h"
+
+KileFileSelect::KileFileSelect(KileDocument::Extensions *extensions, QWidget *parent, const char *name ) : QWidget(parent,name)
+{
+ QVBoxLayout* lo = new QVBoxLayout(this);
+
+ KToolBar *toolbar = new KToolBar(this, "fileselectortoolbar");
+ lo->addWidget(toolbar);
+
+ cmbPath = new KURLComboBox( KURLComboBox::Directories, true, this, "path combo" );
+ cmbPath->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ));
+ cmpl = new KURLCompletion(KURLCompletion::DirCompletion);
+ cmbPath->setCompletionObject( cmpl );
+ lo->addWidget(cmbPath);
+
+ dir = new KDirOperator(KURL(), this, "operator");
+ connect(dir, SIGNAL(fileSelected(const KFileItem*)), this, SIGNAL(fileSelected(const KFileItem*)));
+ dir->setView(KFile::Simple);
+ dir->setMode(KFile::Files);
+
+ // KileFileSelect filter for sidebar
+ QString filter = extensions->latexDocuments()
+ + ' ' + extensions->latexPackages()
+ + ' ' + extensions->bibtex()
+ + ' ' + extensions->metapost();
+ filter.replace(".","*.");
+ dir->setNameFilter(filter);
+
+ KActionCollection *coll = dir->actionCollection();
+ // some shortcuts of diroperator that clashes with Kate
+ coll->action( "delete" )->setShortcut( KShortcut( ALT + Key_Delete ) );
+ coll->action( "reload" )->setShortcut( KShortcut( ALT + Key_F5 ) );
+ coll->action( "back" )->setShortcut( KShortcut( ALT + SHIFT + Key_Left ) );
+ coll->action( "forward" )->setShortcut( KShortcut( ALT + SHIFT + Key_Right ) );
+ // some consistency - reset up for dir too
+ coll->action( "up" )->setShortcut( KShortcut( ALT + SHIFT + Key_Up ) );
+ coll->action( "home" )->setShortcut( KShortcut( CTRL + ALT + Key_Home ) );
+
+ coll->action("home")->plug(toolbar);
+ coll->action("up")->plug(toolbar);
+ coll->action("back")->plug(toolbar);
+ coll->action("forward")->plug(toolbar);
+
+ toolbar->insertButton("fileopen", 0, true , i18n( "Open selected" ));
+ connect(toolbar, SIGNAL(clicked(int)), this, SLOT(clickedToolbar(int)));
+
+ lo->addWidget(dir);
+ lo->setStretchFactor(dir, 2);
+
+ m_comboEncoding = new KComboBox( false, this, "comboEncoding" );
+ QStringList availableEncodingNames(KGlobal::charsets()->availableEncodingNames());
+ m_comboEncoding->setEditable( true );
+ m_comboEncoding->insertStringList( availableEncodingNames );
+ QToolTip::add(m_comboEncoding, i18n("Set encoding"));
+ lo->addWidget(m_comboEncoding);
+
+ connect( cmbPath, SIGNAL( urlActivated( const KURL& )),this, SLOT( cmbPathActivated( const KURL& ) ));
+ connect( cmbPath, SIGNAL( returnPressed( const QString& )), this, SLOT( cmbPathReturnPressed( const QString& ) ));
+ connect(dir, SIGNAL(urlEntered(const KURL&)), this, SLOT(dirUrlEntered(const KURL&)) );
+}
+
+KileFileSelect::~KileFileSelect()
+{
+ delete cmpl;
+}
+
+void KileFileSelect::readConfig()
+{
+ QString lastDir = KileConfig::lastDir();
+ QFileInfo ldi(lastDir);
+ if ( ! ldi.isReadable() ) dir->home();
+ else setDir(KURL::fromPathOrURL(lastDir));
+}
+
+void KileFileSelect::writeConfig()
+{
+ KileConfig::setLastDir(dir->url().path());
+}
+
+void KileFileSelect::setView(KFile::FileView view)
+{
+ dir->setView(view);
+}
+
+void KileFileSelect::cmbPathActivated( const KURL& u )
+{
+ dir->setURL( u, true );
+}
+
+void KileFileSelect::cmbPathReturnPressed( const QString& u )
+{
+ dir->setFocus();
+ dir->setURL( KURL(u), true );
+}
+
+void KileFileSelect::dirUrlEntered( const KURL& u )
+{
+ cmbPath->removeURL( u );
+ QStringList urls = cmbPath->urls();
+ urls.prepend( u.url() );
+ while ( urls.count() >= (uint)cmbPath->maxItems() )
+ urls.remove( urls.last() );
+ cmbPath->setURLs( urls );
+}
+
+void KileFileSelect::focusInEvent(QFocusEvent*)
+{
+ dir->setFocus();
+}
+
+void KileFileSelect::setDir( KURL u )
+{
+ dir->setURL(u, true);
+}
+
+void KileFileSelect::clickedToolbar(int i)
+{
+ if (i == 0)
+ {
+ QPtrListIterator<KFileItem> it(*dir->selectedItems());
+ while ( it.current() != 0 )
+ {
+ emit(fileSelected(*it));
+ ++it;
+ }
+
+ dir->view()->clearSelection();
+ }
+}
+
+#include "kilefileselect.moc"
diff --git a/src/kile/kilefileselect.h b/src/kile/kilefileselect.h
new file mode 100644
index 0000000..ecaed9c
--- /dev/null
+++ b/src/kile/kilefileselect.h
@@ -0,0 +1,77 @@
+/***************************************************************************
+ begin : Wed Aug 14 2002
+ copyright : (C) 2002 - 2003 by Pascal Brachet, 2003 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+
+from Kate (C) 2001 by Matt Newell
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEFILESELECT_H
+#define KILEFILESELECT_H
+
+#include <qwidget.h>
+#include <qtoolbutton.h>
+#include <kfile.h>
+#include <kdiroperator.h>
+#include <kurlcombobox.h>
+#include <kurlcompletion.h>
+#include <kurl.h>
+
+#include "kileextensions.h"
+
+/**
+ *@author Jeroen Wijnhout
+ */
+
+class KFileItem;
+class KComboBox;
+
+class KileFileSelect : public QWidget
+{
+ Q_OBJECT
+
+public:
+ KileFileSelect(KileDocument::Extensions *extensions, QWidget *parent=0, const char *name=0);
+ ~KileFileSelect();
+
+ void setView(KFile::FileView);
+ KDirOperator * dirOperator(){return dir;}
+ KComboBox* comboEncoding() { return m_comboEncoding; }
+
+public slots:
+ void setDir(KURL);
+ void readConfig();
+ void writeConfig();
+
+private slots:
+ void cmbPathActivated( const KURL& u );
+ void cmbPathReturnPressed( const QString& u );
+ void dirUrlEntered( const KURL& u );
+
+ void clickedToolbar(int);
+
+protected:
+ void focusInEvent(QFocusEvent*);
+
+signals:
+ void fileSelected(const KFileItem*);
+
+private:
+ KURLComboBox *cmbPath;
+ KDirOperator * dir;
+ KComboBox *m_comboEncoding;
+ QToolButton *home, *up, *back, *forward;
+ KURLCompletion *cmpl;
+};
+
+#endif
diff --git a/src/kile/kilegrepdialog.cpp b/src/kile/kilegrepdialog.cpp
new file mode 100644
index 0000000..443ff2c
--- /dev/null
+++ b/src/kile/kilegrepdialog.cpp
@@ -0,0 +1,886 @@
+/* This file is part of the kile project
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 2001 Anders Lund <anders.lund@lund.tdcadsl.dk>
+ Copyright (C) 2003 Jan-Marek Glogowski <glogow@stud.fbi.fh-darmstadt.de>
+ Copyright (C) 2005 Holger Danielsson <holger.danielsson@versanet.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ Original from kdebase / kate
+
+ changes: 2005-11-27 (dani)
+ - add a search for all files of a Kile project
+ (done with one grep command for each file)
+ - dialog is now based on KDialogBase
+ - an item of the resultbox ist opened when it's highlightened
+ (no double click is needed anymore)
+ - dialog is deleted after work to minimize resources
+ - added additional search modes for environments, labels etc.
+ - fixed some bugs (f.e. two slashes at the end of directory
+ names, jumping to the wrong line, wrong pattern lists)
+ - add some editable template modes to search for LaTeX commands
+ - add some predined modes to search for environments, graphics,
+ labels, and references, either all of them or some special ones
+
+ (in other words: most parts have changed to work perfectly with Kile ...)
+*/
+
+// 2007-03-12 dani
+// - use KileDocument::Extensions
+
+#include "kilegrepdialog.h"
+
+#include <qobject.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qlineedit.h>
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qevent.h>
+#include <qregexp.h>
+#include <qwhatsthis.h>
+#include <qcursor.h>
+
+#include <kcombobox.h>
+#include <kapplication.h>
+#include <kaccelmanager.h>
+#include <kbuttonbox.h>
+#include <kfiledialog.h>
+#include <kprocess.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <klineedit.h>
+#include <klistbox.h>
+#include "kiledebug.h"
+
+#include "kileconfig.h"
+#include "kileproject.h"
+#include "kiledocmanager.h"
+#include "kileextensions.h"
+
+KileGrepDialog::KileGrepDialog(QWidget *parent, KileInfo *ki, KileGrep::Mode mode, const char *name)
+ : KDialogBase (parent, name, false, QString::null, 0, Ok, false ),
+ m_ki(ki), m_mode(mode), childproc(0), m_grepJobs(0)
+{
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+ //setWFlags( Qt::WStyle_StaysOnTop );
+
+ // build dialog
+ QVBoxLayout *vbox = new QVBoxLayout( page,5,KDialog::spacingHint() );
+
+ // project groupbox
+ QGroupBox *projectgroup = new QGroupBox( i18n("Project"),page);
+ projectgroup->setColumnLayout(0, Qt::Vertical );
+ projectgroup->layout()->setSpacing( 6 );
+ projectgroup->layout()->setMargin( 11 );
+ QGridLayout *projectgrouplayout = new QGridLayout( projectgroup->layout() );
+ projectgrouplayout->setAlignment( Qt::AlignTop );
+
+ QLabel *project_label = new QLabel(i18n("Name:"), projectgroup);
+ int labelwidth = project_label->sizeHint().width();
+
+ QLabel *projectdir_label = new QLabel(i18n("Directory:"), projectgroup);
+ if ( projectdir_label->sizeHint().width() > labelwidth )
+ labelwidth = projectdir_label->sizeHint().width();
+
+ projectname_label = new QLabel(projectgroup);
+ projectdirname_label = new QLabel(projectgroup);
+
+ projectgrouplayout->addWidget(project_label, 0,0, AlignLeft | AlignVCenter);
+ projectgrouplayout->addWidget(projectname_label, 0,1, AlignLeft | AlignVCenter);
+ projectgrouplayout->addWidget(projectdir_label, 1,0, AlignLeft | AlignVCenter);
+ projectgrouplayout->addWidget(projectdirname_label, 1,1, AlignLeft | AlignVCenter);
+ projectgrouplayout->setColStretch(1,1);
+
+ // search groupbox
+ QGroupBox *searchgroup = new QGroupBox( i18n("Search"),page);
+ searchgroup->setColumnLayout(0, Qt::Vertical );
+ searchgroup->layout()->setSpacing( 6 );
+ searchgroup->layout()->setMargin( 11 );
+ QGridLayout *searchgrouplayout = new QGridLayout( searchgroup->layout() );
+ searchgrouplayout->setAlignment( Qt::AlignTop );
+
+ QLabel *pattern_label = new QLabel(i18n("Pattern:"), searchgroup);
+ if ( pattern_label->sizeHint().width() > labelwidth )
+ labelwidth = pattern_label->sizeHint().width();
+
+ pattern_combo = new KComboBox(true, searchgroup);
+ pattern_combo->setInsertionPolicy(KComboBox::NoInsertion);
+ pattern_combo->setFocus();
+ pattern_combo->setMinimumSize(pattern_combo->sizeHint());
+ pattern_label->setBuddy(pattern_combo);
+
+ QLabel *template_label = new QLabel(i18n("Template:"), searchgroup);
+ if ( template_label->sizeHint().width() > labelwidth )
+ labelwidth = template_label->sizeHint().width();
+
+ QStringList templatemode_list;
+ templatemode_list << i18n("Normal")
+ << i18n("Command")
+ << i18n("Command[]")
+ << i18n("Environment")
+ << i18n("Image")
+ << i18n("Label")
+ << i18n("Reference")
+ << i18n("File")
+ ;
+
+ QBoxLayout *template_layout = new QHBoxLayout(4);
+ template_combo = new KComboBox(false, searchgroup);
+ template_combo->insertStringList(templatemode_list);
+ template_combo->adjustSize();
+ template_combo->setFixedSize(template_combo->size());
+ template_layout->addWidget(template_combo);
+ m_lastTemplateIndex = 0;
+
+ template_edit = new KLineEdit(searchgroup);
+ template_edit->setText("%s");
+ template_edit->setMinimumSize(template_edit->sizeHint());
+ template_label->setBuddy(template_edit);
+ template_layout->addWidget(template_edit);
+
+ searchgrouplayout->addWidget(pattern_label, 0,0, AlignLeft | AlignVCenter);
+ searchgrouplayout->addWidget(pattern_combo, 0,1);
+ searchgrouplayout->addWidget(template_label, 1,0, AlignLeft | AlignVCenter);
+ searchgrouplayout->addLayout(template_layout, 1,1);
+
+ // filter groupbox
+ QGroupBox *filtergroup = new QGroupBox( i18n("Directory Options"),page);
+ filtergroup->setColumnLayout(0, Qt::Vertical );
+ filtergroup->layout()->setSpacing( 6 );
+ filtergroup->layout()->setMargin( 11 );
+ QGridLayout *filtergrouplayout = new QGridLayout( filtergroup->layout() );
+ filtergrouplayout->setAlignment( Qt::AlignTop );
+
+ QLabel *files_label = new QLabel(i18n("Filter:"), filtergroup);
+ if ( files_label->sizeHint().width() > labelwidth )
+ labelwidth = files_label->sizeHint().width();
+
+ filter_combo = new KComboBox(true, filtergroup);
+ filter_combo->setMinimumSize(filter_combo->sizeHint());
+ files_label->setBuddy(filter_combo->focusProxy());
+
+ QLabel *dir_label = new QLabel(i18n("Directory:"), filtergroup);
+ if ( dir_label->sizeHint().width() > labelwidth )
+ labelwidth = dir_label->sizeHint().width();
+
+ QBoxLayout *dir_layout = new QHBoxLayout(3);
+ dir_combo = new KURLRequester( new KComboBox(true, filtergroup), filtergroup, "dir combo" );
+ dir_combo->completionObject()->setMode(KURLCompletion::DirCompletion);
+ dir_combo->setMode(KFile::Directory|KFile::LocalOnly|KFile::ExistingOnly);
+ dir_label->setBuddy(dir_combo);
+ dir_layout->addWidget(dir_combo);
+
+ recursive_box = new QCheckBox(i18n("Scan directories recursively"), filtergroup);
+ recursive_box->setMinimumWidth(recursive_box->sizeHint().width());
+
+ filtergrouplayout->addWidget(files_label, 2,0, AlignLeft | AlignVCenter);
+ filtergrouplayout->addWidget(filter_combo, 2, 1);
+ filtergrouplayout->addWidget(dir_label, 3,0, AlignLeft | AlignVCenter);
+ filtergrouplayout->addLayout(dir_layout, 3,1);
+ filtergrouplayout->addMultiCellWidget(recursive_box, 4,4, 1,2);
+ filtergrouplayout->setColStretch(1,1);
+
+ // result box
+ resultbox = new KListBox(page);
+ resultbox->setMinimumHeight(150);
+
+ // button box
+ KButtonBox *actionbox = new KButtonBox(page, Qt::Horizontal);
+ search_button = actionbox->addButton(i18n("&Search"));
+ search_button->setDefault(true);
+ search_button->setEnabled(false);
+ clear_button = actionbox->addButton(i18n("&Clear"));
+ clear_button->setEnabled(false);
+ actionbox->addStretch();
+#if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
+ close_button = actionbox->addButton(KStdGuiItem::close());
+#else
+ close_button = actionbox->addButton(i18n("Cl&ose"));
+#endif
+ actionbox->layout();
+
+ // adjust labels
+ project_label->setFixedWidth(labelwidth);
+ projectdir_label->setFixedWidth(labelwidth);
+ pattern_label->setFixedWidth(labelwidth);
+ template_label->setFixedWidth(labelwidth);
+ files_label->setFixedWidth(labelwidth);
+ dir_label->setFixedWidth(labelwidth);
+
+ if ( m_mode == KileGrep::Project )
+ {
+ filtergroup->hide();
+ vbox->addWidget(projectgroup);
+ vbox->addWidget(searchgroup);
+ }
+ else
+ {
+ projectgroup->hide();
+ vbox->addWidget(searchgroup);
+ vbox->addWidget(filtergroup);
+ }
+ vbox->addWidget(resultbox);
+ vbox->addWidget(actionbox);
+
+ // Produces error messages like
+ // QListBox::property( "text" ) failed:
+ // property invalid or does not exist
+ // Anyone an idea?
+ KAcceleratorManager::manage( this );
+
+ QWhatsThis::add(pattern_combo,
+ i18n("Enter the regular expression you want to search for here.<br>"
+ "Possible meta characters are:<br>"
+ "<ul>"
+ "<li>&nbsp;<b>.</b> - Matches any character</li>"
+ "<li>&nbsp;<b>^</b> - Matches the beginning of a line</li>"
+ "<li>&nbsp;<b>$</b> - Matches the end of a line</li>"
+ "<li>&nbsp;<b>\\\\\\&lt;</b> - Matches the beginning of a word</li>"
+ "<li>&nbsp;<b>\\\\\\&gt;</b> - Matches the end of a word</li>"
+ "</ul>"
+ "The following repetition operators exist:"
+ "<ul>"
+ "<li>&nbsp;<b>?</b> - The preceding item is matched at most once</li>"
+ "<li>&nbsp;<b>*</b> - The preceding item is matched zero or more times</li>"
+ "<li>&nbsp;<b>+</b> - The preceding item is matched one or more times</li>"
+ "<li>&nbsp;<b>{<i>n</i>}</b> - The preceding item is matched exactly <i>n</i> times</li>"
+ "<li>&nbsp;<b>{<i>n</i>,}</b> - The preceding item is matched <i>n</i> or more times</li>"
+ "<li>&nbsp;<b>{,<i>n</i>}</b> - The preceding item is matched at most <i>n</i> times</li>"
+ "<li>&nbsp;<b>{<i>n</i>,<i>m</i>}</b> - The preceding item is matched at least <i>n</i>, "
+ "but at most <i>m</i> times.</li>"
+ "</ul>"
+ "Furthermore, backreferences to bracketed subexpressions are "
+ "available via the notation \\\\<i>n</i>."
+ ));
+ QWhatsThis::add(filter_combo,
+ i18n("Enter the file name pattern of the files to search here. "
+ "You may give several patterns separated by commas."));
+ QWhatsThis::add(template_combo,
+ i18n("Choose one search mode. For the first modes, the search pattern is "
+ "build from the editable template, where '%s' is replaced by the given pattern.<br><br>"
+ "There are additional fixed predefined modes for environments, graphics, labels, references "
+ "and input files. If the pattern is empty, Kile will search for all commands of this mode. "
+ "If a pattern is given, it will be inserted as a parameter. F.e., in environment mode with "
+ "pattern 'center', Kile will search for '\\begin{center}' and in graphics mode with "
+ "pattern '.*\\.png', Kile will search for all png files."));
+ QWhatsThis::add(template_edit,
+ i18n("For the first three modes you can choose a template for the pattern from the combo box "
+ "and edit it here. The string %s in the template is replaced "
+ "by the pattern input field, resulting in the regular expression "
+ "to search for. In all other modes this template is ignored."));
+ QWhatsThis::add(dir_combo,
+ i18n("Enter the directory which contains the files you want to search in."));
+ QWhatsThis::add(recursive_box,
+ i18n("Check this box to search in all subdirectories."));
+ QWhatsThis::add(resultbox,
+ i18n("The results of the grep run are listed here. Select a "
+ "filename/line number combination with a mouse click on the item "
+ "or with the cursor to show the respective line in the editor."));
+
+ // read config and setup dialog for both modes
+ readConfig();
+ if ( m_mode == KileGrep::Directory )
+ {
+ setCaption(i18n("Find in Files"));
+ setupDirectory();
+ }
+ else
+ {
+ setCaption(i18n("Find in Project"));
+ setupProject();
+ }
+
+ pattern_combo->setEditText(QString::null);
+ template_edit->setText(template_list[0]);
+ slotPatternTextChanged(QString::null);
+
+ connect( pattern_combo->lineEdit(), SIGNAL(textChanged ( const QString & )),
+ SLOT( slotPatternTextChanged( const QString & )));
+ connect( template_combo, SIGNAL(activated(int)),
+ SLOT(slotTemplateActivated(int)) );
+ connect( resultbox, SIGNAL(highlighted(const QString&)),
+ SLOT(slotItemSelected(const QString&)) );
+
+ connect( search_button, SIGNAL(clicked()), SLOT(slotSearch()) );
+ connect( clear_button, SIGNAL(clicked()), SLOT(slotClear()) );
+ connect( close_button, SIGNAL(clicked()), SIGNAL(closeClicked()) );
+
+ connect( this, SIGNAL(closeClicked()), SLOT(slotClose()) );
+ connect( this, SIGNAL(finished()), SLOT(slotFinished()) );
+
+ resize(450,sizeHint().height());
+ KILE_DEBUG() << "==KileGrepDialog (create dialog)=============================" << endl;
+}
+
+KileGrepDialog::~KileGrepDialog()
+{
+ KILE_DEBUG() << "==KileGrepDialog (delete dialog)=============================" << endl;
+ writeConfig();
+ delete childproc;
+}
+
+///////////////////// config /////////////////////
+
+void KileGrepDialog::readConfig()
+{
+ pattern_combo->insertStringList( readList(KileGrep::SearchItems) );
+
+ QString labels = getCommandList(KileDocument::CmdAttrLabel);
+ QString references = getCommandList(KileDocument::CmdAttrReference);
+ template_list = readList(KileGrep::SearchTemplates) ;
+ if ( template_list.count() != 3 )
+ {
+ template_list.clear();
+ template_list << "%s" << "\\\\%s\\{" << "\\\\%s(\\[[^]]*\\])?\\{";
+ }
+ template_list << "\\\\begin\\{" // to be closed with "%s\\}"
+ << "\\\\includegraphics(\\[[^]]*\\])?\\{"
+ << "\\\\(label" + labels + ")\\{"
+ << "\\\\(ref|pageref|vref|vpageref|fref|Fref|eqref" + references + ")(\\[[^]]*\\])?\\{"
+ << "\\\\(input|include)\\{"
+ ;
+
+ if ( m_mode == KileGrep::Directory )
+ {
+ dir_combo->comboBox()->insertStringList( readList(KileGrep::SearchPaths) );
+ recursive_box->setChecked( KileConfig::grepRecursive() );
+ }
+}
+
+void KileGrepDialog::writeConfig()
+{
+ KileConfig::setLastSearchItems( getListItems(pattern_combo) );
+
+ QStringList list;
+ list << template_list[0] << template_list[1] << template_list[2];
+ KileConfig::setLastSearchTemplates( list );
+
+ if ( m_mode == KileGrep::Directory )
+ {
+ KileConfig::setLastSearchPaths( getListItems(dir_combo->comboBox()) );
+ KileConfig::setGrepRecursive( recursive_box->isChecked() );
+ }
+}
+
+///////////////////// setup search modes /////////////////////
+
+void KileGrepDialog::setupDirectory()
+{
+ setDirName( QDir::home().absPath() );
+
+ // use a filter for 'find in files' dialog
+ KileDocument::Extensions *extensions = m_ki->extensions();
+ QString filter = extensions->latexDocumentFileFilter() + '\n'
+ + extensions->latexPackageFileFilter() + '\n'
+ + extensions->bibtexFileFilter() + '\n'
+ + extensions->metapostFileFilter() + '\n'
+ + "*|" + i18n("All Files");
+ setFilter(filter);
+}
+
+void KileGrepDialog::setupProject()
+{
+ KileProject *project = m_ki->docManager()->activeProject();
+ if ( project )
+ {
+ m_projectOpened = true;
+ m_projectdir = project->baseURL().path();
+ projectname_label->setText( project->name() );
+ projectdirname_label->setText( m_projectdir );
+
+ m_projectfiles.clear();
+ m_projectfiles = m_ki->docManager()->getProjectFiles();
+ }
+ else
+ {
+ m_projectOpened = false;
+ projectname_label->setText( i18n("no project opened") );
+ projectdirname_label->setText( QString::null );
+ }
+}
+
+///////////////////// read entries /////////////////////
+
+QStringList KileGrepDialog::readList(KileGrep::List listtype)
+{
+ QStringList strings,result;
+
+ bool stripSlash = false;
+ switch ( listtype )
+ {
+ case KileGrep::SearchItems:
+ strings = KileConfig::lastSearchItems();
+ break;
+ case KileGrep::SearchPaths:
+ strings = KileConfig::lastSearchPaths();
+ stripSlash = true;
+ break;
+ case KileGrep::SearchTemplates:
+ strings = KileConfig::lastSearchTemplates();
+ break;
+ }
+
+ while (strings.count() > 0)
+ {
+ if ( stripSlash && strings[0].right(1)=="/" )
+ strings[0].truncate( strings[0].length()-1 );
+ if ( ! strings[0].isEmpty() )
+ result.append(strings[0]);
+ strings.remove(strings[0]);
+ }
+ return result;
+}
+
+///////////////////// item selected /////////////////////
+
+void KileGrepDialog::slotItemSelected(const QString& item)
+{
+ KILE_DEBUG() << "\tgrep: start item selected" << endl;
+ int pos;
+ QString filename, linenumber;
+
+ QString str = item;
+ if ( (pos = str.find(':')) != -1)
+ {
+ filename = str.left(pos);
+ str = str.right(str.length()-1-pos);
+ if ( (pos = str.find(':')) != -1)
+ {
+ linenumber = str.left(pos);
+ if ( m_mode == KileGrep::Project )
+ emit itemSelected(m_projectdir + '/' + filename,linenumber.toInt());
+ else
+ //emit itemSelected(lastSearchPaths[0] + "/" + filename,linenumber.toInt());
+ emit itemSelected(dir_combo->comboBox()->text(0) + '/' + filename,linenumber.toInt());
+ }
+ }
+}
+
+///////////////////// grep /////////////////////
+
+void KileGrepDialog::startGrep()
+{
+ childproc = new KProcess();
+ childproc->setUseShell(true);
+
+ if ( m_mode == KileGrep::Project )
+ {
+ QString command = buildProjectCommand() + ' ' + KProcess::quote(m_projectfiles[m_grepJobs-1]);
+ KILE_DEBUG() << "\tgrep (project): " << command << endl;
+ (*childproc) << QStringList::split(' ',command);
+ }
+ else
+ {
+ QString command = buildFilesCommand();
+ KILE_DEBUG() << "\tgrep (files): " << command << endl;
+ (*childproc) << QStringList::split(' ', command);
+ }
+ m_grepJobs--;
+
+ connect( childproc, SIGNAL(processExited(KProcess *)),
+ SLOT(childExited()) );
+ connect( childproc, SIGNAL(receivedStdout(KProcess *, char *, int)),
+ SLOT(receivedOutput(KProcess *, char *, int)) );
+ connect( childproc, SIGNAL(receivedStderr(KProcess *, char *, int)),
+ SLOT(receivedErrOutput(KProcess *, char *, int)) );
+
+ childproc->start(KProcess::NotifyOnExit, KProcess::AllOutput);
+}
+
+void KileGrepDialog::processOutput()
+{
+ int pos;
+ while ( (pos = buf.find('\n')) != -1)
+ {
+ QString item = buf.left(pos);
+ if ( ! item.isEmpty() )
+ {
+ if ( m_mode == KileGrep::Project )
+ {
+ if ( item.find(m_projectdir + '/') == 0 )
+ resultbox->insertItem( item.mid(m_projectdir.length()+1) );
+ else
+ resultbox->insertItem(item);
+ }
+ else
+ {
+ resultbox->insertItem( item.mid(dir_combo->url().length()+1) );
+ }
+ }
+ buf = buf.right(buf.length()-pos-1);
+ }
+ kapp->processEvents();
+}
+
+void KileGrepDialog::receivedOutput(KProcess */*proc*/, char *buffer, int buflen)
+{
+ buf += QString::fromLocal8Bit(buffer, buflen);
+ processOutput();
+}
+
+void KileGrepDialog::receivedErrOutput(KProcess */*proc*/, char *buffer, int buflen)
+{
+ errbuf += QString::fromLocal8Bit( buffer, buflen );
+}
+
+void KileGrepDialog::childExited()
+{
+// int status = childproc->exitStatus();
+
+ if ( ! errbuf.isEmpty() )
+ {
+ KMessageBox::information( parentWidget(),
+ i18n("<strong>Error:</strong><p>") + errbuf,
+ i18n("Grep Tool Error") );
+ errbuf.truncate(0);
+ }
+ else
+ finish();
+}
+
+void KileGrepDialog::finish()
+{
+ buf += '\n';
+ processOutput();
+ if ( childproc )
+ {
+ delete childproc;
+ childproc = 0;
+ }
+
+ if ( shouldRestart() )
+ {
+ startGrep();
+ }
+ else
+ {
+ updateLists();
+
+ resultbox->unsetCursor();
+ clear_button->setEnabled( resultbox->count() > 0 );
+ search_button->setText( i18n("&Search") );
+ slotPatternTextChanged( pattern_combo->lineEdit()->text() );
+ }
+}
+
+void KileGrepDialog::updateLists()
+{
+ updateListItems(pattern_combo);
+ if ( m_mode==KileGrep::Directory )
+ {
+ updateListItems(dir_combo->comboBox());
+ }
+}
+
+///////////////////// build commands /////////////////////
+
+QString KileGrepDialog::getPattern()
+{
+ QString pattern;
+ int template_mode = template_combo->currentItem();
+ if ( template_mode < KileGrep::tmEnv )
+ {
+ pattern = template_edit->text();
+ if ( pattern.isEmpty() )
+ pattern = pattern_combo->currentText();
+ else
+ pattern.replace("%s", pattern_combo->currentText());
+ }
+ else
+ {
+ pattern = template_list[template_mode];
+ if ( ! pattern_combo->currentText().isEmpty() )
+ pattern += pattern_combo->currentText() + "\\}";
+ }
+
+ return pattern;
+}
+
+QString KileGrepDialog::getShellPattern()
+{
+ QString pattern = getPattern();
+ pattern.replace("'", "'\\''");
+ return '\'' + pattern + '\'';
+ //return KProcess::quote(pattern);
+}
+
+
+QString KileGrepDialog::buildFilesCommand()
+{
+ QString files, files_temp;
+
+ if (filter_combo->currentItem() >= 0)
+ files_temp = filter_list[filter_combo->currentItem()];
+ else
+ files_temp = filter_combo->currentText();
+
+ if (files_temp.right(1) != ",")
+ files_temp = files_temp + ',';
+
+ QStringList tokens = QStringList::split ( ",", files_temp, false );
+ QStringList::Iterator it = tokens.begin();
+ if (it != tokens.end())
+ {
+ files = " '" + (*it) + '\'';
+ ++it;
+ }
+
+ for ( ; it != tokens.end(); ++it )
+ files = files + " -o -name " + '\'' + (*it) + '\'';
+
+ QString shell_command;
+ shell_command += "find ";
+ shell_command += KProcess::quote(dir_combo->url());
+ shell_command += " \\( -name ";
+ shell_command += files;
+ shell_command += " \\)";
+ if (!recursive_box->isChecked())
+ shell_command += " -maxdepth 1";
+ shell_command += " -exec grep -n -E -I -H -e " + getShellPattern() + " {} \\;";
+
+ return shell_command;
+}
+
+QString KileGrepDialog::buildProjectCommand()
+{
+ return "grep -n -E -I -H -e " + getShellPattern();
+}
+
+///////////////////// Search /////////////////////
+
+void KileGrepDialog::slotSearch()
+{
+ KILE_DEBUG() << "\tgrep: start slot search" << endl;
+ slotClear ();
+
+ if ( template_combo->currentItem()<KileGrep::tmEnv && pattern_combo->currentText().isEmpty() )
+ return;
+
+ if ( childproc && childproc->isRunning() )
+ {
+ childproc->kill();
+ return;
+ }
+
+ KILE_DEBUG() << "\tgrep: start new search" << endl;
+ QRegExp re( getPattern() );
+ if ( ! re.isValid() )
+ {
+ KMessageBox::error( 0, i18n("Invalid regular expression: %1").arg(re.errorString()), i18n("Grep Tool Error") );
+ return;
+ }
+
+ resultbox->setCursor( QCursor(Qt::WaitCursor) );
+ search_button->setText( i18n("&Cancel") );
+ if ( template_combo->currentItem() < KileGrep::tmEnv)
+ template_list[m_lastTemplateIndex] = template_edit->text();
+
+ // start grep command
+ m_grepJobs = ( m_mode == KileGrep::Project ) ? m_projectfiles.count() : 1;
+ startGrep();
+}
+
+void KileGrepDialog::slotSearchFor(const QString &pattern)
+{
+ slotClear();
+ pattern_combo->setEditText(pattern);
+ slotSearch();
+}
+
+void KileGrepDialog::slotClear()
+{
+ //KILE_DEBUG() << "\tgrep: slot clear" << endl;
+ clearGrepJobs();
+ resultbox->clear();
+ finish();
+}
+
+void KileGrepDialog::slotClose()
+{
+ //KILE_DEBUG() << "\tgrep: slot close" << endl;
+ clearGrepJobs();
+ finish();
+ delayedDestruct();
+}
+
+void KileGrepDialog::slotFinished()
+{
+ //KILE_DEBUG() << "\tgrep: slot finished" << endl;
+ finish();
+ delayedDestruct();
+}
+
+///////////////////// templates /////////////////////
+
+void KileGrepDialog::slotPatternTextChanged(const QString &)
+{
+ updateWidgets();
+}
+
+void KileGrepDialog::slotTemplateActivated(int index)
+{
+ if ( index < KileGrep::tmEnv)
+ {
+ template_list[m_lastTemplateIndex] = template_edit->text();
+ template_edit->setText( template_list[index] );
+ }
+ else
+ {
+ template_edit->setText(QString::null);
+ }
+ m_lastTemplateIndex = index;
+
+ updateWidgets();
+}
+
+void KileGrepDialog::updateWidgets()
+{
+ bool search_state = (m_mode==KileGrep::Directory) || (m_mode==KileGrep::Project && m_projectOpened);
+
+ if ( template_combo->currentItem() < KileGrep::tmEnv )
+ {
+ template_edit->setEnabled(true);
+ search_button->setEnabled( search_state && !pattern_combo->currentText().isEmpty() );
+ }
+ else
+ {
+ template_edit->setEnabled(false);
+ search_button->setEnabled( search_state );
+ }
+}
+
+///////////////////// directory /////////////////////
+
+void KileGrepDialog::setDirName(const QString &dir)
+{
+ KComboBox *combo = dir_combo->comboBox();
+
+ if ( findListItem(combo,dir) < 0 )
+ combo->insertItem(dir);
+ if ( combo->text(0) != dir)
+ slotClear();
+}
+
+///////////////////// filter /////////////////////
+
+void KileGrepDialog::setFilter(const QString &filter)
+{
+ filter_list.clear();
+ filter_combo->clear();
+ if ( !filter.isEmpty() )
+ {
+ QStringList filter_lst = QStringList::split("\n", filter);
+ for (QStringList::Iterator it = filter_lst.begin();
+ it != filter_lst.end(); ++it)
+ {
+ QStringList filter_split = QStringList::split("|", *it);
+ filter_list.append(filter_split[0]);
+ filter_combo->insertItem(filter_split[1]);
+ }
+ }
+}
+
+void KileGrepDialog::appendFilter(const QString &name, const QString &filter)
+{
+ filter_combo->insertItem(name);
+ filter_list.append(filter);
+}
+
+///////////////////// template /////////////////////
+
+void KileGrepDialog::appendTemplate(const QString &name, const QString &regexp)
+{
+ template_combo->insertItem(name);
+ template_list.append(regexp);
+}
+
+void KileGrepDialog::clearTemplates()
+{
+ template_combo->clear();
+ template_list.clear();
+}
+
+///////////////////// KComboBox /////////////////////
+
+QStringList KileGrepDialog::getListItems(KComboBox *combo)
+{
+ QStringList list;
+ for ( int i=0; i<combo->count() && i<KILEGREP_MAX; ++i )
+ list.append( combo->text(i) );
+ return list;
+}
+
+int KileGrepDialog::findListItem(KComboBox *combo, const QString &s)
+{
+ for ( int i=0; i<combo->count(); ++i )
+ {
+ if ( combo->text(i) == s )
+ return i;
+ }
+ return -1;
+}
+
+void KileGrepDialog::updateListItems(KComboBox *combo)
+{
+ QString s = combo->currentText();
+ if ( s.isEmpty() )
+ return;
+
+ int index = findListItem(combo,s);
+ if ( index > 0 ) // combo already contains s
+ {
+ combo->removeItem(index); // remove this item
+ }
+ else if ( index == -1 ) // combo doesn't contain s
+ {
+ if ( combo->count() >= KILEGREP_MAX )
+ combo->removeItem( combo->count()-1 ); // remove last item
+ }
+
+ if ( index != 0 )
+ {
+ combo->insertItem(s,0); // insert this item as first item
+ combo->setCurrentItem(0); // and select it
+ }
+}
+
+///////////////////// template /////////////////////
+
+QString KileGrepDialog::getCommandList(KileDocument::CmdAttribute attrtype)
+{
+ QStringList cmdlist;
+ QStringList::ConstIterator it;
+
+ // get info about user defined references
+ KileDocument::LatexCommands *cmd = m_ki->latexCommands();
+ cmd->commandList(cmdlist,attrtype,true);
+
+ // build list of references
+ QString commands = QString::null;
+ for ( it=cmdlist.begin(); it != cmdlist.end(); ++it )
+ {
+ commands += '|' + (*it).mid(1);
+ }
+ return commands;
+}
+
+
+#include "kilegrepdialog.moc"
diff --git a/src/kile/kilegrepdialog.h b/src/kile/kilegrepdialog.h
new file mode 100644
index 0000000..056c712
--- /dev/null
+++ b/src/kile/kilegrepdialog.h
@@ -0,0 +1,136 @@
+/* This file is part of the kile project
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 2001 Anders Lund <anders.lund@lund.tdcadsl.dk>
+ Copyright (C) 2003 Jan-Marek Glogowski <glogow@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 version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ Original from kdebase / kate
+*/
+
+#ifndef __KILE_GREP_DIALOG_H_
+#define __KILE_GREP_DIALOG_H_
+
+#include <kdialogbase.h>
+#include <qstringlist.h>
+
+#include "kileinfo.h"
+#include "latexcmd.h"
+
+class QCheckBox;
+class QPushButton;
+class QLabel;
+class QEvent;
+
+class KComboBox;
+class KLineEdit;
+class KProcess;
+class KURLRequester;
+class KListBox;
+
+#define KILEGREP_MAX 12
+
+namespace KileGrep
+{
+ enum Mode { Project=0, Directory };
+ enum List { SearchItems=0, SearchPaths, SearchTemplates };
+ enum TemplateMode { tmNormal=0,tmCommand,tmCommandWithOption,tmEnv,tmGraphics,tmLabel,tmRefs,tmFiles };
+}
+
+class KileGrepDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KileGrepDialog(QWidget *parent, KileInfo *ki, KileGrep::Mode mode, const char *name = 0);
+ ~KileGrepDialog();
+
+ void appendFilter(const QString &name, const QString &filter);
+
+ void appendTemplate(const QString &name, const QString &regexp);
+ void clearTemplates();
+
+public slots:
+ void slotSearchFor(const QString &pattern);
+
+signals:
+ void itemSelected(const QString &abs_filename, int line);
+
+private:
+ KileInfo *m_ki;
+ KileGrep::Mode m_mode;
+ KProcess *childproc;
+ int m_grepJobs;
+
+ void readConfig();
+ void writeConfig();
+
+ QStringList getListItems(KComboBox *combo);
+ int findListItem(KComboBox *combo, const QString &s);
+ void updateListItems(KComboBox *combo);
+
+ void processOutput();
+ void finish();
+
+ void startGrep();
+ bool shouldRestart() { return (m_grepJobs > 0); }
+ void clearGrepJobs() { m_grepJobs = 0; }
+ QString buildFilesCommand();
+ QString buildProjectCommand();
+ QString getPattern();
+ QString getShellPattern();
+ QString getCommandList(KileDocument::CmdAttribute attrtype);
+
+ void setupDirectory();
+ void setupProject();
+ void setDirName(const QString &dir);
+ void setFilter(const QString &filter);
+ QStringList readList(KileGrep::List listtype);
+ void updateLists();
+ void updateWidgets();
+
+ QStringList m_projectfiles;
+ QString m_projectdir;
+ bool m_projectOpened;
+
+ QLabel *projectname_label, *projectdirname_label;
+ KLineEdit *template_edit;
+ KComboBox *filter_combo, *pattern_combo, *template_combo;
+ KURLRequester *dir_combo;
+ QCheckBox *recursive_box;
+ KListBox *resultbox;
+ QPushButton *search_button, *clear_button, *close_button;
+ QString buf;
+ QString errbuf;
+ QStringList lastSearchPaths;
+ QStringList filter_list;
+ QStringList template_list;
+ int m_lastTemplateIndex;
+
+private slots:
+ void childExited();
+ void receivedOutput(KProcess *proc, char *buffer, int buflen);
+ void receivedErrOutput(KProcess *proc, char *buffer, int buflen);
+ void slotItemSelected(const QString&);
+ void slotSearch();
+ void slotClear();
+ void slotClose();
+ void slotFinished();
+ void slotPatternTextChanged(const QString &);
+ void slotTemplateActivated(int index);
+};
+
+#endif // __KILE_GREP_DIALOG_H_
diff --git a/src/kile/kilehelp.cpp b/src/kile/kilehelp.cpp
new file mode 100644
index 0000000..6f5d082
--- /dev/null
+++ b/src/kile/kilehelp.cpp
@@ -0,0 +1,362 @@
+/***************************************************************************
+ date : Feb 12 2007
+ version : 0.30
+ copyright : (C) 2004-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kilehelp.h"
+
+#include <qdir.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qregexp.h>
+#include <qfileinfo.h>
+
+#include <kapplication.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include "kiledebug.h"
+#include <klocale.h>
+#include <kate/document.h>
+
+#include "kiletool_enums.h"
+#include "kiletoolmanager.h"
+#include "kileviewmanager.h"
+#include "kileinfo.h"
+#include "kilelogwidget.h"
+#include "kilestdtools.h"
+#include "kileconfig.h"
+
+
+// tbraun 27.06.2007
+// it _looks_ like texlive 2007 has the same layout than texlive 2005 so don't get confused about the variable names :)
+
+namespace KileHelp
+{
+
+ Help::Help(KileDocument::EditorExtension *edit) : m_edit(edit), m_userhelp(0L)
+ {
+ readHelpList("latex-kile.lst",m_dictHelpKile);
+ initTexDocumentation();
+ }
+
+ Help::~Help()
+ {
+ delete m_userhelp;
+ }
+
+ void Help::initTexDocumentation()
+ {
+ // use documentation for teTeX v2.x, v3.x or TexLive2005
+ m_texdocPath = KileConfig::location();
+
+ // first check for TexLive2005
+ QString texref = m_texdocPath + "/english/tex-refs";
+ QDir dir(texref);
+ if ( dir.exists() )
+ {
+ // we found TexLive2005
+ m_texVersion = TEXLIVE2005;
+ m_texReference = "/english/tex-refs/";
+ readHelpList("latex-texlive-3.9.lst",m_dictHelpTex);
+ }
+ else
+ {
+ // now we check for tetex3
+ dir.setPath(m_texdocPath + "/latex/tex-refs");
+ if ( dir.exists() )
+ {
+ m_texVersion = TETEX3;
+ // check if this is buggy tetex3.0 or an updated version with subdirectory 'html'
+ dir.setPath(m_texdocPath + "/latex/tex-refs/html");
+ m_texReference = ( dir.exists() )
+ ? "/latex/tex-refs/html/" : "/latex/tex-refs/";
+ readHelpList("latex-tetex3.lst",m_dictHelpTex);
+ }
+ else
+ {
+ // we set it to tetex2 (what else should it be?)
+ m_texVersion = TETEX2;
+ m_texReference = "/latex/latex2e-html/";
+ readHelpList("latex-tetex.lst",m_dictHelpTex);
+ }
+ }
+ }
+
+ ////////////////////// update path to TeX documentation //////////////////////
+
+ void Help::update()
+ {
+ if ( m_texdocPath != KileConfig::location() )
+ initTexDocumentation();
+ }
+
+ ////////////////////// set parameter/initialize user help //////////////////////
+
+ void Help::setUserhelp(KileTool::Manager *manager, KMenuBar *menubar)
+ {
+ m_manager = manager;
+ m_userhelp = new UserHelp(manager,menubar);
+ }
+
+ void Help::enableUserhelpEntries(bool state)
+ {
+ if ( m_userhelp )
+ m_userhelp->enableUserHelpEntries(state);
+ }
+ ////////////////////// show help //////////////////////
+
+ void Help::showHelpFile(const QString &parameter)
+ {
+ KileTool::ViewHTML *tool = new KileTool::ViewHTML("ViewHTML", m_manager, false);
+ tool->setFlags(KileTool::NeedSourceExists | KileTool::NeedSourceRead);
+ //FIXME strip the #label part of the source (not the target),
+ //somehow this is already done somewhere (by accident),
+ //bad to rely on it
+ tool->setMsg(KileTool::NeedSourceExists, i18n("Sorry, could not find the teTeX documentation at %1; set the correct path in Settings->Configure Kile->Help."));
+ tool->setSource(parameter);
+ tool->setTargetPath(QFileInfo(parameter).fileName());
+ tool->prepareToRun();
+ m_manager->run(tool);
+ }
+
+ void Help::helpKeyword()
+ {
+ //FIXME: we should have a better way to access the current view
+ helpKeyword(m_manager->info()->viewManager()->currentTextView());
+ }
+
+////////////////////// Help: TexDoc //////////////////////
+
+ void Help::helpDocBrowser()
+ {
+ KileDialog::TexDocDialog *dlg = new KileDialog::TexDocDialog();
+ dlg->exec();
+ delete dlg;
+ }
+
+////////////////////// Help: TeTeX //////////////////////
+
+ void Help::helpTexGuide()
+ {
+ QString filename;
+
+ switch ( m_texVersion )
+ {
+ case TEXLIVE2005:
+ filename = "english/texlive-en/live.html";
+ break;
+ case TETEX3:
+ filename = "index.html";
+ break;
+ case TETEX2:
+ filename = "newhelpindex.html";
+ break;
+ default:
+ return;
+ }
+
+ showHelpFile( m_texdocPath + '/' + filename );
+ }
+
+////////////////////// Help: LaTeX //////////////////////
+
+ void Help::helpLatex(Type type)
+ {
+ QString link;
+
+ if ( m_texVersion == TEXLIVE2005)
+ {
+ switch ( type )
+ {
+ case HelpLatexIndex:
+ link = "tex-refs.html#latex";
+ break;
+ case HelpLatexCommand:
+ link = "tex-refs.html#tex-refs-idx";
+ break;
+ case HelpLatexSubject:
+ link = "tex-refs.html#commands";
+ break;
+ case HelpLatexEnvironment:
+ link = "tex-refs.html#env-latex";
+ break;
+ default:
+ return;
+ }
+ }
+ else if ( m_texVersion == TETEX3)
+ {
+ switch ( type )
+ {
+ case HelpLatexIndex:
+ link = "latex.html#latex";
+ break;
+ case HelpLatexCommand:
+ link = "appendices.html#tex-refs-idx";
+ break;
+ case HelpLatexSubject:
+ link = "latex.html#commands";
+ break;
+ case HelpLatexEnvironment:
+ link = "latex.html#environments";
+ break;
+ default:
+ return;
+ }
+ }
+ else
+ {
+ switch ( type )
+ {
+ case HelpLatexCommand:
+ link = "ltx-2.html#cmd";
+ break;
+ case HelpLatexSubject:
+ link = "ltx-2.html#subj";
+ break;
+ case HelpLatexEnvironment:
+ link = "ltx-2.html#env";
+ break;
+ case HelpLatexIndex:
+ link = "ltx-2.html";
+ break;
+ default:
+ return;
+ }
+ }
+
+ // show help file
+ QString texversion;
+ if ( m_texVersion == TEXLIVE2005 )
+ texversion = "TexLive 2005";
+ else if ( m_texVersion == TETEX3 )
+ texversion = "teTeX v3.x";
+ else
+ texversion = "teTeX v2.x";
+ KILE_DEBUG() << "TeX Version: "<< texversion << " link=" << link << endl;
+
+ showHelpFile( m_texdocPath + m_texReference + link );
+ }
+
+ ////////////////////// Help: Keyword //////////////////////
+
+ // Context help: user either Kile LaTeX help or the help files shipped with teTeX,
+ void Help::helpKeyword(Kate::View *view) // dani 04.08.2004
+ {
+ int type = (0 == KileConfig::use()) ? HelpKileRefs : HelpTexRefs;
+ switch ( type )
+ {
+ case HelpTexRefs:
+ helpTexRefsKeyword(view);
+ break;
+ case HelpKileRefs:
+ helpKileRefsKeyword(view);
+ break;
+ }
+ }
+
+ void Help::helpTexRefsKeyword(Kate::View *view)
+ {
+ QString word = getKeyword(view);
+ KILE_DEBUG() << "keyword: " << word << endl;
+ if ( !word.isNull() && m_dictHelpTex.contains(word) )
+ {
+ KILE_DEBUG() << "about to show help for " << word << " (section " << m_dictHelpTex[word] << " )" << endl;
+ showHelpFile( m_texdocPath + m_texReference + m_dictHelpTex[word] );
+ }
+ else
+ noHelpAvailableFor(word);
+ }
+
+ void Help::helpKileRefsKeyword(Kate::View *view)
+ {
+ QString kilehelp = KGlobal::dirs()->findResource("html","en/kile/latexhelp.html");
+ KILE_DEBUG() << "kilehelp = " << kilehelp << endl;
+ if ( ! kilehelp.isEmpty() )
+ {
+ QString word = getKeyword(view);
+ KILE_DEBUG() << "word = " << word << " " << m_dictHelpKile.contains(word) << endl;
+ if ( !word.isNull() && m_dictHelpKile.contains(word) )
+ {
+ showHelpFile( kilehelp + '#' + m_dictHelpKile[word] );
+ }
+ else
+ noHelpAvailableFor(word);
+ }
+ }
+
+ void Help::noHelpAvailableFor(const QString &word)
+ {
+ m_manager->info()->logWidget()->printMsg(KileTool::Error, i18n("Sorry, no help available for %1.").arg(word), i18n("Help"));
+ }
+
+ QString Help::getKeyword(Kate::View *view)
+ {
+ if ( !view )
+ return QString::null;
+
+ // get current position
+ uint row,col,col1,col2;
+ QString word;
+ Kate::Document *doc = view->getDoc();
+ view->cursorPositionReal(&row,&col);
+
+ if ( m_edit->getCurrentWord(doc,row,col,KileDocument::EditorExtension::smTex,word,col1,col2) )
+ // There is no starred keyword in the references. So if // dani 04.08.2004
+ // we find one, we better try the unstarred keyword.
+ if ( word.right(1) == "*" )
+ return word.left( word.length()-1 );
+ else
+ return word;
+ else
+ return QString::null;
+ }
+
+//////////////////// read help lists ////////////////////
+
+ void Help::readHelpList(const QString &filename,QMap<QString,QString> &map)
+ {
+ QString file = KGlobal::dirs()->findResource("appdata","help/" + filename);
+ if ( file.isEmpty() )
+ {
+ KILE_DEBUG() << " file not found: " << filename << endl;
+ return;
+ }
+
+ KILE_DEBUG() << " read file: " << filename << endl;
+ QRegExp reg("\\s*(\\S+)\\s*=>\\s*(\\S+)");
+
+ QFile f(file);
+ if ( f.open(IO_ReadOnly) )
+ { // file opened successfully
+ QTextStream t( &f ); // use a text stream
+ while ( ! t.eof() )
+ { // until end of file...
+ QString s = t.readLine().stripWhiteSpace(); // line of text excluding '\n'
+ if ( ! (s.isEmpty() || s.at(0)=='#') )
+ {
+ int pos = reg.search(s);
+ if ( pos != -1 )
+ {
+ map[reg.cap(1)] = reg.cap(2);
+ }
+ }
+ }
+ f.close();
+ }
+ }
+
+}
+
+#include "kilehelp.moc"
diff --git a/src/kile/kilehelp.h b/src/kile/kilehelp.h
new file mode 100644
index 0000000..1518bc7
--- /dev/null
+++ b/src/kile/kilehelp.h
@@ -0,0 +1,109 @@
+/***************************************************************************
+ date : Feb 12 2007
+ version : 0.30
+ copyright : (C) 2004-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEHELP_H
+#define KILEHELP_H
+
+#include <qobject.h>
+#include <qmap.h>
+#include <qstring.h>
+
+#include <kconfig.h>
+#include <kmenubar.h>
+#include <kate/view.h>
+#include "kileedit.h"
+
+#include "userhelp.h"
+#include "texdocdialog.h"
+#include "usermenudialog.h"
+#include "kiletool.h"
+#include "kiletoolmanager.h"
+
+/**
+ *@author Holger Danielsson
+ */
+
+namespace KileDocument { class EditorExtension; }
+
+namespace KileHelp
+{
+
+ enum Type
+ {
+ HelpKileRefs,
+ HelpTexRefs,
+ HelpLatexIndex,
+ HelpLatexCommand,
+ HelpLatexSubject,
+ HelpLatexEnvironment
+ };
+
+ enum TexVersion
+ {
+ TETEX2,
+ TETEX3,
+ TEXLIVE2005
+ };
+
+ class Help : public QObject
+ {
+ Q_OBJECT
+
+ public:
+ Help(KileDocument::EditorExtension *edit);
+ ~Help();
+
+ void setUserhelp(KileTool::Manager *manager, KMenuBar *menubar);
+ void update();
+
+ // calls for help
+ void helpKeyword(Kate::View *view);
+ void noHelpAvailableFor(const QString &word);
+ void userHelpDialog() { m_userhelp->userHelpDialog(); }
+ void enableUserhelpEntries(bool state);
+ public slots:
+ void helpTexGuide();
+ void helpLatexIndex() { helpLatex(KileHelp::HelpLatexIndex); }
+ void helpLatexCommand() { helpLatex(KileHelp::HelpLatexCommand); }
+ void helpLatexSubject() { helpLatex(KileHelp::HelpLatexSubject); }
+ void helpLatexEnvironment() { helpLatex(KileHelp::HelpLatexEnvironment); }
+ void helpKeyword();
+ void helpDocBrowser();
+
+ private:
+ KileTool::Manager *m_manager;
+ KileDocument::EditorExtension *m_edit;
+ UserHelp *m_userhelp;
+
+ TexVersion m_texVersion;
+ QString m_texReference;
+ QString m_texdocPath;
+
+ QMap<QString,QString> m_dictHelpKile;
+ QMap<QString,QString> m_dictHelpTex;
+
+ void initTexDocumentation();
+ void readHelpList(const QString &filename,QMap<QString,QString> &map);
+ void showHelpFile(const QString &parameter);
+
+ void helpLatex(KileHelp::Type type);
+ void helpTexRefsKeyword(Kate::View *view);
+ void helpKileRefsKeyword(Kate::View *view);
+ QString getKeyword(Kate::View *view);
+ };
+}
+
+#endif
diff --git a/src/kile/kileinfo.cpp b/src/kile/kileinfo.cpp
new file mode 100644
index 0000000..21aaca7
--- /dev/null
+++ b/src/kile/kileinfo.cpp
@@ -0,0 +1,468 @@
+/***************************************************************************
+ begin : Thu Jul 17 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// 2007-03-12 dani
+// - use KileDocument::Extensions
+
+#include "kileinfo.h"
+
+#include <qwidget.h>
+#include <qfileinfo.h>
+#include <qobject.h>
+
+#include <kate/document.h>
+#include <kate/view.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+#include "kilestructurewidget.h"
+#include "kiledocmanager.h"
+#include "kileviewmanager.h"
+#include "kiledocumentinfo.h"
+#include "kileproject.h"
+#include "kileuntitled.h"
+#include "kilejscript.h"
+#include "editorkeysequencemanager.h"
+#include "templates.h"
+
+#include <kstandarddirs.h>
+#include <qstringlist.h>
+#include <qstring.h>
+
+KileInfo::KileInfo(QWidget *parent) :
+ m_manager(0L),
+ m_jScriptManager(0L),
+ m_toolFactory(0L),
+ m_texKonsole(0L),
+ m_edit(0L),
+ m_parentWidget(parent),
+ m_currentTarget(QString::null)
+{
+ m_docManager = new KileDocument::Manager(this, parent, "KileDocument::Manager");
+ m_viewManager= new KileView::Manager(this, parent, "KileView::Manager");
+ m_templateManager = new KileTemplate::Manager(this, parent, "KileTemplate::Manager");
+ m_editorKeySequenceManager = new KileEditorKeySequence::Manager(this, parent, "KileEditorKeySequence::Manager");
+ QObject::connect(m_docManager, SIGNAL(documentStatusChanged(Kate::Document*, bool, unsigned char)), m_viewManager, SLOT(reflectDocumentStatus(Kate::Document*, bool, unsigned char)));
+}
+
+KileInfo::~KileInfo()
+{
+}
+
+Kate::Document * KileInfo::activeTextDocument() const
+{
+ Kate::View *view = viewManager()->currentTextView();
+ if (view) return view->getDoc(); else return 0L;
+}
+
+QString KileInfo::getName(Kate::Document *doc, bool shrt)
+{
+ KILE_DEBUG() << "===KileInfo::getName(Kate::Document *doc, bool " << shrt << ")===" << endl;
+ QString title=QString::null;
+
+ if (!doc)
+ doc = activeTextDocument();
+ if (doc)
+ {
+ KILE_DEBUG() << "url " << doc->url().path() << endl;
+ title = shrt ? doc->url().fileName() : doc->url().path();
+ //work around for bug in KatePart, use docName and not url
+ //reloading the file after is it changed on disc by another application
+ //cause the URL to be empty for a short while
+ if ( title.isEmpty() )
+ title = shrt ? QFileInfo(doc->docName()).fileName() : doc->docName();
+ }
+
+ return title;
+}
+
+QString KileInfo::getCompileName(bool shrt /* = false */)
+{
+ KileProject *project = docManager()->activeProject();
+
+ if (m_singlemode)
+ {
+ if (project)
+ {
+ if (project->masterDocument().length() > 0)
+ {
+ KURL master = KURL::fromPathOrURL(project->masterDocument());
+ if (shrt) return master.fileName();
+ else return master.path();
+ }
+ else
+ {
+ KileProjectItem *item = project->rootItem(docManager()->activeProjectItem());
+ if (item)
+ {
+ KURL url = item->url();
+ if (shrt) return url.fileName();
+ else return url.path();
+ }
+ else
+ return QString::null;
+ }
+ }
+ else
+ return getName(activeTextDocument(), shrt);
+ }
+ else
+ {
+ QFileInfo fi(m_masterName);
+ if (shrt)
+ return fi.fileName();
+ else
+ return m_masterName;
+ }
+}
+
+QString KileInfo::getFullFromPrettyName(const QString & name)
+{
+ if(name.isNull())
+ return name;
+
+ QString file = name;
+
+ if (file.left(2) == "./" )
+ {
+ file = QFileInfo(outputFilter()->source()).dirPath(true) + '/' + file.mid(2);
+ }
+
+ if (file[0] != '/' )
+ {
+ file = QFileInfo(outputFilter()->source()).dirPath(true) + '/' + file;
+ }
+
+ QFileInfo fi(file);
+ if ( file.isNull() || fi.isDir() || (! fi.exists()) || (! fi.isReadable()))
+ {
+ // - call from logwidget or error handling, which
+ // tries to determine the LaTeX source file
+ bool found = false;
+ QStringList extlist = QStringList::split( " ", m_extensions->latexDocuments() );
+ for ( QStringList::Iterator it=extlist.begin(); it!=extlist.end(); ++it )
+ {
+ QString name = file + (*it);
+ if ( QFileInfo(name).exists() )
+ {
+ file = name;
+ fi.setFile(name);
+ found = true;
+ break;
+ }
+ }
+ if ( ! found )
+ file = QString::null;
+ }
+
+ if ( ! fi.isReadable() ) return QString::null;
+
+ return file;
+}
+
+KURL::List KileInfo::getParentsFor(KileDocument::Info *info)
+{
+ KileProjectItemList *items = docManager()->itemsFor(info);
+ KURL::List list;
+ for ( uint i = 0; i < items->count(); ++i)
+ if (items->at(i)->parent()) list.append(items->at(i)->parent()->url());
+
+ return list;
+}
+
+const QStringList* KileInfo::retrieveList(const QStringList* (KileDocument::Info::*getit)() const, KileDocument::Info * docinfo /* = 0L */)
+{
+ m_listTemp.clear();
+
+ if (docinfo == 0L) docinfo = docManager()->getInfo();
+ KileProjectItem *item = docManager()->itemFor(docinfo, docManager()->activeProject());
+
+ KILE_DEBUG() << "Kile::retrieveList()" << endl;
+ if (item)
+ {
+ const KileProject *project = item->project();
+ const KileProjectItem *root = project->rootItem(item);
+ if (root)
+ {
+ KILE_DEBUG() << "\tusing root item " << root->url().fileName() << endl;
+
+ QPtrList<KileProjectItem> children;
+ children.append(root);
+ root->allChildren(&children);
+
+ const QStringList *list;
+
+ for (uint i=0; i < children.count(); ++i)
+ {
+ KILE_DEBUG() << "\t" << children.at(i)->url().fileName() << endl;
+ list = (children.at(i)->getInfo()->*getit)();
+ if (list)
+ {
+ for (uint i=0; i < list->count(); ++i)
+ m_listTemp << (*list)[i];
+ }
+ }
+
+ return &m_listTemp;
+ }
+ else
+ return &m_listTemp;
+ }
+ else if (docinfo)
+ {
+ m_listTemp = *((docinfo->*getit)());
+ return &m_listTemp;
+ }
+ else
+ return &m_listTemp;
+}
+
+const QStringList* KileInfo::allLabels(KileDocument::Info * info)
+{
+ KILE_DEBUG() << "Kile::allLabels()" << endl;
+ const QStringList* (KileDocument::Info::*p)() const=&KileDocument::Info::labels;
+ const QStringList* list = retrieveList(p, info);
+ return list;
+}
+
+const QStringList* KileInfo::allBibItems(KileDocument::Info * info)
+{
+ KILE_DEBUG() << "Kile::allBibItems()" << endl;
+ const QStringList* (KileDocument::Info::*p)() const=&KileDocument::Info::bibItems;
+ const QStringList* list = retrieveList(p, info);
+ return list;
+}
+
+const QStringList* KileInfo::allBibliographies(KileDocument::Info * info)
+{
+ KILE_DEBUG() << "Kile::bibliographies()" << endl;
+ const QStringList* (KileDocument::Info::*p)() const=&KileDocument::Info::bibliographies;
+ const QStringList* list = retrieveList(p, info);
+ return list;
+}
+
+const QStringList* KileInfo::allDependencies(KileDocument::Info * info)
+{
+ KILE_DEBUG() << "Kile::dependencies()" << endl;
+ const QStringList* (KileDocument::Info::*p)() const=&KileDocument::Info::dependencies;
+ const QStringList* list = retrieveList(p, info);
+ return list;
+}
+
+const QStringList* KileInfo::allNewCommands(KileDocument::Info * info)
+{
+ KILE_DEBUG() << "Kile::newCommands()" << endl;
+ const QStringList* (KileDocument::Info::*p)() const=&KileDocument::Info::newCommands;
+ const QStringList* list = retrieveList(p, info);
+ return list;
+}
+
+const QStringList* KileInfo::allPackages(KileDocument::Info * info)
+{
+ KILE_DEBUG() << "Kile::allPackages()" << endl;
+ const QStringList* (KileDocument::Info::*p)() const=&KileDocument::Info::packages;
+ const QStringList* list = retrieveList(p, info);
+ return list;
+}
+
+QString KileInfo::lastModifiedFile(KileDocument::Info * info)
+{
+ if (info == 0) info = docManager()->getInfo();
+ const QStringList *list = allDependencies(info);
+ return info->lastModifiedFile(list);
+}
+
+QString KileInfo::documentTypeToString(KileDocument::Type type)
+{
+ switch(type) {
+ case KileDocument::Undefined:
+ return i18n("Undefined");
+ case KileDocument::Text:
+ return i18n("Text");
+ case KileDocument::LaTeX:
+ return i18n("LaTeX");
+ case KileDocument::BibTeX:
+ return i18n("BibTeX");
+ case KileDocument::Script:
+ return i18n("Script");
+ }
+ return QString();
+}
+
+bool KileInfo::similarOrEqualURL(const KURL &validurl, const KURL &testurl)
+{
+ if ( testurl.isEmpty() || testurl.path().isEmpty() ) return false;
+
+ bool absolute = testurl.path().startsWith("/");
+ return (
+ (validurl == testurl) ||
+ (!absolute && validurl.path().endsWith(testurl.path()))
+ );
+}
+
+bool KileInfo::isOpen(const KURL & url)
+{
+ KILE_DEBUG() << "==bool KileInfo::isOpen(const KURL & url)=============" << endl;
+ uint cnt = viewManager()->textViews().count();
+
+ for ( uint i = 0; i < cnt; ++i)
+ {
+ if ( viewManager()->textView(i)->getDoc() && similarOrEqualURL(viewManager()->textView(i)->getDoc()->url(), url) )
+ return true;
+ }
+
+ return false;
+}
+
+bool KileInfo::projectIsOpen(const KURL & url)
+{
+ KileProject *project = docManager()->projectFor(url);
+
+ return project != 0 ;
+}
+
+QString KileInfo::getSelection() const
+{
+ Kate::Document *doc = activeTextDocument();
+
+ if (doc && doc->hasSelection())
+ {
+ return doc->selection();
+ }
+
+ return QString::null;
+}
+
+void KileInfo::clearSelection() const
+{
+ Kate::Document *doc = activeTextDocument();
+
+ if (doc && doc->hasSelection())
+ {
+ doc->removeSelectedText();
+ }
+}
+
+QString KileInfo::expandEnvironmentVars(const QString &str)
+{
+ static QRegExp reEnvVars("\\$(\\w+)");
+ QString result = str;
+ int index = -1;
+ while ( (index = str.find(reEnvVars, index + 1)) != -1 )
+ result.replace(reEnvVars.cap(0),getenv(reEnvVars.cap(1).local8Bit()));
+
+ return result;
+}
+
+QString KileInfo::checkOtherPaths(const QString &path,const QString &file, int type)
+{
+ KILE_DEBUG() << "QString KileInfo::checkOtherPaths(const QString &path,const QString &file, int type)" << endl;
+ QStringList inputpaths;
+ QString configpaths;
+ QFileInfo info;
+
+ switch(type)
+ {
+ case bibinputs:
+ configpaths = KileConfig::bibInputPaths() + ":$BIBINPUTS";
+ break;
+ case texinputs:
+ configpaths = KileConfig::teXPaths() + ":$TEXINPUTS";
+ break;
+ case bstinputs:
+ configpaths = KileConfig::bstInputPaths() + ":$BSTINPUTS";
+ break;
+ default:
+ KILE_DEBUG() << "Unknown type in checkOtherPaths" << endl;
+ return QString::null;
+ break;
+ }
+
+ inputpaths = QStringList::split( ":", expandEnvironmentVars(configpaths));
+ inputpaths.prepend(path);
+
+ // the first match is supposed to be the correct one
+ for ( QStringList::Iterator it = inputpaths.begin(); it != inputpaths.end(); ++it )
+ {
+ KILE_DEBUG() << "path is " << *it << "and file is " << file << endl;
+ info.setFile((*it) + '/' + file);
+ if(info.exists())
+ {
+ KILE_DEBUG() << "filepath after correction is: " << info.dirPath() << endl;
+ return info.absFilePath();
+ }
+ }
+ return QString::null;
+}
+
+QString KileInfo::relativePath(const QString basepath, const QString & file)
+{
+ KURL url = KURL::fromPathOrURL(file);
+ QString path = url.directory();
+ QString filename = url.fileName();
+
+ KILE_DEBUG() <<"===findRelativeURL==================" << endl;
+ KILE_DEBUG() << "\tbasepath : " << basepath << " path: " << path << endl;
+
+ QStringList basedirs = QStringList::split("/", basepath, false);
+ QStringList dirs = QStringList::split("/", path, false);
+
+ uint nDirs = dirs.count();
+ //uint nBaseDirs = basedirs.count();
+
+ while ( dirs.count() > 0 && basedirs.count() > 0 && dirs[0] == basedirs[0] )
+ {
+ dirs.pop_front();
+ basedirs.pop_front();
+ }
+
+ /*KILE_DEBUG() << "\tafter" << endl;
+ for (uint i=0; i < basedirs.count(); ++i)
+ {
+ KILE_DEBUG() << "\t\tbasedirs " << i << ": " << basedirs[i] << endl;
+ }
+
+ for (uint i=0; i < dirs.count(); ++i)
+ {
+ KILE_DEBUG() << "\t\tdirs " << i << ": " << dirs[i] << endl;
+ }*/
+
+ if (nDirs != dirs.count() )
+ {
+ path = dirs.join("/");
+
+ //KILE_DEBUG() << "\tpath : " << path << endl;
+
+ if (basedirs.count() > 0)
+ {
+ for (uint j=0; j < basedirs.count(); ++j)
+ {
+ path = "../" + path;
+ }
+ }
+
+ if ( path.length()>0 && path.right(1) != "/" ) path = path + '/';
+
+ path = path+filename;
+ }
+ else //assume an absolute path was requested
+ {
+ path = url.path();
+ }
+
+ KILE_DEBUG() << "\trelative path : " << path << endl;
+
+ return path;
+}
diff --git a/src/kile/kileinfo.h b/src/kile/kileinfo.h
new file mode 100644
index 0000000..7bc4dea
--- /dev/null
+++ b/src/kile/kileinfo.h
@@ -0,0 +1,180 @@
+/***************************************************************************
+ begin : Thu Jul 17 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEINFO_H
+#define KILEINFO_H
+
+#include <qstring.h>
+#include <qptrlist.h>
+#include <qmap.h>
+#include <qscrollview.h>
+
+#include "kiledebug.h"
+#include <kurl.h>
+
+#include "kileconstants.h"
+#include "kileextensions.h"
+#include "kiletoolmanager.h"
+#include "kilestdtools.h"
+#include "latexoutputfilter.h"
+#include "latexoutputinfo.h"
+#include "latexcmd.h"
+#include "kileconfig.h"
+
+class QWidget;
+
+namespace KileDocument { class Info; }
+class KileProject;
+class KileProjectItem;
+class KileProjectItemList;
+class KileFileSelect;
+class KileEventFilter;
+
+namespace Kate { class Document;}
+
+class KileBottomBar;
+namespace KileDocument { class Extensions; class Manager; class EditorExtension; }
+namespace KileView { class Manager; }
+namespace KileWidget { class Structure; class Konsole; class ScriptsManagement; class PreviewWidget; }
+namespace KileTool { class QuickPreview; }
+namespace KileHelp { class Help; }
+namespace KileJScript { class Manager; }
+namespace KileEditorKeySequence { class Manager; }
+namespace KileTemplate { class Manager; }
+
+class KileInfo
+{
+
+public:
+ KileInfo(QWidget *parent);
+ virtual ~KileInfo();
+
+public:
+ enum {bibinputs = 0,bstinputs, texinputs};
+ QString getName(Kate::Document *doc = 0, bool shrt = false);
+ QString getShortName(Kate::Document *doc = 0) { return getName(doc, true); }
+ QString getCompileName(bool shrt = false);
+ QString getFullFromPrettyName(const QString & name);
+ KURL::List getParentsFor(KileDocument::Info *);
+ bool getSinglemode() { return m_singlemode; }
+
+ QString getCurrentTarget() const { return m_currentTarget; }
+ void setTarget(const QString &target) { m_currentTarget=target; }
+
+ virtual Kate::Document* activeTextDocument() const;
+
+ QString getSelection() const;
+ void clearSelection() const;
+
+ virtual const QStringList* allLabels(KileDocument::Info * info = 0L);
+ virtual const QStringList* allBibItems(KileDocument::Info * info = 0L);
+ virtual const QStringList* allBibliographies(KileDocument::Info * info = 0L);
+ virtual const QStringList* allDependencies(KileDocument::Info * info = 0L);
+ virtual const QStringList* allNewCommands(KileDocument::Info * info = 0L);
+ virtual const QStringList* allPackages(KileDocument::Info * info = 0L);
+
+ QString lastModifiedFile(KileDocument::Info * info = 0L);
+
+ static QString documentTypeToString(KileDocument::Type type);
+
+private:
+ const QStringList* retrieveList(const QStringList* (KileDocument::Info::*getit)() const, KileDocument::Info * docinfo = 0L);
+ QStringList m_listTemp;
+
+public:
+ bool similarOrEqualURL(const KURL &validurl, const KURL &testurl);
+ bool isOpen(const KURL & url);
+ bool projectIsOpen(const KURL & );
+
+ bool watchFile() { return m_bWatchFile; }
+ bool logPresent() { return m_logPresent; }
+ void setLogPresent(bool pr) { m_logPresent = pr; }
+
+ LatexOutputFilter * outputFilter() { return m_outputFilter; }
+ LatexOutputInfoArray * outputInfo() { return m_outputInfo; }
+
+ virtual int lineNumber() = 0;
+
+ QString relativePath(const QString basepath, const QString & file);
+
+ KileWidget::Structure *structureWidget() { return m_kwStructure; }
+ KileWidget::Konsole *texKonsole() { return m_texKonsole; }
+ KileWidget::Output *outputWidget() { return m_outputWidget; }
+ KileBottomBar *outputView() { return m_bottomBar; }
+ KileWidget::LogMsg *logWidget() { return m_logWidget; }
+ KileWidget::PreviewWidget *previewWidget () { return m_previewWidget; }
+
+ KileDocument::Manager* docManager() const { return m_docManager; }
+ KileView::Manager* viewManager() const { return m_viewManager; }
+ KileTool::Manager* toolManager() const { return m_manager; }
+ KileJScript::Manager* scriptManager() const { return m_jScriptManager; }
+ KileEditorKeySequence::Manager* editorKeySequenceManager() const { return m_editorKeySequenceManager; }
+ KileTool::Factory* toolFactory() const { return m_toolFactory; }
+ KileDocument::EditorExtension *editorExtension() const { return m_edit; }
+ KileDocument::LatexCommands *latexCommands() const { return m_latexCommands; }
+ KileHelp::Help *help() const { return m_help; }
+ KileTool::QuickPreview *quickPreview() const { return m_quickPreview; }
+ KileDocument::Extensions *extensions() const { return m_extensions; }
+ KileTemplate::Manager *templateManager() const { return m_templateManager; }
+
+ //FIXME:refactor
+ KileFileSelect* fileSelector() const { return m_fileSelector; }
+ KileEventFilter* eventFilter() const { return m_eventFilter; }
+
+ QWidget *parentWidget() const { return m_parentWidget; }
+
+ static QString expandEnvironmentVars(const QString &variable);
+ static QString checkOtherPaths(const QString &path,const QString &file, int type);
+ static QString checkOtherPaths(const KURL &url,const QString &file, int type){ return checkOtherPaths(url.path(),file, type); }
+protected:
+ KileDocument::Manager *m_docManager;
+ KileView::Manager *m_viewManager;
+ KileTool::Manager *m_manager;
+ KileTemplate::Manager *m_templateManager;
+ KileJScript::Manager *m_jScriptManager;
+ KileEditorKeySequence::Manager *m_editorKeySequenceManager;
+ KileTool::Factory *m_toolFactory;
+ KileWidget::Konsole *m_texKonsole;
+ KileWidget::Output *m_outputWidget;
+ KileWidget::LogMsg *m_logWidget;
+ KileWidget::ScriptsManagement *m_scriptsManagementWidget;
+ KileBottomBar *m_bottomBar;
+ KileWidget::PreviewWidget *m_previewWidget;
+ QScrollView *m_previewView;
+
+ KileHelp::Help *m_help;
+ KileDocument::EditorExtension *m_edit;
+ KileDocument::LatexCommands *m_latexCommands;
+ KileDocument::Extensions *m_extensions;
+ KileTool::QuickPreview *m_quickPreview;
+
+ QWidget *m_parentWidget;
+
+ bool m_singlemode;
+ QString m_masterName;
+
+ QString m_currentTarget;
+
+ bool m_bWatchFile, m_logPresent;
+
+ LatexOutputFilter *m_outputFilter;
+ LatexOutputInfoArray *m_outputInfo;
+
+ KileWidget::Structure *m_kwStructure;
+ KileFileSelect *m_fileSelector;
+ KileEventFilter* m_eventFilter;
+};
+
+#endif
diff --git a/src/kile/kilejscript.cpp b/src/kile/kilejscript.cpp
new file mode 100644
index 0000000..7d18bf4
--- /dev/null
+++ b/src/kile/kilejscript.cpp
@@ -0,0 +1,795 @@
+/**************************************************************************
+* Copyright (C) 2006, 2007 by Michel Ludwig (michel.ludwig@kdemail.net) *
+***************************************************************************/
+
+/**************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "kilejscript.h"
+
+/*
+ * KJS uses a garbage collection mechanism.
+ */
+#include <kjs/lookup.h>
+
+#include <kconfig.h>
+#include "kiledebug.h"
+#include <kinputdialog.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kstandarddirs.h>
+
+#include <signal.h>
+#include <sys/time.h>
+
+#include <qevent.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+#include <qvaluelist.h>
+
+#include "kileconfig.h"
+#include "kileedit.h"
+#include "kileinfo.h"
+#include "kileversion.h"
+#include "kileviewmanager.h"
+#include "editorkeysequencemanager.h"
+
+// Modified declaration from <khtml/ecma/kjs_proxy.h>
+// Acknowledgements go to:
+// Copyright (C) 1999 Harri Porten (porten@kde.org)
+// Copyright (C) 2001 Peter Kelly (pmk@post.com)
+
+class KJSCPUGuard {
+public:
+ KJSCPUGuard() {}
+ void start(unsigned int msec=5000, unsigned int i_msec=0);
+ void stop();
+private:
+ void (*oldAlarmHandler)(int);
+ static void alarmHandler(int);
+ itimerval oldtv;
+};
+
+// Modified implementation originating from <khtml/ecma/kjs_proxy.cpp>
+// Acknowledgements go to:
+// Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+// Copyright (C) 2001,2003 Peter Kelly (pmk@post.com)
+// Copyright (C) 2001-2003 David Faure (faure@kde.org)
+void KJSCPUGuard::start(unsigned int ms, unsigned int i_ms)
+{
+ oldAlarmHandler = signal(SIGVTALRM, alarmHandler);
+ itimerval tv = {
+ { i_ms / 1000, (i_ms % 1000) * 1000 },
+ { ms / 1000, (ms % 1000) * 1000 }
+ };
+ setitimer(ITIMER_VIRTUAL, &tv, &oldtv);
+}
+
+void KJSCPUGuard::stop()
+{
+ setitimer(ITIMER_VIRTUAL, &oldtv, 0L);
+ signal(SIGVTALRM, oldAlarmHandler);
+}
+
+void KJSCPUGuard::alarmHandler(int) {
+ KJS::ExecState::requestTerminate();
+}
+
+
+namespace KJS {
+// Taken from <khtml/ecma/kjs_binding.cpp>
+// Acknowledgements go to:
+// Copyright (C) 1999-2003 Harri Porten (porten@kde.org)
+// Copyright (C) 2001-2003 David Faure (faure@kde.org)
+// Copyright (C) 2003 Apple Computer, Inc.
+ UString::UString(const QString &d) {
+ unsigned int len = d.length();
+ UChar *dat = new UChar[len];
+ memcpy(dat, d.unicode(), len * sizeof(UChar));
+ rep = UString::Rep::create(dat, len);
+ }
+
+ QString UString::qstring() const {
+ return QString((QChar*) data(), size());
+ }
+
+ QConstString UString::qconststring() const {
+ return QConstString((QChar*) data(), size());
+ }
+}
+
+namespace KJS {
+ class KileJSObjectFunc; // forward declaration
+}
+
+class KileJSObject : public KJS::ObjectImp {
+ friend class KJS::KileJSObjectFunc;
+ public:
+ KileJSObject(KJS::ExecState *exec, KileInfo *kileInfo);
+ virtual ~KileJSObject();
+
+// there are no non-functional properties
+// KJS::Value get(KJS::ExecState *exec, const KJS::Identifier &propertyName) const;
+
+// KJS::Value getValueProperty(KJS::ExecState *exec, int token) const;
+
+// void put(KJS::ExecState *exec, const KJS::Identifier &propertyName, const KJS::Value& value, int attr = KJS::None);
+
+// void putValueProperty(KJS::ExecState *exec, int token, const KJS::Value& value, int attr);
+
+ virtual const KJS::ClassInfo *classInfo() const;
+
+ enum {
+ CurrentTextDocument,
+ GetInputValue
+ };
+
+ static const KJS::ClassInfo info;
+
+ protected:
+ KileInfo *m_kileInfo;
+};
+
+
+
+
+namespace KJS {
+ class KileTextDocumentJSObjectFunc; // forward declaration
+}
+
+class KileTextDocumentJSObject : public KJS::ObjectImp {
+ friend class KJS::KileTextDocumentJSObjectFunc;
+ public:
+ KileTextDocumentJSObject(KJS::ExecState *exec, Kate::View* view, KileInfo *kileInfo);
+
+ virtual ~KileTextDocumentJSObject();
+
+// there are no non-functional properties
+// KJS::Value get(KJS::ExecState *exec, const KJS::Identifier &propertyName) const;
+
+// KJS::Value getValueProperty(KJS::ExecState *exec, int token) const;
+
+// void put(KJS::ExecState *exec, const KJS::Identifier &propertyName, const KJS::Value& value, int attr = KJS::None);
+
+// void putValueProperty(KJS::ExecState *exec, int token, const KJS::Value& value, int attr);
+
+ virtual const KJS::ClassInfo *classInfo() const;
+
+ enum {
+ InsertBullet,
+ InsertText,
+ NextBullet,
+ PreviousBullet,
+ CursorLeft,
+ CursorRight,
+ Up,
+ Down,
+ CursorLine,
+ CursorColumn,
+ SetCursorLine,
+ SetCursorColumn,
+ Backspace
+ };
+
+
+ static const KJS::ClassInfo info;
+
+ protected:
+ Kate::View* view;
+ KileInfo *m_kileInfo;
+};
+
+
+#include "kilejscript.lut.h"
+
+
+/*
+ * The number of supplied arguments is checked automatically.
+ */
+
+
+// Only functional properties:
+/*
+@begin KileJSObjectProtoTable 2
+ currentTextDocument KileJSObject::CurrentTextDocument DontDelete|Function 0
+ getInputValue KileJSObject::GetInputValue DontDelete|Function 2
+@end
+*/
+
+// Non-functional properties go here:
+/*
+@begin KileJSObjectTable 0
+@end
+*/
+
+DEFINE_PROTOTYPE("KileJSObject", KileJSObjectProto)
+IMPLEMENT_PROTOFUNC(KileJSObjectFunc)
+IMPLEMENT_PROTOTYPE(KileJSObjectProto, KileJSObjectFunc)
+
+const KJS::ClassInfo KileJSObject::info = {"KileJSObject", 0, &KileJSObjectTable, 0};
+
+KileJSObject::KileJSObject(KJS::ExecState *exec, KileInfo *kileInfo) : ObjectImp(KileJSObjectProto::self(exec)), m_kileInfo(kileInfo) {
+}
+
+KileJSObject::~KileJSObject() {
+}
+
+const KJS::ClassInfo* KileJSObject::classInfo() const {
+ return &info;
+}
+
+/*
+KJS::Value KileJSObject::get(KJS::ExecState *exec, const KJS::Identifier &propertyName) const {
+ return KJS::lookupGetValue<KileJSObject, KJS::ObjectImp>(exec, propertyName, &KileJSObjectTable, this);
+}
+*/
+
+/*
+KJS::Value KileJSObject::getValueProperty(KJS::ExecState *exec, int token) const
+{
+ if (!m_kileInfo) {
+ return KJS::Undefined();
+ }
+ switch (token) {
+
+ }
+ return KJS::Undefined();
+}
+*/
+
+KJS::Value KJS::KileJSObjectFunc::call(KJS::ExecState *exec, KJS::Object &thisObj, const KJS::List &args) {
+ KJS_CHECK_THIS(KileJSObject, thisObj);
+// KileJSObject *obj = static_cast<KileJSObject *>(thisObj.imp())->doc;
+ KileInfo* kileInfo = static_cast<KileJSObject*>(thisObj.imp())->m_kileInfo;
+ if(!kileInfo) {
+ return KJS::Undefined();
+ }
+ QString caption, label, value;
+ KileTextDocumentJSObject *kileViewJSObject;
+ Kate::View *kateView;
+ switch (id) {
+ case KileJSObject::CurrentTextDocument:
+ kateView = kileInfo->viewManager()->currentTextView();
+ if(kateView == 0L) {
+ return KJS::Null();
+ }
+ else {
+ kileViewJSObject = new KileTextDocumentJSObject(exec, kateView, kileInfo);
+ return KJS::Object(kileViewJSObject);
+ }
+ break;
+ case KileJSObject::GetInputValue:
+ caption = args[0].toString(exec).qstring();
+ label = args[1].toString(exec).qstring();
+ if(caption.isEmpty()) {
+ caption = i18n("Enter Value");
+ }
+ if(label.isEmpty()) {
+ label = i18n("Please enter a value");
+ }
+ value = KInputDialog::getText(caption, label, QString(), 0, 0L);
+ return KJS::String(value);
+ break;
+ }
+ return KJS::Undefined();
+}
+
+
+// Only functional properties:
+/*
+@begin KileTextDocumentJSObjectProtoTable 13
+#
+ insertText KileTextDocumentJSObject::InsertText DontDelete|Function 1
+ insertBullet KileTextDocumentJSObject::InsertBullet DontDelete|Function 0
+ nextBullet KileTextDocumentJSObject::NextBullet DontDelete|Function 0
+ previousBullet KileTextDocumentJSObject::PreviousBullet DontDelete|Function 0
+ cursorLeft KileTextDocumentJSObject::CursorLeft DontDelete|Function 0
+ cursorRight KileTextDocumentJSObject::CursorRight DontDelete|Function 0
+ up KileTextDocumentJSObject::Up DontDelete|Function 0
+ down KileTextDocumentJSObject::Down DontDelete|Function 0
+ cursorLine KileTextDocumentJSObject::CursorLine DontDelete|Function 0
+ cursorColumn KileTextDocumentJSObject::CursorColumn DontDelete|Function 0
+ setCursorLine KileTextDocumentJSObject::SetCursorLine DontDelete|Function 1
+ setCursorColumn KileTextDocumentJSObject::SetCursorColumn DontDelete|Function 1
+ backspace KileTextDocumentJSObject::Backspace DontDelete|Function 0
+#
+@end
+*/
+
+// Non-functional properties go here:
+/*
+@begin KileTextDocumentJSObjectTable 0
+@end
+*/
+
+
+DEFINE_PROTOTYPE("KileTextDocumentJSObject", KileTextDocumentJSObjectProto)
+IMPLEMENT_PROTOFUNC(KileTextDocumentJSObjectFunc)
+IMPLEMENT_PROTOTYPE(KileTextDocumentJSObjectProto, KileTextDocumentJSObjectFunc)
+
+KileTextDocumentJSObject::KileTextDocumentJSObject(KJS::ExecState *exec, Kate::View* view, KileInfo *kileInfo) : ObjectImp(KileTextDocumentJSObjectProto::self(exec)), view(view), m_kileInfo(kileInfo) {
+}
+
+KileTextDocumentJSObject::~KileTextDocumentJSObject() {
+}
+
+/*
+KJS::Value KileTextDocumentJSObject::get(KJS::ExecState *exec, const KJS::Identifier &propertyName) const {
+ return KJS::lookupGetValue<KileTextDocumentJSObject, KJS::ObjectImp>(exec, propertyName, &KileTextDocumentJSObjectTable, this);
+}
+*/
+
+/*
+KJS::Value KileTextDocumentJSObject::getValueProperty(KJS::ExecState *exec, int token) const {
+ return KJS::Undefined ();
+}
+*/
+
+KJS::Value KJS::KileTextDocumentJSObjectFunc::call(KJS::ExecState *exec, KJS::Object &thisObj, const KJS::List &args) {
+ KJS_CHECK_THIS(KileTextDocumentJSObject, thisObj);
+
+// KileJSObject *obj = static_cast<KileJSObject *>(thisObj.imp())->doc;
+ KileInfo* kileInfo = static_cast<KileTextDocumentJSObject *>(thisObj.imp())->m_kileInfo;
+ Kate::View* view = ((KileTextDocumentJSObject*)(thisObj.imp()))->view;
+ uint col, line;
+ switch (id) {
+ case KileTextDocumentJSObject::InsertText:
+ view->insertText(args[0].toString(exec).qstring());
+ break;
+ case KileTextDocumentJSObject::InsertBullet:
+ kileInfo->editorExtension()->insertBullet(view);
+ break;
+ case KileTextDocumentJSObject::NextBullet:
+ kileInfo->editorExtension()->nextBullet(view);
+ break;
+ case KileTextDocumentJSObject::PreviousBullet:
+ kileInfo->editorExtension()->prevBullet(view);
+ break;
+ case KileTextDocumentJSObject::CursorRight:
+ view->cursorRight();
+ break;
+ case KileTextDocumentJSObject::CursorLeft:
+ view->cursorLeft();
+ break;
+ case KileTextDocumentJSObject::Up:
+ view->up();
+ break;
+ case KileTextDocumentJSObject::Down:
+ view->down();
+ break;
+ case KileTextDocumentJSObject::CursorLine:
+ view->cursorPositionReal(&line, &col);
+ return KJS::Number(line);
+ break;
+ case KileTextDocumentJSObject::CursorColumn:
+ view->cursorPositionReal(&line, &col);
+ return KJS::Number(col);
+ break;
+ case KileTextDocumentJSObject::SetCursorLine:
+ view->cursorPositionReal(&line, &col);
+ view->setCursorPositionReal(args[0].toUInt32(exec), col);
+ break;
+ case KileTextDocumentJSObject::SetCursorColumn:
+ view->cursorPositionReal(&line, &col);
+ view->setCursorPositionReal(line, args[0].toUInt32(exec));
+ break;
+ case KileTextDocumentJSObject::Backspace:
+ view->backspace();
+ break;
+ }
+
+ return KJS::Undefined();
+}
+
+
+const KJS::ClassInfo* KileTextDocumentJSObject::classInfo() const {
+ return &info;
+}
+
+const KJS::ClassInfo KileTextDocumentJSObject::info = {"KileTextDocumentJSObject", 0, &KileTextDocumentJSObjectTable, 0};
+
+namespace KileJScript {
+
+////////////////////////////// JScript //////////////////////////////
+
+/* The IDs of the scripts are used to maintain correct bindings with KAction objects, i.e. for example, we
+ * want to make sure the action script_execution_0 always refers to same script (the script with id 0 !), even
+ * after reloading all the scripts.
+ */
+
+ JScript::JScript(unsigned int id, const QString& file) : m_id(id), m_file(file), m_action(NULL) {
+ m_name = KGlobal::dirs()->relativeLocation("appdata", file);
+ if(m_name.startsWith("scripts")) {
+ m_name = m_name.mid(8); // remove "scripts" + path separator
+ }
+ if(m_name.endsWith(".js")) { // remove the extension
+ m_name = m_name.left(m_name.length() - 3);
+ }
+ }
+
+ QString JScript::getName() const {
+ return m_name;
+ }
+
+ QString JScript::getCode() const {
+ QFile qFile(m_file);
+ if(qFile.open(IO_ReadOnly)) {
+ QTextStream inputStream(&qFile);
+// inputStream.setEncoding(QTextStream::UnicodeUTF8);
+ QString code = inputStream.read();
+ qFile.close();
+ return code;
+ }
+ else {
+ return QString();
+ }
+ }
+
+ QString JScript::getFileName() const {
+ return m_file;
+ }
+
+ unsigned int JScript::getID() const {
+ return m_id;
+ }
+
+ void JScript::setID(unsigned int id) {
+ m_id = id;
+ }
+
+ void JScript::setActionObject(KAction* action) {
+ m_action = action;
+ }
+
+ const KAction* JScript::getActionObject() const {
+ return m_action;
+ }
+
+ KAction* JScript::getActionObject() {
+ return m_action;
+ }
+
+ void JScript::setKeySequence(const QString& str) {
+ m_keySequence = str;
+ }
+
+ QString JScript::getKeySequence() const {
+ return m_keySequence;
+ }
+
+////////////////////////////// JScriptEnvironment //////////////////////////////
+
+ JScriptEnvironment::JScriptEnvironment(KileInfo *kileInfo) : m_interpreter(new KJS::Interpreter()), m_kileJSObject(new KJS::Object(new KileJSObject(m_interpreter->globalExec(), kileInfo))), m_kileInfo(kileInfo) {
+ // no garbage collection because of an external reference
+ m_interpreter->globalObject().put(m_interpreter->globalExec(), "kile", *m_kileJSObject, KJS::DontDelete|KJS::Internal);
+ }
+
+
+ JScriptEnvironment::~JScriptEnvironment() {
+ //kileJSObject->imp() will be deleted during the next garbage cleanup
+ delete m_kileJSObject;
+ delete m_interpreter;
+ }
+
+ void JScriptEnvironment::execute(const QString& s) {
+ bool useGuard = KileConfig::timeLimitEnabled();
+ uint timeLimit = (uint)KileConfig::timeLimit();
+ KJSCPUGuard guard;
+ if(useGuard) {
+ guard.start(timeLimit*1000);
+ }
+ Completion completion = m_interpreter->evaluate(s);
+ if(useGuard) {
+ guard.stop();
+ }
+ if(completion.complType() == Throw) {
+ Value value = completion.value();
+ if(value.type() == ObjectType) {
+ Object o = Object::dynamicCast(value);
+ if(o.isValid()) {
+ Value lineValue = o.get(m_interpreter->globalExec(), "line");
+ if(lineValue.type() == NumberType) {
+ KMessageBox::sorry(0L, i18n("The following exception has occurred at line %1 during execution of the script:\n%2").arg(lineValue.toInt32(m_interpreter->globalExec())).arg(value.toString(m_interpreter->globalExec()).qstring()), i18n("Exception"));
+ return;
+ }
+ }
+ }
+ KMessageBox::sorry(0L, i18n("The following exception has occurred during execution of the script:\n%1").arg(value.toString(m_interpreter->globalExec()).qstring()), i18n("Exception"));
+ }
+ }
+
+////////////////////////////// Manager //////////////////////////////
+
+ Manager::Manager(KileInfo *kileInfo, KConfig *config, KActionCollection *actionCollection, QObject *parent, const char *name) : QObject(parent, name), m_jScriptDirWatch(NULL), m_kileInfo(kileInfo), m_config(config), m_actionCollection(actionCollection) {
+ // create a local scripts directory if it doesn't exist yet
+ m_localJScriptDir = locateLocal("appdata", "scripts/", true);
+ m_jScriptDirWatch = new KDirWatch(this, "KileJScript::Manager::JScriptDirWatch");
+ connect(m_jScriptDirWatch, SIGNAL(dirty(const QString&)), this, SLOT(scanJScriptDirectories()));
+ connect(m_jScriptDirWatch, SIGNAL(created(const QString&)), this, SLOT(scanJScriptDirectories()));
+ connect(m_jScriptDirWatch, SIGNAL(deleted(const QString&)), this, SLOT(scanJScriptDirectories()));
+ m_jScriptDirWatch->startScan();
+ }
+
+ Manager::~Manager() {
+ delete m_jScriptDirWatch;
+
+ //still need to delete the scripts
+ for(QValueList<JScript*>::iterator it = m_jScriptList.begin(); it != m_jScriptList.end(); ++it) {
+ delete *it;
+ }
+ }
+
+ void Manager::executeJScript(const JScript *script) {
+ JScriptEnvironment env(m_kileInfo);
+// demonstrate repainting bug:
+/*KMessageBox::information(0L, "works!!!");
+m_kileInfo->viewManager()->currentView()->down();
+m_kileInfo->viewManager()->currentView()->down();
+m_kileInfo->viewManager()->currentView()->down();
+m_kileInfo->viewManager()->currentView()->down();
+m_kileInfo->viewManager()->currentView()->down();*/
+ QString code = script->getCode();
+ QRegExp endOfLineExp("(\r\n)|\n|\r");
+ int i = code.find(endOfLineExp);
+ QString firstLine = (i >= 0 ? code.left(i) : code);
+ QRegExp requiredVersionTagExp("(kile-version:\\s*)(\\d+\\.\\d+(.\\d+)?)");
+ if(requiredVersionTagExp.search(firstLine) != -1) {
+ QString requiredKileVersion = requiredVersionTagExp.cap(2);
+ if(compareVersionStrings(requiredKileVersion, kileFullVersion) > 0) {
+ KMessageBox::sorry(0L, i18n("Version %1 of Kile is at least required to execute the script \"%2\". The execution has been aborted.").arg(requiredKileVersion).arg(script->getName()), i18n("Version Error"));
+ return;
+ }
+ }
+ env.execute(code);
+ }
+
+ void Manager::executeJScript(unsigned int id) {
+ QMap<unsigned int, JScript*>::iterator i = m_idScriptMap.find(id);
+ if(i != m_idScriptMap.end()) {
+ executeJScript(*i);
+ }
+ }
+
+ const JScript* Manager::getScript(unsigned int id) {
+ QMap<unsigned int, JScript*>::iterator i = m_idScriptMap.find(id);
+ return ((i != m_idScriptMap.end()) ? (*i) : NULL);
+ }
+
+ void Manager::scanJScriptDirectories() {
+ if(!KileConfig::scriptingEnabled()) {
+ return;
+ }
+ deleteJScripts();
+ populateDirWatch();
+
+ m_config->setGroup("Scripts");
+ QValueList<unsigned int> idList = readUnsignedIntListEntry("IDs");
+ unsigned int maxID = 0;
+ QMap<QString, unsigned int> pathIDMap;
+ QMap<unsigned int, bool> takenIDMap;
+ for(QValueList<unsigned int>::iterator i = idList.begin(); i != idList.end(); ++i) {
+ QString fileName = m_config->readPathEntry("Script" + QString::number(*i));
+ if(!fileName.isEmpty()) {
+ unsigned int id = *i;
+ pathIDMap[fileName] = id;
+ takenIDMap[id] = true;
+ maxID = QMAX(maxID, id);
+ }
+ }
+ m_config->setGroup(QString());
+
+ QStringList scriptFileNamesList = KGlobal::dirs()->findAllResources("appdata", "scripts/*.js", true, true);
+ for(QStringList::iterator i = scriptFileNamesList.begin(); i != scriptFileNamesList.end(); ++i) {
+ registerScript(*i, pathIDMap, takenIDMap, maxID);
+ }
+ //rewrite the IDs that are currently in use
+ writeIDs();
+ m_actionCollection->readShortcutSettings("Shortcuts");
+ emit jScriptsChanged();
+ }
+
+ void Manager::deleteJScripts() {
+ QValueList<JScript*> scriptList = m_jScriptList;
+ m_jScriptList.clear(); // pretend that there are no scripts left
+ QStringList keySequenceList;
+ for(QValueList<JScript*>::iterator it = scriptList.begin(); it != scriptList.end(); ++it) {
+ keySequenceList.push_back((*it)->getKeySequence());
+ }
+ m_idScriptMap.clear();
+ m_kileInfo->editorKeySequenceManager()->removeKeySequence(keySequenceList);
+ for(QValueList<JScript*>::iterator it = scriptList.begin(); it != scriptList.end(); ++it) {
+ KAction *action = (*it)->getActionObject();
+ if(action) {
+ action->unplugAll();
+ delete action;
+ }
+ delete *it;
+ }
+ emit jScriptsChanged();
+ }
+
+ QValueList<JScript*> Manager::getJScripts() {
+ return m_jScriptList;
+ }
+
+ void Manager::registerScript(const QString& fileName, QMap<QString, unsigned int>& pathIDMap, QMap<unsigned int, bool>& takenIDMap, unsigned int &maxID) {
+ unsigned int id;
+ QMap<QString, unsigned int>::iterator it = pathIDMap.find(fileName);
+ if(it != pathIDMap.end()) {
+ id = *it;
+ }
+ else {
+ id = findFreeID(takenIDMap, maxID);
+ pathIDMap[fileName] = id;
+ takenIDMap[id] = true;
+ maxID = QMAX(maxID, id);
+ }
+ JScript* script = new JScript(id, fileName);
+ m_jScriptList.push_back(script);
+ m_idScriptMap[id] = script;
+ // start with setting up the key sequence
+ m_config->setGroup("Scripts");
+ QString editorKeySequence = m_config->readEntry("Script" + QString::number(id) + "KeySequence");
+ m_config->setGroup(QString());
+ if(!editorKeySequence.isEmpty()) {
+ script->setKeySequence(editorKeySequence);
+ m_kileInfo->editorKeySequenceManager()->addAction(editorKeySequence, new KileEditorKeySequence::ExecuteJScriptAction(script, this));
+ }
+ // now set up a regular action object
+ ScriptExecutionAction *action = new ScriptExecutionAction(id, this, m_actionCollection);
+ script->setActionObject(action);
+ }
+
+ void Manager::writeConfig() {
+ // don't delete the key sequence settings if scripting has been disabled
+ if(!KileConfig::scriptingEnabled()) {
+ return;
+ }
+ m_config->deleteGroup("Scripts");
+ writeIDs();
+ // write the key sequences
+ m_config->setGroup("Scripts");
+ for(QValueList<JScript*>::iterator i = m_jScriptList.begin(); i != m_jScriptList.end(); ++i) {
+ m_config->writeEntry("Script" + QString::number((*i)->getID()) + "KeySequence", (*i)->getKeySequence());
+ }
+ m_config->setGroup(QString());
+ }
+
+ void Manager::setEditorKeySequence(JScript* script, const QString& keySequence) {
+ if(keySequence.isEmpty()) {
+ return;
+ }
+ if(script) {
+ QString oldSequence = script->getKeySequence();
+ if(oldSequence == keySequence) {
+ return;
+ }
+ m_kileInfo->editorKeySequenceManager()->removeKeySequence(oldSequence);
+ script->setKeySequence(keySequence);
+ m_kileInfo->editorKeySequenceManager()->addAction(keySequence, new KileEditorKeySequence::ExecuteJScriptAction(script, this));
+ writeConfig();
+ }
+ }
+
+ void Manager::removeEditorKeySequence(JScript* script) {
+ if(script) {
+ QString keySequence = script->getKeySequence();
+ if(keySequence.isEmpty()) {
+ return;
+ }
+ script->setKeySequence(QString());
+ m_kileInfo->editorKeySequenceManager()->removeKeySequence(keySequence);
+ writeConfig();
+ }
+ }
+
+ void Manager::populateDirWatch() {
+ QStringList jScriptDirectories = KGlobal::dirs()->findDirs("appdata", "scripts");
+ for(QStringList::iterator i = jScriptDirectories.begin(); i != jScriptDirectories.end(); ++i) {
+ // FIXME: future KDE versions could support the recursive
+ // watching of directories out of the box.
+ addDirectoryToDirWatch(*i);
+ }
+ //we do not remove the directories that were once added as this apparently causes some strange
+ //bugs (on KDE 3.5.x)
+ }
+
+ QString Manager::getLocalJScriptDirectory() const {
+ return m_localJScriptDir;
+ }
+
+ void Manager::readConfig() {
+ deleteJScripts();
+ scanJScriptDirectories();
+ }
+
+ QValueList<unsigned int> Manager::readUnsignedIntListEntry(const QString& key) {
+ QValueList<unsigned int> toReturn;
+ QStringList stringList = m_config->readListEntry(key);
+ for(QStringList::iterator i = stringList.begin(); i != stringList.end(); ++i) {
+ toReturn.push_back((*i).toUInt());
+ }
+ return toReturn;
+ }
+
+ void Manager::writeEntry(const QString& key, const QValueList<unsigned int>& l) {
+ QStringList stringList;
+ for(QValueList<unsigned int>::const_iterator i = l.begin(); i != l.end(); ++i) {
+ stringList.push_back(QString::number(*i));
+ }
+ m_config->writeEntry(key, stringList);
+ }
+
+ unsigned int Manager::findFreeID(const QMap<unsigned int, bool>& takenIDMap, unsigned int maxID) {
+ if(takenIDMap.size() == 0) {
+ return 0;
+ }
+ // maxID should have a real meaning now
+ for(unsigned int i = 0; i < maxID; ++i) {
+ if(takenIDMap.find(i) == takenIDMap.end()) {
+ return i;
+ }
+ }
+ return (maxID + 1);
+ }
+
+ void Manager::writeIDs() {
+ m_config->setGroup("Scripts");
+ //delete old entries
+ QValueList<unsigned int> idList = readUnsignedIntListEntry("IDs");
+ for(QValueList<unsigned int>::iterator i = idList.begin(); i != idList.end(); ++i) {
+ m_config->deleteEntry("Script" + QString::number(*i));
+ }
+ //write new ones
+ idList.clear();
+ for(QMap<unsigned int, JScript*>::iterator i = m_idScriptMap.begin(); i != m_idScriptMap.end(); ++i) {
+ unsigned int id = i.key();
+ idList.push_back(id);
+ m_config->writePathEntry("Script" + QString::number(id), (*i)->getFileName());
+ }
+ writeEntry("IDs", idList);
+ m_config->setGroup(QString());
+ }
+
+ void Manager::addDirectoryToDirWatch(const QString& dir) {
+ //FIXME: no recursive watching and no watching of files as it isn't implemented
+ // yet
+ if(!m_jScriptDirWatch->contains(dir)) {
+ m_jScriptDirWatch->addDir(dir, false, false);
+ }
+ QDir qDir(dir);
+ QStringList list = qDir.entryList(QDir::Dirs);
+ for(QStringList::iterator i = list.begin(); i != list.end(); ++i) {
+ QString subdir = *i;
+ if(subdir != "." && subdir != "..") {
+ addDirectoryToDirWatch(qDir.filePath(subdir));
+ }
+ }
+ }
+////////////////////////////// ScriptExecutionAction //////////////////////////////
+
+ ScriptExecutionAction::ScriptExecutionAction(unsigned int id, KileJScript::Manager *manager, KActionCollection* parent) : KAction(QString(), KShortcut(), NULL, NULL, parent, QString("script_execution_" + QString::number(id)).ascii()), m_manager(manager), m_id(id) {
+ const KileJScript::JScript *script = m_manager->getScript(m_id);
+ Q_ASSERT(script);
+ setText(i18n("Execution of %1").arg(script->getName()));
+ connect(this, SIGNAL(activated()), this, SLOT(executeScript()));
+ }
+
+ ScriptExecutionAction::~ScriptExecutionAction() {
+ }
+
+ void ScriptExecutionAction::executeScript() {
+ m_manager->executeJScript(m_id);
+ }
+
+};
+
+#include "kilejscript.moc"
diff --git a/src/kile/kilejscript.h b/src/kile/kilejscript.h
new file mode 100644
index 0000000..6ac133a
--- /dev/null
+++ b/src/kile/kilejscript.h
@@ -0,0 +1,284 @@
+/**************************************************************************
+* Copyright (C) 2006, 2007 by Michel Ludwig (michel.ludwig@kdemail.net) *
+***************************************************************************/
+
+/**************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef KILEJSCRIPT_H
+#define KILEJSCRIPT_H
+
+#include <qmap.h>
+#include <qobject.h>
+
+#include <kjs/interpreter.h>
+#include <kjs/object.h>
+
+#include <kaction.h>
+#include <kconfig.h>
+#include <kdirwatch.h>
+
+#include <qvaluelist.h>
+#include <qvaluevector.h>
+
+class KileInfo;
+
+namespace KileJScript {
+
+/**
+ * This class represents a JavaScript script.
+ **/
+class JScript {
+ public:
+ /**
+ * Constructs a new JavaScript script.
+ * @param file the file that contains the script
+ **/
+ JScript(unsigned int id, const QString& file);
+
+ /**
+ * Returns the code of this script, i.e. the file is read and its contents are
+ * returned.
+ **/
+ QString getCode() const;
+
+ /**
+ * Returns the name of the script (the base name of the file).
+ **/
+ QString getName() const;
+
+ /**
+ * Returns the file of the script (the full path, including the base name).
+ **/
+ QString getFileName() const;
+
+ /**
+ * Returns the unique identifier of this script.
+ **/
+ unsigned int getID() const;
+
+ /**
+ * Sets the unique identifier of this script.
+ **/
+ void setID(unsigned int id);
+
+
+ /**
+ *
+ **/
+ void setActionObject(KAction* action);
+
+ const KAction* getActionObject() const;
+
+ KAction* getActionObject();
+
+ void setKeySequence(const QString& str);
+ QString getKeySequence() const;
+
+ protected:
+ unsigned int m_id;
+ QString m_code;
+ QString m_file;
+ QString m_name;
+ KAction *m_action;
+ QString m_keySequence;
+};
+
+/**
+ * This class represents the JavaScript environment that is used to execute Kile's scripts
+ * in.
+ **/
+class JScriptEnvironment {
+ public:
+ /**
+ * Constructs a new environment.
+ **/
+ JScriptEnvironment(KileInfo *kileInfo);
+ ~JScriptEnvironment();
+
+ /**
+ * Executes JavaScript code in this environment.
+ * @param c the code that should be executed
+ **/
+ void execute(const QString& c);
+
+ protected:
+ KJS::Interpreter *m_interpreter;
+ KJS::Object* m_kileJSObject;
+ KileInfo *m_kileInfo;
+};
+
+/**
+ * This class handles the scripting functionality in Kile.
+ **/
+class Manager : public QObject {
+ Q_OBJECT
+
+ public:
+ /**
+ * Constructs a new Manager object.
+ **/
+ Manager(KileInfo *info, KConfig *config, KActionCollection *actionCollection, QObject *parent = 0, const char *name = 0);
+ virtual ~Manager();
+
+ /**
+ * Executes a script in Kile's scripting environment.
+ * @param script the script that should be executed
+ **/
+ void executeJScript(const JScript *script);
+
+ /**
+ * Executes a script in Kile's scripting environment.
+ * @param id the id of the script that should be executed
+ **/
+ void executeJScript(unsigned int id);
+
+ /**
+ * Retrieves a list of all the scripts that are currently available.
+ **/
+ QValueList<JScript*> getJScripts();
+
+ /**
+ * Writes the key sequence-to-script bindings to the KConfig object that has
+ * passed in the constructor.
+ **/
+ void writeConfig();
+
+ /**
+ * Assigns a key sequence to a script. If the parameter "keySequence" is empty,
+ * then nothing is done.
+ * @param script the script that is considered
+ * @param keySequence the key sequence that is assigned
+ **/
+ void setEditorKeySequence(JScript* script, const QString& keySequence);
+
+ /**
+ * Removes an assigned key sequence from a script.
+ * @param script the script that is considered
+ **/
+ void removeEditorKeySequence(JScript* script);
+
+ /**
+ * Returns the directory that can be used by the used to store Kile's scripts.
+ * Usually $HOME/.kde/share/apps/kile/scripts
+ **/
+ QString getLocalJScriptDirectory() const;
+
+ /**
+ * Returns the script object that corresponds to a script id.
+ * @param id the id of the script
+ **/
+ const JScript* getScript(unsigned int id);
+
+ signals:
+ /**
+ * Signal emitted whenever the managed scripts haved changed, for example if the
+ * watched directories have been scanned for scripts and thus, the potentially
+ * available scripts (could) have changed.
+ * The signal is also emitted when the currently available scripts have been
+ * deleted internally in Kile (for example, after disabling the scripting feature).
+ **/
+ void jScriptsChanged();
+
+ public slots:
+ /**
+ * Does nothing if scripting has been disabled.
+ **/
+ void scanJScriptDirectories();
+
+ /**
+ * Reads and assigns the key sequence-to-script bindings from the KConfig
+ * object that has been passed in the constructor.
+ **/
+ void readConfig();
+
+ protected:
+ QString m_localJScriptDir;
+ QValueList<JScript*> m_jScriptList;
+ QMap<unsigned int, JScript*> m_idScriptMap;
+ KDirWatch *m_jScriptDirWatch;
+
+ KileInfo *m_kileInfo;
+ KConfig *m_config;
+ KActionCollection *m_actionCollection;
+
+ /**
+ * Registers the script contained in a file.
+ * @param fileName the file that contains the script
+ **/
+ void registerScript(const QString& fileName, QMap<QString, unsigned int>& pathIDMap, QMap<unsigned int, bool>& takenIDMap, unsigned int &maxID);
+
+ /**
+ * (Re-)Creates and initialises the KDirWatch object.
+ **/
+ void populateDirWatch();
+
+ /**
+ * Deletes all the scripts that are handled by this manager.
+ **/
+ void deleteJScripts();
+
+ /**
+ * Reads an 'unsigned int' list as value for a specific key from the local KConfig
+ * object.
+ * @param key the considered entry key
+ **/
+ QValueList<unsigned int> readUnsignedIntListEntry(const QString& key);
+
+ /**
+ * Writes a key - value pair to the local KConfig object for the case that the
+ * value is an 'unsigned int' list.
+ * @param key the considered entry key
+ * @param l the 'unsigned int' list that is used as value
+ **/
+ void writeEntry(const QString& key, const QValueList<unsigned int>& l);
+
+ /**
+ * Finds the next free ID.
+ * @param takenIDMap map describing which IDs are already in use
+ * @param maxID the maximum ID that is currently in use (if there is no ID assigned, then
+ * any value can be passed here, but typically '0')
+ **/
+ unsigned int findFreeID(const QMap<unsigned int, bool>& takenIDMap, unsigned int maxID);
+
+ /**
+ * Writes the ID to file name mappings that are currently in use to the local
+ * KConfig object.
+ **/
+ void writeIDs();
+
+ private:
+ /**
+ * Recursively adds a directory to a KDirWatch object.
+ * @param dir the directory that should be added
+ **/
+ void addDirectoryToDirWatch(const QString& dir);
+};
+
+class ScriptExecutionAction : public KAction {
+ Q_OBJECT
+
+ public:
+ ScriptExecutionAction(unsigned int scriptID, Manager *manager, KActionCollection* parent = 0);
+
+ virtual ~ScriptExecutionAction();
+
+ protected slots:
+ void executeScript();
+
+ protected:
+ KileJScript::Manager *m_manager;
+ unsigned int m_id;
+};
+
+
+}
+
+#endif
+
diff --git a/src/kile/kilekonsolewidget.cpp b/src/kile/kilekonsolewidget.cpp
new file mode 100644
index 0000000..3a72073
--- /dev/null
+++ b/src/kile/kilekonsolewidget.cpp
@@ -0,0 +1,124 @@
+/***************************************************************************
+ begin : Mon Dec 22 2003
+ copyright : (C) 2001 - 2003 by Brachet Pascal, 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kilekonsolewidget.h"
+#include "kileinfo.h"
+
+#include <qfileinfo.h>
+#include <qframe.h>
+
+#include <klocale.h>
+#include <klibloader.h>
+#include <kurl.h>
+#include <kparts/part.h>
+#include <kate/document.h>
+#include <kate/view.h>
+
+#include "kileuntitled.h"
+
+namespace KileWidget
+{
+ Konsole::Konsole(KileInfo * info, QWidget *parent, const char *name) :
+ QVBox(parent, name),
+ m_bPresent(false),
+ m_ki(info)
+ {
+ spawn();
+ }
+
+ Konsole::~Konsole()
+ {
+ }
+
+ void Konsole::spawn()
+ {
+ KLibFactory *factory = KLibLoader::self()->factory("libkonsolepart");
+
+ if (!factory) return;
+ m_part = (KParts::ReadOnlyPart *) factory->create(this);
+
+ if (!m_part) return;
+
+ if (m_part->widget()->inherits("QFrame"))
+ ((QFrame*)m_part->widget())->setFrameStyle(QFrame::Panel|QFrame::Sunken);
+
+ m_bPresent=true;
+ connect ( m_part, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) );
+
+ m_part->widget()->show();
+ show();
+ }
+
+
+ void Konsole::sync()
+ {
+ Kate::Document *doc = m_ki->activeTextDocument();
+ Kate::View *view = 0;
+
+ if (doc)
+ view = static_cast<Kate::View*>(doc->views().first());
+
+ if (view)
+ {
+ QString finame;
+ KURL url = view->getDoc()->url();
+
+ if ( url.path().isEmpty() || KileUntitled::isUntitled(url.path()) ) return;
+
+ QFileInfo fic(url.directory());
+ if ( fic.isReadable() )
+ {
+ setDirectory(url.directory());
+ activate();
+ }
+
+ view->setFocus();
+ }
+ }
+
+ void Konsole::setDirectory(const QString &dirname)
+ {
+ if (m_bPresent)
+ {
+ KURL url(dirname);
+ if (m_part->url() != url)
+ m_part->openURL(url);
+ }
+ }
+
+ void Konsole::showEvent(QShowEvent *ev)
+ {
+ QWidget::showEvent(ev);
+ activate();
+ }
+
+ void Konsole::activate()
+ {
+ if (m_bPresent)
+ {
+ m_part->widget()->show();
+ this->setFocusProxy(m_part->widget());
+ m_part->widget()->setFocus();
+ }
+ }
+
+ void Konsole::slotDestroyed ()
+ {
+ m_bPresent=false;
+ spawn();
+ }
+}
+
+#include "kilekonsolewidget.moc"
diff --git a/src/kile/kilekonsolewidget.h b/src/kile/kilekonsolewidget.h
new file mode 100644
index 0000000..05d404e
--- /dev/null
+++ b/src/kile/kilekonsolewidget.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ begin : Sat Dec 8 2001
+ copyright : (C) 2001 - 2003 by Brachet Pascal, 2003 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEWIDGET_KONSOLE_H
+#define KILEWIDGET_KONSOLE_H
+
+/**
+ *@author Brachet Pascal
+ @author Jeroen Wijnhout
+ */
+
+#include <qvbox.h>
+
+namespace KParts { class ReadOnlyPart; }
+class KileInfo;
+
+namespace KileWidget
+{
+ class Konsole : public QVBox
+ {
+ Q_OBJECT
+
+ public:
+ Konsole(KileInfo *, QWidget* parent, const char* name=0);
+ ~Konsole();
+
+ public slots:
+ void setDirectory(const QString & dir);
+ void activate();
+ void sync();
+
+ private slots:
+ void slotDestroyed();
+
+ protected:
+ void showEvent(QShowEvent *ev);
+ void spawn();
+
+ private:
+ KParts::ReadOnlyPart *m_part;
+ bool m_bPresent;
+ KileInfo *m_ki;
+ };
+
+}
+
+#endif
diff --git a/src/kile/kilelauncher.cpp b/src/kile/kilelauncher.cpp
new file mode 100644
index 0000000..91dced5
--- /dev/null
+++ b/src/kile/kilelauncher.cpp
@@ -0,0 +1,369 @@
+/***************************************************************************
+ begin : mon 3-11 20:40:00 CEST 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kilelauncher.h"
+
+#include "kileinfo.h"
+#include "kiletool.h"
+#include "kiletoolmanager.h"
+#include "kiletool_enums.h"
+#include "docpart.h"
+#include "kileconfig.h"
+
+#include <qwidgetstack.h>
+#include <qregexp.h>
+#include <qfileinfo.h>
+
+#include "kiledebug.h"
+#include <krun.h>
+#include <kprocess.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <klibloader.h>
+#include <kparts/part.h>
+#include <kparts/factory.h>
+#include <kparts/partmanager.h>
+
+ namespace KileTool
+{
+ Launcher::Launcher() :
+ m_tool(0L)
+ {
+ }
+
+ Launcher::~ Launcher()
+ {
+ KILE_DEBUG() << "DELETING launcher" << endl;
+ }
+
+ ProcessLauncher::ProcessLauncher(const char * shellname /* =0 */) :
+ m_wd(QString::null),
+ m_cmd(QString::null),
+ m_options(QString::null),
+ m_texinputs(KileConfig::teXPaths()),
+ m_bibinputs(KileConfig::bibInputPaths()),
+ m_bstinputs(KileConfig::bstInputPaths()),
+ m_changeTo(true)
+ {
+ KILE_DEBUG() << "==KileTool::ProcessLauncher::ProcessLauncher()==============" << endl;
+
+ m_proc = new KShellProcess(shellname);
+ if (m_proc)
+ KILE_DEBUG() << "\tKShellProcess created" << endl;
+ else
+ KILE_DEBUG() << "\tNO KShellProcess created" << endl;
+
+ connect(m_proc, SIGNAL( receivedStdout(KProcess*, char*, int) ), this, SLOT(slotProcessOutput(KProcess*, char*, int ) ) );
+ connect(m_proc, SIGNAL( receivedStderr(KProcess*, char*, int) ),this, SLOT(slotProcessOutput(KProcess*, char*, int ) ) );
+ connect(m_proc, SIGNAL( processExited(KProcess*)), this, SLOT(slotProcessExited(KProcess*)));
+ }
+
+ ProcessLauncher::~ProcessLauncher()
+ {
+ KILE_DEBUG() << "DELETING ProcessLauncher" << endl;
+ delete m_proc;
+ }
+
+ void ProcessLauncher::setWorkingDirectory(const QString &wd)
+ {
+ m_wd = wd;
+ }
+
+ bool ProcessLauncher::launch()
+ {
+ KILE_DEBUG() << "KileTool::ProcessLauncher::launch()=================" << endl;
+ KILE_DEBUG() << "\tbelongs to tool " << tool()->name() << endl;
+
+ QString msg, out = "*****\n***** " + tool()->name() + i18n(" output: \n");
+
+ if ( m_cmd.isNull() )
+ m_cmd = tool()->readEntry("command");
+
+ if ( m_options.isNull() )
+ m_options = tool()->readEntry("options");
+
+ if ( m_changeTo && (!m_wd.isNull()) )
+ {
+ m_proc->setWorkingDirectory(m_wd);
+ out += QString("***** cd '")+ m_wd +QString("'\n");
+ }
+
+ QString str;
+ tool()->translate(m_cmd);
+ tool()->translate(m_options);
+ *m_proc << m_cmd << m_options;
+
+ if (m_proc)
+ {
+ out += QString("***** ")+ m_cmd+ ' ' + m_options + '\n';
+
+ QString src = tool()->source(false);
+ QString trgt = tool()->target();
+ if (src == trgt)
+ msg = src;
+ else
+ msg = src + " => " + trgt;
+
+ msg += " (" + m_proc->args()[0] + ')';
+
+ emit(message(Info,msg));
+
+ // QuickView tools need a special TEXINPUTS environment variable
+ if ( tool()->isQuickie() )
+ m_texinputs = KileConfig::previewTeXPaths();
+
+ KILE_DEBUG() << "$PATH=" << tool()->manager()->info()->expandEnvironmentVars("$PATH") << endl;
+ KILE_DEBUG() << "$TEXINPUTS=" << tool()->manager()->info()->expandEnvironmentVars(m_texinputs + ":$TEXINPUTS") << endl;
+ KILE_DEBUG() << "$BIBINPUTS=" << tool()->manager()->info()->expandEnvironmentVars(m_bibinputs + ":$BIBINPUTS") << endl;
+ KILE_DEBUG() << "$BSTINPUTS=" << tool()->manager()->info()->expandEnvironmentVars(m_bstinputs + ":$BSTINPUTS") << endl;
+ KILE_DEBUG() << "Tool name is "<< tool()->name() << endl;
+
+ m_proc->setEnvironment("PATH",tool()->manager()->info()->expandEnvironmentVars("$PATH"));
+
+ if (! m_texinputs.isEmpty())
+ m_proc->setEnvironment("TEXINPUTS", tool()->manager()->info()->expandEnvironmentVars(m_texinputs + ":$TEXINPUTS"));
+ if (! m_bibinputs.isEmpty())
+ m_proc->setEnvironment("BIBINPUTS", tool()->manager()->info()->expandEnvironmentVars(m_bibinputs + ":$BIBINPUTS"));
+ if (! m_bstinputs.isEmpty())
+ m_proc->setEnvironment("BSTINPUTS", tool()->manager()->info()->expandEnvironmentVars(m_bstinputs + ":$BSTINPUTS"));
+
+ out += "*****\n";
+ emit(output(out));
+
+ return m_proc->start(tool()->manager()->shouldBlock() ? KProcess::Block : KProcess::NotifyOnExit, KProcess::AllOutput);
+ }
+ else
+ return false;
+ }
+
+ bool ProcessLauncher::kill()
+ {
+ KILE_DEBUG() << "==KileTool::ProcessLauncher::kill()==============" << endl;
+ if ( m_proc && m_proc->isRunning() )
+ {
+ KILE_DEBUG() << "\tkilling" << endl;
+ return m_proc->kill();
+ }
+ else
+ {
+ KILE_DEBUG() << "\tno process or process not running" << endl;
+ return false;
+ }
+ }
+
+ bool ProcessLauncher::selfCheck()
+ {
+ emit(message(Error, i18n("Launching failed, diagnostics:")));
+
+ QString exe = KRun::binaryName(tool()->readEntry("command"), false);
+ QString path = KGlobal::dirs()->findExe(exe, QString::null, true);
+
+ if ( path.isNull() )
+ {
+ emit(message(Error, i18n("There is no executable named \"%1\" in your path.").arg(exe)));
+ return false;
+ }
+ else
+ {
+ QFileInfo fi(path);
+ if ( ! fi.isExecutable() )
+ {
+ emit(message(Error, i18n("You do not have permission to run %1.").arg(path)));
+ return false;
+ }
+ }
+
+ emit(message(Info, i18n("Diagnostics could not find any obvious problems.")));
+ return true;
+ }
+
+ void ProcessLauncher::slotProcessOutput(KProcess*, char* buf, int len)
+ {
+ emit output(QString::fromLocal8Bit(buf, len));
+ }
+
+ void ProcessLauncher::slotProcessExited(KProcess*)
+ {
+ KILE_DEBUG() << "==KileTool::ProcessLauncher::slotProcessExited=============" << endl;
+ KILE_DEBUG() << "\t" << tool()->name() << endl;
+
+ if (m_proc)
+ {
+ if (m_proc->normalExit())
+ {
+ KILE_DEBUG() << "\tnormal exit" << endl;
+ int type = Info;
+ if (m_proc->exitStatus() != 0)
+ {
+ type = Error;
+ emit(message(type,i18n("finished with exit status %1").arg(m_proc->exitStatus())));
+ }
+
+ if (type == Info)
+ emit(done(Success));
+ else
+ emit(done(Failed));
+ }
+ else
+ {
+ KILE_DEBUG() << "\tabnormal exit" << endl;
+ emit(message(Error,i18n("finished abruptly")));
+ emit(done(AbnormalExit));
+ }
+ }
+ else
+ {
+ kdWarning() << "\tNO PROCESS, emitting done" << endl;
+ emit(done(Success));
+ }
+ }
+
+ KonsoleLauncher::KonsoleLauncher(const char * shellname) : ProcessLauncher(shellname)
+ {
+ }
+
+ bool KonsoleLauncher::launch()
+ {
+ QString cmd = tool()->readEntry("command");
+ QString noclose = (tool()->readEntry("close") == "no") ? "--noclose" : "";
+ setCommand("konsole");
+ setOptions(noclose + " -T \"" + cmd + " (Kile)\" -e " + cmd + ' ' + tool()->readEntry("options"));
+
+ if ( KGlobal::dirs()->findExe(KRun::binaryName(cmd, false)).isNull() ) return false;
+
+ return ProcessLauncher::launch();
+ }
+
+ PartLauncher::PartLauncher(const char *name /* = 0*/ ) :
+ m_part(0L),
+ m_state("Viewer"),
+ m_name(name),
+ m_libName(0L),
+ m_className(0L),
+ m_options(QString::null)
+ {
+ }
+
+ PartLauncher::~PartLauncher()
+ {
+ KILE_DEBUG () << "DELETING PartLauncher" << endl;
+ }
+
+ bool PartLauncher::launch()
+ {
+ m_libName = tool()->readEntry("libName").ascii();
+ m_className = tool()->readEntry("className").ascii();
+ m_options=tool()->readEntry("libOptions");
+ m_state=tool()->readEntry("state");
+
+ QString msg, out = "*****\n***** " + tool()->name() + i18n(" output: \n");
+
+ QString shrt = "%target";
+ tool()->translate(shrt);
+ QString dir = "%dir_target"; tool()->translate(dir);
+
+ QString name = shrt;
+ if ( dir[0] == '/' )
+ name = dir + '/' + shrt;
+
+
+ KLibFactory *factory = KLibLoader::self()->factory(m_libName);
+ if (factory == 0)
+ {
+ emit(message(Error, i18n("Could not find the %1 library.").arg(m_libName)));
+ return false;
+ }
+
+ QWidgetStack *stack = tool()->manager()->widgetStack();
+ KParts::PartManager *pm = tool()->manager()->partManager();
+
+ m_part = (KParts::ReadOnlyPart *)factory->create(stack, m_libName, m_className, m_options);
+
+ if (m_part == 0)
+ {
+ emit(message(Error, i18n("Could not create component %1 from the library %2.").arg(m_className).arg(m_libName)));
+ emit(done(Failed));
+ return false;
+ }
+ else
+ {
+ QString cmd = QString(m_libName) + "->" + QString(m_className) + ' ' + m_options + ' ' + name;
+ out += "***** " + cmd + '\n';
+
+ msg = shrt+ " (" + tool()->readEntry("libName") + ')';
+ emit(message(Info,msg));
+ }
+
+ out += "*****\n";
+ emit(output(out));
+
+ tool()->manager()->wantGUIState(m_state);
+
+ stack->addWidget(m_part->widget() , 1 );
+ stack->raiseWidget(1);
+
+ m_part->openURL(KURL(name));
+ pm->addPart(m_part, true);
+ pm->setActivePart(m_part);
+
+ emit(done(Success));
+
+ return true;
+ }
+
+ bool PartLauncher::kill()
+ {
+ return true;
+ }
+
+ bool DocPartLauncher::launch()
+ {
+ m_state=tool()->readEntry("state");
+
+ QString shrt = "%target";
+ tool()->translate(shrt);
+ QString name="%dir_target/%target";
+ tool()->translate(name);
+
+ QString out = "*****\n***** " + tool()->name() + i18n(" output: \n") + "***** KHTML " + name + "\n*****\n";
+ QString msg = shrt+ " (KHTML)";
+ emit(message(Info, msg));
+ emit(output(out));
+
+ QWidgetStack *stack = tool()->manager()->widgetStack();
+ KParts::PartManager *pm = tool()->manager()->partManager();
+
+ DocumentationViewer *htmlpart = new DocumentationViewer(stack,"help");
+ m_part = static_cast<KParts::ReadOnlyPart*>(htmlpart);
+
+ connect(htmlpart, SIGNAL(updateStatus(bool, bool)), tool(), SIGNAL(updateStatus(bool, bool)));
+
+ tool()->manager()->wantGUIState(m_state);
+
+ htmlpart->openURL(KURL(name));
+ htmlpart->addToHistory(name);
+ stack->addWidget(htmlpart->widget() , 1 );
+ stack->raiseWidget(1);
+
+ pm->addPart(htmlpart, true);
+ pm->setActivePart( htmlpart);
+
+ emit(done(Success));
+
+ return true;
+ }
+}
+
+#include "kilelauncher.moc"
diff --git a/src/kile/kilelauncher.h b/src/kile/kilelauncher.h
new file mode 100644
index 0000000..866ba2c
--- /dev/null
+++ b/src/kile/kilelauncher.h
@@ -0,0 +1,154 @@
+/***************************************************************************
+ begin : mon 3-11 20:40:00 CEST 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILE_LAUNCHER
+#define KILE_LAUNCHER
+
+#include <qobject.h>
+#include <qdict.h>
+#include <qstringlist.h>
+
+class QWidgetStack;
+
+
+class KProcess;
+class KShellProcess;
+class KileInfo;
+namespace KParts { class ReadOnlyPart; class PartManager; }
+
+namespace KileTool
+{
+ class Base;
+
+ /**
+ * This class represents a way to launch a tool. This could be a commandline tool
+ * running in a Konsole, running as a separate process, it could even be responsible
+ * for starting a KPart.
+ *
+ * @author Jeroen Wijnhout
+ **/
+ class Launcher : public QObject
+ {
+ Q_OBJECT
+
+ public:
+ Launcher();
+ ~Launcher();
+
+ public slots:
+ virtual bool launch() = 0;
+ virtual bool kill() = 0;
+ virtual bool selfCheck() = 0;
+
+ public:
+ virtual void setWorkingDirectory(const QString &) {}
+
+ void setTool(Base *tool) { m_tool = tool; }
+ Base* tool() { return m_tool; }
+
+ signals:
+ void message(int, const QString & );
+ void output(const QString &);
+
+ void exitedWith(int);
+ void abnormalExit();
+
+ void done(int);
+
+ private:
+ //QDict<QString> *m_pdictParams;
+ Base *m_tool;
+ };
+
+ class ProcessLauncher : public Launcher
+ {
+ Q_OBJECT
+
+ public:
+ ProcessLauncher(const char * shellname =0);
+ ~ProcessLauncher();
+
+ public:
+ void setWorkingDirectory(const QString &wd);
+ void changeToWorkingDirectory(bool change) { m_changeTo = change; }
+ void setCommand(const QString & cmd) { m_cmd = cmd; }
+ void setOptions(const QString & opt) { m_options = opt; }
+
+ public slots:
+ bool launch();
+ bool kill();
+ bool selfCheck();
+
+ private slots:
+ void slotProcessOutput(KProcess*, char*, int );
+ void slotProcessExited(KProcess*);
+
+ private:
+ QString m_wd, m_cmd, m_options, m_texinputs, m_bibinputs, m_bstinputs;
+ KShellProcess *m_proc;
+ bool m_changeTo;
+ };
+
+ class KonsoleLauncher : public ProcessLauncher
+ {
+ Q_OBJECT
+
+ public:
+ KonsoleLauncher(const char * shellname =0);
+
+ public slots:
+ bool launch();
+ };
+
+ class PartLauncher : public Launcher
+ {
+ Q_OBJECT
+
+ public:
+ PartLauncher(const char * = 0);
+ ~PartLauncher();
+
+ void setLibrary(const char *lib) { m_libName = lib; }
+ void setClass(const char *clas) { m_className = clas; }
+ void setOptions(QString & options) { m_options = options; }
+
+ public slots:
+ bool launch();
+ bool kill();
+ bool selfCheck() { return true; } //no additional self-checks, all of them are done in launch()
+
+ KParts::ReadOnlyPart* part() { return m_part; }
+
+ protected:
+ KParts::ReadOnlyPart *m_part;
+
+ QString m_state;
+ const char *m_name, *m_libName, *m_className;
+ QString m_options;
+ };
+
+ class DocPartLauncher : public PartLauncher
+ {
+ Q_OBJECT
+
+ public:
+ DocPartLauncher(const char * name = 0) : PartLauncher(name) {}
+
+ public slots:
+ bool launch();
+ };
+}
+
+#endif
diff --git a/src/kile/kilelistselector.cpp b/src/kile/kilelistselector.cpp
new file mode 100644
index 0000000..7ab8cc8
--- /dev/null
+++ b/src/kile/kilelistselector.cpp
@@ -0,0 +1,114 @@
+/***************************************************************************
+ begin : Fri Aug 15 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ (C) 2007 by Holger Danielsson
+ email : Jeroen.Wijnhout@kdemail.net
+ holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kilelistselector.h"
+
+#include <qstringlist.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qheader.h>
+
+#include <kapplication.h>
+#include "kiledebug.h"
+#include <klocale.h>
+
+//////////////////// KileListSelectorBase ////////////////////
+
+KileListSelectorBase::KileListSelectorBase(const QStringList &list, const QString &caption, const QString &select, QWidget *parent, const char *name) :
+ KDialogBase( KDialogBase::Plain, caption, Ok|Cancel,Ok, parent, name, true, true )
+{
+ QVBoxLayout *layout = new QVBoxLayout(plainPage());
+
+ layout->addWidget(new QLabel(select, plainPage()));
+ layout->addSpacing(8);
+
+ m_listview = new KListView(plainPage());
+ m_listview->addColumn(i18n("Files"));
+ m_listview->setSorting(-1);
+ m_listview->setAllColumnsShowFocus(true);
+ m_listview->setFullWidth(true);
+ m_listview->setItemsMovable(false); // default: true
+ //setAcceptDrops(false); // default: false
+ //setDragEnabled(false); // default: false
+ //setShadeSortColumn(true); // default: true
+ m_listview->header()->setMovingEnabled(false); // default: true
+
+#if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0)
+ m_listview->setShadeSortColumn(false);
+#endif
+ layout->addWidget(m_listview);
+
+ insertStringList(list);
+
+ int w = m_listview->columnWidth(0) + 32;
+ w = ( w > 275 ) ? w : 275;
+ int h = ( list.count() > 0 ) ? m_listview->header()->height()+12*m_listview->firstChild()->height() : 224;
+ m_listview->setMinimumSize(w,h);
+
+ resize(sizeHint().width(),sizeHint().height()+4);
+ connect(m_listview, SIGNAL(doubleClicked(QListViewItem*,const QPoint &,int)), this, SLOT(accept()));
+}
+
+int KileListSelectorBase::currentItem()
+{
+ QListViewItem *item = m_listview->currentItem();
+ return ( item ) ? m_listview->itemIndex(item) : -1;
+}
+
+void KileListSelectorBase::insertStringList(const QStringList &list)
+{
+ QStringList::ConstIterator it;
+ KListViewItem *item = 0L;
+ for ( it=list.begin(); it!=list.end(); ++it )
+ {
+ item = new KListViewItem(m_listview,item,*it);
+ m_listview->insertItem(item);
+ }
+}
+
+//////////////////// with single selection ////////////////////
+
+KileListSelector::KileListSelector(const QStringList &list, const QString &caption, const QString &select, QWidget *parent, const char *name) : KileListSelectorBase(list,caption,select,parent,name)
+{
+ m_listview->setSelectionMode(QListView::Single);
+
+ if ( list.count() > 0 )
+ m_listview->setSelected(m_listview->firstChild(),true);
+}
+
+//////////////////// with multi selection ////////////////////
+
+KileListSelectorMultiple::KileListSelectorMultiple(const QStringList &list, const QString &caption, const QString &select, QWidget *parent, const char *name) : KileListSelectorBase(list,caption,select,parent,name)
+{
+ m_listview->setSelectionMode(QListView::Extended); // default: Single
+}
+
+const QStringList& KileListSelectorMultiple::selected()
+{
+ m_selectedfiles.clear();
+
+ QPtrList<QListViewItem> list = m_listview->selectedItems();
+ QPtrListIterator<QListViewItem> it(list);
+ while ( it.current() )
+ {
+ m_selectedfiles.append((*it)->text(0));
+ ++it;
+ }
+ return m_selectedfiles;
+}
+
+
diff --git a/src/kile/kilelistselector.h b/src/kile/kilelistselector.h
new file mode 100644
index 0000000..cf96930
--- /dev/null
+++ b/src/kile/kilelistselector.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ begin : Fri Aug 15 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ (C) 2007 by Holger Danielsson
+ email : Jeroen.Wijnhout@kdemail.net
+ holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef KILELISTSELECTOR_H
+#define KILELISTSELECTOR_H
+
+#include <kdialogbase.h>
+#include <klistview.h>
+
+class KListView;
+class QStringList;
+
+class KileListSelectorBase : public KDialogBase
+{
+public:
+ KileListSelectorBase(const QStringList &list, const QString &caption, const QString &select, QWidget *parent=0, const char *name=0);
+ ~KileListSelectorBase() {}
+
+ int currentItem();
+
+protected:
+ KListView *m_listview;
+ void insertStringList(const QStringList &list);
+};
+
+class KileListSelector : public KileListSelectorBase
+{
+public:
+ KileListSelector(const QStringList &list, const QString &caption, const QString &select, QWidget *parent=0, const char *name=0);
+ ~KileListSelector() {}
+};
+
+class KileListSelectorMultiple : public KileListSelectorBase
+{
+public:
+ KileListSelectorMultiple(const QStringList & list, const QString &caption, const QString &select, QWidget *parent=0, const char *name=0);
+ ~KileListSelectorMultiple() {}
+
+ const QStringList &selected();
+
+private:
+ QStringList m_selectedfiles;
+};
+
+
+#endif
diff --git a/src/kile/kilelogwidget.cpp b/src/kile/kilelogwidget.cpp
new file mode 100644
index 0000000..9ebcc2d
--- /dev/null
+++ b/src/kile/kilelogwidget.cpp
@@ -0,0 +1,200 @@
+/***************************************************************************
+ begin : Sat Dec 20 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ****************************************************************************/
+
+#include "kilelogwidget.h"
+
+#include <qregexp.h>
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+
+#include "kiledebug.h"
+#include <kurl.h>
+#include <klocale.h>
+
+#include "kiletool_enums.h"
+#include "kileinfo.h"
+#include "kileconfig.h"
+
+namespace KileWidget
+{
+ LogMsg::LogMsg(KileInfo *info, QWidget *parent, const char *name ) :
+ KTextEdit(parent,name),
+ m_info(info)
+ {
+ setTabStopWidth(10);
+ connect(this, SIGNAL(clicked(int, int)), this, SLOT(slotClicked(int, int)));
+ }
+
+ LogMsg::~LogMsg(){
+ }
+
+ void LogMsg::highlight()
+ {
+ blockSignals(true); // block signals to avoid recursion
+ setUpdatesEnabled(false);
+ int cursorParagraph, cursorIndex;
+
+ getCursorPosition( &cursorParagraph, &cursorIndex );
+
+ int line=0;
+ for(uint i = 0 ; i < m_info->outputInfo()->size() ; ++i )
+ {
+ line = (*m_info->outputInfo())[i].outputLine();
+
+ setSelection( line,0, line,paragraphLength(line) );
+
+ switch ( (*m_info->outputInfo())[i].type() )
+ {
+ case LatexOutputInfo::itmError : setColor(QColor(0xCC, 0x00, 0x00)); break;
+ case LatexOutputInfo::itmWarning : setColor(QColor(0x00, 0x00, 0xCC )); break;
+ case LatexOutputInfo::itmBadBox : setColor(QColor(0x00, 0x80, 0x00)); break;
+ default : break;
+ }
+ removeSelection();
+ }
+ setCursorPosition( cursorParagraph, cursorIndex );
+ setUpdatesEnabled(true);
+ blockSignals(false); // block signals to avoid recursion
+ }
+
+ void LogMsg::highlight(uint l, int direction /* = 1 */)
+ {
+ setCursorPosition(l + direction * 3 , 0);
+ setSelection(l, 0, l, paragraphLength(l));
+ }
+
+ void LogMsg::highlightByIndex(int index, int size, int direction /* = 1 */)
+ {
+ int parags = paragraphs();
+ int problemsFound = 0;
+ int targetProblemNumber = size - index;
+ static QRegExp reProblem(".*:[0-9]+:.*");
+
+ //start from the bottom (most recent error) because
+ //there could very well be errors with the same name
+ for ( int i = parags - 1; i >= 0; --i )
+ {
+ if ( reProblem.exactMatch(text(i)) ) ++problemsFound;
+
+ if ( problemsFound == targetProblemNumber )
+ {
+ highlight(i, direction);
+ break;
+ }
+ }
+ }
+
+ void LogMsg::slotClicked(int parag, int /*index*/)
+ {
+ int l = 0;
+ QString s = text(parag), file = QString::null;
+
+ static QRegExp reES = QRegExp("(^.*):([0-9]+):.*");
+ //maybe there is an error summary
+ if ( reES.search(s) != -1 )
+ {
+ l = reES.cap(2).toInt();
+ file = reES.cap(1);
+ }
+ else
+ {
+ //look for error at line parag
+ for (uint i=0; i< m_info->outputInfo()->size(); ++i)
+ {
+ if ( (*m_info->outputInfo())[i].outputLine() == parag)
+ {
+ file = (*m_info->outputInfo())[i].source();
+ l = (*m_info->outputInfo())[i].sourceLine();
+ break;
+ }
+ }
+ }
+
+ file = m_info->getFullFromPrettyName(file);
+
+ if ( file != QString::null )
+ {
+ emit(fileOpen(KURL::fromPathOrURL(file), QString::null));
+ if ( l > 0 ) emit(setLine(QString::number(l)));
+ }
+ }
+
+ void LogMsg::printMsg(int type, const QString & message, const QString &tool)
+ {
+ if ( type == KileTool::Error ) emit showingErrorMessage(this);
+
+ QString ot = "", ct = "</font>";
+
+ switch (type)
+ {
+ case KileTool::Warning :
+ ot = "<font color='blue'>";
+ break;
+ case KileTool::ProblemWarning :
+ if ( KileConfig::hideProblemWarning() ) return;
+ ot = "<font color='blue'>";
+ break;
+ case KileTool::Error : case KileTool::ProblemError :
+ ot = "<font color='red'>";
+ break;
+ case KileTool::ProblemBadBox :
+ if ( KileConfig::hideProblemBadBox() ) return;
+ ot = "<font color='#666666'>";
+ break;
+ default : ot = "<font color='black'>"; break;
+ }
+
+ if (tool.isNull())
+ append(ot + message + ct);
+ else
+ append(ot + "<b>[" + tool + "]</b> " + message + ct );
+
+ scrollToBottom();
+ }
+
+ void LogMsg::printProblem(int type, const QString & problem)
+ {
+ KILE_DEBUG() << "\t" << problem << endl;
+ printMsg(type, problem, QString::null);
+ }
+
+ QPopupMenu* LogMsg::createPopupMenu (const QPoint & pos)
+ {
+ //get standard popup menu
+ QPopupMenu * popup = KTextEdit::createPopupMenu(pos);
+
+ //add toggle operations for hiding warnings/badboxes
+ popup->insertSeparator();
+
+ m_idBadBox = popup->insertItem(i18n("Hide &Bad Boxes"));
+ popup->setItemChecked(m_idBadBox, KileConfig::hideProblemBadBox());
+
+ m_idWarning = popup->insertItem(i18n("Hide (La)TeX &Warnings"));
+ popup->setItemChecked(m_idWarning, KileConfig::hideProblemWarning());
+
+ disconnect ( popup , SIGNAL(activated(int)), this , SLOT(handlePopup(int )));
+ connect ( popup , SIGNAL(activated(int)), this , SLOT(handlePopup(int )));
+
+ return popup;
+ }
+
+ void LogMsg::handlePopup(int id)
+ {
+ if ( id == m_idBadBox ) KileConfig::setHideProblemBadBox(!KileConfig::hideProblemBadBox());
+ else if ( id == m_idWarning ) KileConfig::setHideProblemWarning(!KileConfig::hideProblemWarning());
+ }
+}
+
+#include "kilelogwidget.moc"
diff --git a/src/kile/kilelogwidget.h b/src/kile/kilelogwidget.h
new file mode 100644
index 0000000..855ce58
--- /dev/null
+++ b/src/kile/kilelogwidget.h
@@ -0,0 +1,66 @@
+/***************************************************************************
+ begin : Sat Dec 20 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ****************************************************************************/
+#ifndef KILEWIDGET_LOGMSG_H
+#define KILEWIDGET_LOGMSG_H
+
+#include <ktextedit.h>
+
+class QString;
+class QPopupMenu;
+class QPoint;
+
+class KileInfo;
+class KURL;
+
+namespace KileWidget
+{
+ class LogMsg : public KTextEdit
+ {
+ Q_OBJECT
+
+ public:
+ LogMsg(KileInfo *info, QWidget *parent, const char *name=0);
+ ~LogMsg();
+
+ void setReadOnly(bool r) { QTextEdit::setReadOnly(r); } //we don't want the greyed background
+
+ public slots:
+ void highlight(); //FIXME for compatibility, should remove it asap
+ void highlight(uint l, int direction = 1);
+ void highlightByIndex(int index, int size, int direction = 1);
+
+ void printMsg(int type, const QString & message, const QString &tool = "Kile" );
+ void printProblem(int type, const QString & problem);
+
+ void slotClicked(int, int);
+
+ signals:
+ void fileOpen(const KURL &, const QString &);
+ void setLine(const QString &);
+ void showingErrorMessage(QWidget *);
+
+ protected:
+ QPopupMenu* createPopupMenu (const QPoint & pos);
+
+ protected slots:
+ void handlePopup(int);
+
+ private:
+ KileInfo *m_info;
+ int m_idWarning, m_idBadBox;
+ };
+}
+
+#endif
diff --git a/src/kile/kilelyxserver.cpp b/src/kile/kilelyxserver.cpp
new file mode 100644
index 0000000..2fca99e
--- /dev/null
+++ b/src/kile/kilelyxserver.cpp
@@ -0,0 +1,234 @@
+/***************************************************************************
+ begin : Sat Sept 9 2003
+ edit : Tue Mar 20 2007
+ copyright : (C) 2003 by Jeroen Wijnhout, 2007 by Thomas Braun
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kilelyxserver.h"
+
+#include <sys/stat.h>
+#include <stdlib.h> //getenv
+#include <unistd.h> //read
+#include <fcntl.h>
+
+#include "kileactions.h"
+
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qsocketnotifier.h>
+#include <qregexp.h>
+#include <qdir.h>
+
+#include "kiledebug.h"
+#include <klocale.h>
+
+KileLyxServer::KileLyxServer(bool startMe) :
+ m_perms( S_IRUSR | S_IWUSR ),m_running(false)
+{
+ KILE_DEBUG() << "===KileLyxServer::KileLyxServer(bool" << startMe << ")===" << endl;
+ m_pipeIn.setAutoDelete(true);
+ m_notifier.setAutoDelete(true);
+
+ m_file.setAutoDelete(false);
+ m_tempDir = new KTempDir();
+ if(!m_tempDir)
+ return;
+
+ m_tempDir->setAutoDelete(true);
+
+ m_links << ".lyxpipe.in" << ".lyx/lyxpipe.in";
+ m_links << ".lyxpipe.out" << ".lyx/lyxpipe.out";
+
+ for(uint i = 0; i< m_links.count() ; i++)
+ {
+ m_pipes.append( m_tempDir->name() + m_links[i] );
+ m_links[i].prepend(QDir::homeDirPath() + '/' );
+ KILE_DEBUG() << "m_pipes[" << i << "]=" << m_pipes[i] << endl;
+ KILE_DEBUG() << "m_links[" << i << "]=" << m_links[i] << endl;
+ }
+
+ if (startMe)
+ start();
+}
+
+KileLyxServer::~KileLyxServer()
+{
+ stop();
+ removePipes();
+ delete m_tempDir;
+}
+
+bool KileLyxServer::start()
+{
+ if (m_running)
+ stop();
+
+ KILE_DEBUG() << "Starting the LyX server..." << endl;
+
+ if (openPipes())
+ {
+ QSocketNotifier *notifier;
+ QPtrListIterator<QFile> it(m_pipeIn);
+ while (it.current())
+ {
+ if ((*it)->name().right(3) == ".in" )
+ {
+ notifier = new QSocketNotifier((*it)->handle(), QSocketNotifier::Read, this);
+ connect(notifier, SIGNAL(activated(int)), this, SLOT(receive(int)));
+ m_notifier.append(notifier);
+ KILE_DEBUG() << "Created notifier for " << (*it)->name() << endl;
+ }
+ else
+ KILE_DEBUG() << "No notifier created for " << (*it)->name() << endl;
+ ++it;
+ }
+ m_running=true;
+ }
+
+ return m_running;
+}
+
+bool KileLyxServer::openPipes()
+{
+ KILE_DEBUG() << "===bool KileLyxServer::openPipes()===" << endl;
+
+ bool opened = false;
+ QFileInfo pipeInfo,linkInfo;
+ QFile *file;
+ struct stat buf;
+ struct stat *stats = &buf;
+
+ for (uint i=0; i < m_pipes.count(); ++i)
+ {
+ pipeInfo.setFile(m_pipes[i]);
+ linkInfo.setFile(m_links[i]);
+
+ QFile::remove(linkInfo.absFilePath());
+ linkInfo.refresh();
+
+ if ( !pipeInfo.exists() )
+ {
+ //create the dir first
+ if ( !QFileInfo(pipeInfo.dirPath(true)).exists() )
+ if ( mkdir(QFile::encodeName( pipeInfo.dirPath() ), m_perms | S_IXUSR) == -1 )
+ {
+ kdError() << "Could not create directory for pipe" << endl;
+ continue;
+ }
+ else
+ KILE_DEBUG() << "Created directory " << pipeInfo.dirPath() << endl;
+
+ if ( mkfifo(QFile::encodeName( pipeInfo.absFilePath() ), m_perms) != 0 )
+ {
+ kdError() << "Could not create pipe: " << pipeInfo.absFilePath() << endl;
+ continue;
+ }
+ else
+ KILE_DEBUG() << "Created pipe: " << pipeInfo.absFilePath() << endl;
+ }
+
+ if ( symlink(QFile::encodeName(pipeInfo.absFilePath()),QFile::encodeName(linkInfo.absFilePath())) != 0 )
+ {
+ kdError() << "Could not create symlink: " << linkInfo.absFilePath() << " --> " << pipeInfo.absFilePath() << endl;
+ continue;
+ }
+
+ file = new QFile(pipeInfo.absFilePath());
+ pipeInfo.refresh();
+
+ if( pipeInfo.exists() && file->open(IO_ReadWrite) ) // in that order we don't create the file if it does not exist
+ {
+ KILE_DEBUG() << "Opened file: " << pipeInfo.absFilePath() << endl;
+ fstat(file->handle(),stats);
+ if( !S_ISFIFO(stats->st_mode) )
+ {
+ kdError() << "The file " << pipeInfo.absFilePath() << "we just created is not a pipe!" << endl;
+ file->close();
+ delete file;
+ continue;
+ }
+ else
+ { // everything is correct :)
+ m_pipeIn.append(file);
+ m_file.insert(file->handle(),file);
+ opened=true;
+ }
+ }
+ else {
+ kdError() << "Could not open " << pipeInfo.absFilePath() << endl;
+ delete file;
+ }
+ }
+ return opened;
+}
+
+void KileLyxServer::stop()
+{
+ KILE_DEBUG() << "Stopping the LyX server..." << endl;
+
+ QPtrListIterator<QFile> it(m_pipeIn);
+ while (it.current())
+ {
+ (*it)->close();
+ ++it;
+ }
+
+ m_pipeIn.clear();
+ m_notifier.clear();
+
+ m_running=false;
+}
+
+void KileLyxServer::removePipes()
+{
+ for ( uint i = 0; i < m_links.count(); ++i)
+ QFile::remove(m_links[i]);
+ for ( uint i = 0; i < m_pipes.count(); ++i)
+ QFile::remove(m_pipes[i]);
+
+}
+
+void KileLyxServer::processLine(const QString &line)
+{
+ KILE_DEBUG() << "===void KileLyxServer::processLine(const QString " << line << ")===" << endl;
+
+ QRegExp reCite(":citation-insert:(.*)$");
+ QRegExp reBibtexdbadd(":bibtex-database-add:(.*)$");
+ QRegExp rePaste(":paste:(.*)$");
+
+ if( line.find(reCite) != -1 )
+ emit(insert(KileAction::TagData(i18n("Cite"), "\\cite{"+reCite.cap(1)+'}')));
+ else if( line.find(reBibtexdbadd) != -1 )
+ emit(insert(KileAction::TagData(i18n("BibTeX db add"), "\\bibliography{"+ reBibtexdbadd.cap(1) + '}')));
+ else if( line.find(rePaste) != -1)
+ emit(insert(KileAction::TagData(i18n("Paste"), rePaste.cap(1))));
+}
+
+void KileLyxServer::receive(int fd)
+{
+ if (m_file[fd])
+ {
+ int bytesRead;
+ int const size = 256;
+ char buffer[size];
+ if ((bytesRead = read(fd, buffer, size - 1)) > 0 )
+ {
+ buffer[bytesRead] = '\0'; // turn it into a c string
+ QStringList cmds = QStringList::split('\n', QString(buffer).stripWhiteSpace());
+ for ( uint i = 0; i < cmds.count(); ++i )
+ processLine(cmds[i]);
+ }
+ }
+}
+
+#include "kilelyxserver.moc"
diff --git a/src/kile/kilelyxserver.h b/src/kile/kilelyxserver.h
new file mode 100644
index 0000000..2627af1
--- /dev/null
+++ b/src/kile/kilelyxserver.h
@@ -0,0 +1,77 @@
+/***************************************************************************
+ begin : Sat Sept 9 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _LYXSERVER_H_
+#define _LYXSERVER_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <qobject.h>
+#include <qptrlist.h>
+#include <qintdict.h>
+#include <qstringlist.h>
+#include <ktempdir.h>
+
+#include <sys/types.h>
+
+/**
+ * @short Simple server that impersonates as LyX to work with gBib, pyBibliographer etc.
+ * @author Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>
+ * @author Thomas Braun
+ * @version 0.2
+ */
+
+class QFile;
+class QSocketNotifier;
+namespace KileAction { class TagData; }
+
+class KileLyxServer : public QObject
+{
+ Q_OBJECT
+
+public:
+ KileLyxServer(bool start = true);
+ ~KileLyxServer();
+
+ bool isRunning() { return m_running; }
+
+public slots:
+ bool start();
+ void stop();
+
+private slots:
+ void receive(int);
+
+private:
+ bool openPipes();
+ void removePipes();
+ void processLine(const QString &);
+
+signals:
+ void insert(const KileAction::TagData &);
+
+private:
+ mode_t m_perms;
+ KTempDir *m_tempDir;
+ QPtrList<QFile> m_pipeIn;
+ QPtrList<QSocketNotifier> m_notifier;
+ QIntDict<QFile> m_file;
+ bool m_running;
+ QStringList m_links,m_pipes;
+};
+
+#endif // _LYXSERVER_H_
diff --git a/src/kile/kilemultitabbar.cpp b/src/kile/kilemultitabbar.cpp
new file mode 100644
index 0000000..d15ebc0
--- /dev/null
+++ b/src/kile/kilemultitabbar.cpp
@@ -0,0 +1,1019 @@
+/***************************************************************************
+ kilemultitabbar.cpp - description
+ -------------------
+ begin : 2001
+ copyright : (C) 2001,2002,2003 by Joseph Wenninger <jowenn@kde.org>
+ (C) 2007 by Michel Ludwig <michel.ludwig@kdemail.net>
+ ***************************************************************************/
+
+/***************************************************************************
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ ***************************************************************************/
+
+//FIXME: remove for the KDE4 version again and push the fix for hidden widgets
+// upstream
+
+#include "kilemultitabbar.h"
+#include "kilemultitabbar_p.h"
+#include "kilemultitabbar.moc"
+#include "kilemultitabbar_p.moc"
+#include <qbutton.h>
+#include <qpopupmenu.h>
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qtooltip.h>
+#include <qfontmetrics.h>
+#include <qregexp.h>
+#include <qstyle.h>
+
+#include <kiconloader.h>
+#include "kiledebug.h"
+#include <qapplication.h>
+#include <math.h>
+
+#define NEARBYINT(i) ((int(float(i) + 0.5)))
+
+class KileMultiTabBarTabPrivate {
+public:
+ QPixmap pix;
+};
+
+
+KileMultiTabBarInternal::KileMultiTabBarInternal(QWidget *parent, KileMultiTabBar::KileMultiTabBarMode bm):QScrollView(parent)
+{
+ m_expandedTabSize=-1;
+ m_showActiveTabTexts=false;
+ m_tabs.setAutoDelete(true);
+ m_barMode=bm;
+ setHScrollBarMode(AlwaysOff);
+ setVScrollBarMode(AlwaysOff);
+ if (bm==KileMultiTabBar::Vertical)
+ {
+ box=new QWidget(viewport());
+ mainLayout=new QVBoxLayout(box);
+ mainLayout->setAutoAdd(true);
+ box->setFixedWidth(24);
+ setFixedWidth(24);
+ }
+ else
+ {
+ box=new QWidget(viewport());
+ mainLayout=new QHBoxLayout(box);
+ mainLayout->setAutoAdd(true);
+ box->setFixedHeight(24);
+ setFixedHeight(24);
+ }
+ addChild(box);
+ setFrameStyle(NoFrame);
+ viewport()->setBackgroundMode(Qt::PaletteBackground);
+/* box->setPaletteBackgroundColor(Qt::red);
+ setPaletteBackgroundColor(Qt::green);*/
+}
+
+void KileMultiTabBarInternal::setStyle(enum KileMultiTabBar::KileMultiTabBarStyle style)
+{
+ m_style=style;
+ for (uint i=0;i<m_tabs.count();i++)
+ m_tabs.at(i)->setStyle(m_style);
+
+ if ( (m_style==KileMultiTabBar::KDEV3) ||
+ (m_style==KileMultiTabBar::KDEV3ICON ) ) {
+ delete mainLayout;
+ mainLayout=0;
+ resizeEvent(0);
+ } else if (mainLayout==0) {
+ if (m_barMode==KileMultiTabBar::Vertical)
+ {
+ box=new QWidget(viewport());
+ mainLayout=new QVBoxLayout(box);
+ box->setFixedWidth(24);
+ setFixedWidth(24);
+ }
+ else
+ {
+ box=new QWidget(viewport());
+ mainLayout=new QHBoxLayout(box);
+ box->setFixedHeight(24);
+ setFixedHeight(24);
+ }
+ addChild(box);
+ for (uint i=0;i<m_tabs.count();i++)
+ mainLayout->add(m_tabs.at(i));
+ mainLayout->setAutoAdd(true);
+
+ }
+ viewport()->repaint();
+}
+
+void KileMultiTabBarInternal::drawContents ( QPainter * paint, int clipx, int clipy, int clipw, int cliph )
+{
+ QScrollView::drawContents (paint , clipx, clipy, clipw, cliph );
+
+ if (m_position==KileMultiTabBar::Right)
+ {
+
+ paint->setPen(colorGroup().shadow());
+ paint->drawLine(0,0,0,viewport()->height());
+ paint->setPen(colorGroup().background().dark(120));
+ paint->drawLine(1,0,1,viewport()->height());
+
+
+ }
+ else
+ if (m_position==KileMultiTabBar::Left)
+ {
+ paint->setPen(colorGroup().light());
+ paint->drawLine(23,0,23,viewport()->height());
+ paint->drawLine(22,0,22,viewport()->height());
+
+ paint->setPen(colorGroup().shadow());
+ paint->drawLine(0,0,0,viewport()->height());
+ }
+ else
+ if (m_position==KileMultiTabBar::Bottom)
+ {
+ paint->setPen(colorGroup().shadow());
+ paint->drawLine(0,0,viewport()->width(),0);
+ paint->setPen(colorGroup().background().dark(120));
+ paint->drawLine(0,1,viewport()->width(),1);
+ }
+ else
+ {
+ paint->setPen(colorGroup().light());
+ paint->drawLine(0,23,viewport()->width(),23);
+ paint->drawLine(0,22,viewport()->width(),22);
+
+/* paint->setPen(colorGroup().shadow());
+ paint->drawLine(0,0,0,viewport()->height());*/
+
+ }
+
+
+}
+
+void KileMultiTabBarInternal::contentsMousePressEvent(QMouseEvent *ev)
+{
+ ev->ignore();
+}
+
+void KileMultiTabBarInternal::mousePressEvent(QMouseEvent *ev)
+{
+ ev->ignore();
+}
+
+
+#define CALCDIFF(m_tabs,diff,i) if (m_lines>(int)lines) {\
+ /*KILE_DEBUG()<<"i="<<i<<" tabCount="<<tabCount<<" space="<<space<<endl;*/ \
+ uint ulen=0;\
+ diff=0; \
+ for (uint i2=i;i2<tabCount;i2++) {\
+ uint l1=(*(m_tabs.at(i2)))->neededSize();\
+ if ((ulen+l1)>space){\
+ if (ulen==0) diff=0;\
+ else diff=((float)(space-ulen))/(i2-i);\
+ break;\
+ }\
+ ulen+=l1;\
+ }\
+ } else {diff=0; }
+
+
+void KileMultiTabBarInternal::resizeEvent(QResizeEvent *ev) {
+/* KILE_DEBUG()<<"KileMultiTabBarInternal::resizeEvent"<<endl;
+ KILE_DEBUG()<<"KileMultiTabBarInternal::resizeEvent - box geometry"<<box->geometry()<<endl;
+ KILE_DEBUG()<<"KileMultiTabBarInternal::resizeEvent - geometry"<<geometry()<<endl;*/
+ if (ev) QScrollView::resizeEvent(ev);
+ QValueList<KileMultiTabBarTab*> visibleTabList;
+ for(KileMultiTabBarTab *tab = m_tabs.first(); tab; tab = m_tabs.next()) {
+ if(tab->isVisible()) {
+ visibleTabList.push_back(tab);
+ }
+ }
+
+ if ( (m_style==KileMultiTabBar::KDEV3) ||
+ (m_style==KileMultiTabBar::KDEV3ICON) ){
+ box->setGeometry(0,0,width(),height());
+ int lines=1;
+ uint space;
+ float tmp=0;
+ if ((m_position==KileMultiTabBar::Bottom) || (m_position==KileMultiTabBar::Top))
+ space=width();
+ else
+ space=height();
+
+ int cnt=0;
+
+//CALCULATE LINES
+ const uint tabCount = visibleTabList.count();
+ for (uint i=0;i<tabCount;i++) {
+ cnt++;
+ tmp+=(*(visibleTabList.at(i)))->neededSize();
+ if (tmp>space) {
+ if (cnt>1)i--;
+ else if (i==(tabCount-1)) break;
+ cnt=0;
+ tmp=0;
+ lines++;
+ }
+ }
+//SET SIZE & PLACE
+ float diff=0;
+ cnt=0;
+
+ if ((m_position==KileMultiTabBar::Bottom) || (m_position==KileMultiTabBar::Top)) {
+
+ setFixedHeight(lines*24);
+ box->setFixedHeight(lines*24);
+ m_lines=height()/24-1;
+ lines=0;
+ CALCDIFF(visibleTabList,diff,0)
+ tmp=-diff;
+
+ //KILE_DEBUG()<<"m_lines recalculated="<<m_lines<<endl;
+ for (uint i=0;i<tabCount;i++) {
+ KileMultiTabBarTab *tab=*(visibleTabList.at(i));
+ cnt++;
+ tmp+=tab->neededSize()+diff;
+ if (tmp>space) {
+ //KILE_DEBUG()<<"about to start new line"<<endl;
+ if (cnt>1) {
+ CALCDIFF(visibleTabList,diff,i)
+ i--;
+ }
+ else {
+ //KILE_DEBUG()<<"placing line on old line"<<endl;
+ KILE_DEBUG()<<"diff="<<diff<<endl;
+ tab->removeEventFilter(this);
+ tab->move(NEARBYINT(tmp-tab->neededSize()),lines*24);
+// tab->setFixedWidth(tab->neededSize()+diff);
+ tab->setFixedWidth(NEARBYINT(tmp+diff)-tab->x());
+ tab->installEventFilter(this);
+ CALCDIFF(visibleTabList,diff,(i+1))
+
+ }
+ tmp=-diff;
+ cnt=0;
+ lines++;
+ //KILE_DEBUG()<<"starting new line:"<<lines<<endl;
+
+ } else {
+ //KILE_DEBUG()<<"Placing line on line:"<<lines<<" pos: (x/y)=("<<tmp-(*(visibleTabList.at(i)))->neededSize()<<"/"<<lines*24<<")"<<endl;
+ //KILE_DEBUG()<<"diff="<<diff<<endl;
+ tab->removeEventFilter(this);
+ tab->move(NEARBYINT(tmp-tab->neededSize()),lines*24);
+ tab->setFixedWidth(NEARBYINT(tmp+diff)-tab->x());
+
+ //tab->setFixedWidth(tab->neededSize()+diff);
+ tab->installEventFilter(this);
+
+ }
+ }
+ }
+ else {
+ setFixedWidth(lines*24);
+ box->setFixedWidth(lines*24);
+ m_lines=lines=width()/24;
+ lines=0;
+ CALCDIFF(visibleTabList,diff,0)
+ tmp=-diff;
+
+ for (uint i=0;i<tabCount;i++) {
+ KileMultiTabBarTab *tab=*(visibleTabList.at(i));
+ cnt++;
+ tmp+=tab->neededSize()+diff;
+ if (tmp>space) {
+ if (cnt>1) {
+ CALCDIFF(visibleTabList,diff,i);
+ tmp=-diff;
+ i--;
+ }
+ else {
+ tab->removeEventFilter(this);
+ tab->move(lines*24,NEARBYINT(tmp-tab->neededSize()));
+ tab->setFixedHeight(NEARBYINT(tmp+diff)-tab->y());
+ tab->installEventFilter(this);
+ }
+ cnt=0;
+ tmp=-diff;
+ lines++;
+ } else {
+ tab->removeEventFilter(this);
+ tab->move(lines*24,NEARBYINT(tmp-tab->neededSize()));
+ tab->setFixedHeight(NEARBYINT(tmp+diff)-tab->y());
+ tab->installEventFilter(this);
+ }
+ }
+ }
+
+
+ //KILE_DEBUG()<<"needed lines:"<<m_lines<<endl;
+ } else {
+
+ int size=0; /*move the calculation into another function and call it only on add tab and tab click events*/
+ for (QValueList<KileMultiTabBarTab*>::iterator i = visibleTabList.begin(); i != visibleTabList.end(); ++i) {
+ size += (m_barMode == KileMultiTabBar::Vertical ? (*i)->height() : (*i)->width());
+ }
+ if ((m_position==KileMultiTabBar::Bottom) || (m_position==KileMultiTabBar::Top))
+ box->setGeometry(0,0,size,height());
+ else box->setGeometry(0,0,width(),size);
+
+ }
+}
+
+
+void KileMultiTabBarInternal::showActiveTabTexts(bool show)
+{
+ m_showActiveTabTexts=show;
+}
+
+
+KileMultiTabBarTab* KileMultiTabBarInternal::tab(int id) const
+{
+ for (QPtrListIterator<KileMultiTabBarTab> it(m_tabs);it.current();++it){
+ if (it.current()->id()==id) return it.current();
+ }
+ return 0;
+}
+
+bool KileMultiTabBarInternal::eventFilter(QObject *, QEvent *e) {
+ if (e->type()==QEvent::Resize || e->type()==QEvent::Hide || e->type()==QEvent::Show) resizeEvent(0);
+ return false;
+}
+
+int KileMultiTabBarInternal::appendTab(const QPixmap &pic ,int id,const QString& text)
+{
+ KileMultiTabBarTab *tab;
+ m_tabs.append(tab= new KileMultiTabBarTab(pic,text,id,box,m_position,m_style));
+ tab->installEventFilter(this);
+ tab->showActiveTabText(m_showActiveTabTexts);
+
+ if (m_style==KileMultiTabBar::KONQSBC)
+ {
+ if (m_expandedTabSize<tab->neededSize()) {
+ m_expandedTabSize=tab->neededSize();
+ for (uint i=0;i<m_tabs.count();i++)
+ m_tabs.at(i)->setSize(m_expandedTabSize);
+
+ } else tab->setSize(m_expandedTabSize);
+ } else tab->updateState();
+ tab->show();
+ resizeEvent(0);
+ return 0;
+}
+
+void KileMultiTabBarInternal::removeTab(int id)
+{
+ for (uint pos=0;pos<m_tabs.count();pos++)
+ {
+ if (m_tabs.at(pos)->id()==id)
+ {
+ m_tabs.remove(pos);
+ resizeEvent(0);
+ break;
+ }
+ }
+}
+
+void KileMultiTabBarInternal::setPosition(enum KileMultiTabBar::KileMultiTabBarPosition pos)
+{
+ m_position=pos;
+ for (uint i=0;i<m_tabs.count();i++)
+ m_tabs.at(i)->setTabsPosition(m_position);
+ viewport()->repaint();
+}
+
+KileMultiTabBarButton::KileMultiTabBarButton(const QPixmap& pic,const QString& text, QPopupMenu *popup,
+ int id,QWidget *parent,KileMultiTabBar::KileMultiTabBarPosition pos,KileMultiTabBar::KileMultiTabBarStyle style)
+ :QPushButton(QIconSet(),text,parent),m_style(style)
+{
+ setIconSet(pic);
+ setText(text);
+ m_position=pos;
+ if (popup) setPopup(popup);
+ setFlat(true);
+ setFixedHeight(24);
+ setFixedWidth(24);
+ m_id=id;
+ QToolTip::add(this,text);
+ connect(this,SIGNAL(clicked()),this,SLOT(slotClicked()));
+}
+
+KileMultiTabBarButton::KileMultiTabBarButton(const QString& text, QPopupMenu *popup,
+ int id,QWidget *parent,KileMultiTabBar::KileMultiTabBarPosition pos,KileMultiTabBar::KileMultiTabBarStyle style)
+ :QPushButton(QIconSet(),text,parent),m_style(style)
+{
+ setText(text);
+ m_position=pos;
+ if (popup) setPopup(popup);
+ setFlat(true);
+ setFixedHeight(24);
+ setFixedWidth(24);
+ m_id=id;
+ QToolTip::add(this,text);
+ connect(this,SIGNAL(clicked()),this,SLOT(slotClicked()));
+}
+
+KileMultiTabBarButton::~KileMultiTabBarButton() {
+}
+
+int KileMultiTabBarButton::id() const{
+ return m_id;
+}
+
+void KileMultiTabBarButton::setText(const QString& text)
+{
+ QString s = text;
+ s = s.replace("&", QString()); // we do not allow accelerators to be set
+ // This is a little hack to avoid KAcceleratorManager
+ // provide us with accelerators as the class name of the
+ // widget is no longer KMultiTabBar.
+ QPushButton::setText(s);
+ m_text = s;
+ QToolTip::add(this,s);
+}
+
+void KileMultiTabBarButton::slotClicked()
+{
+ emit clicked(m_id);
+}
+
+void KileMultiTabBarButton::setPosition(KileMultiTabBar::KileMultiTabBarPosition pos)
+{
+ m_position=pos;
+ repaint();
+}
+
+void KileMultiTabBarButton::setStyle(KileMultiTabBar::KileMultiTabBarStyle style)
+{
+ m_style=style;
+ repaint();
+}
+
+void KileMultiTabBarButton::hideEvent( QHideEvent* he) {
+ QPushButton::hideEvent(he);
+ KileMultiTabBar *tb=dynamic_cast<KileMultiTabBar*>(parentWidget());
+ if (tb) tb->updateSeparator();
+}
+
+void KileMultiTabBarButton::showEvent( QShowEvent* he) {
+ QPushButton::showEvent(he);
+ KileMultiTabBar *tb=dynamic_cast<KileMultiTabBar*>(parentWidget());
+ if (tb) tb->updateSeparator();
+}
+
+
+QSize KileMultiTabBarButton::sizeHint() const
+{
+ constPolish();
+
+ int w = 0, h = 0;
+
+ // calculate contents size...
+#ifndef QT_NO_ICONSET
+ if ( iconSet() && !iconSet()->isNull() ) {
+ int iw = iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 4;
+ int ih = iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height();
+ w += iw;
+ h = QMAX( h, ih );
+ }
+#endif
+ if ( isMenuButton() )
+ w += style().pixelMetric(QStyle::PM_MenuButtonIndicator, this);
+
+ if ( pixmap() ) {
+ QPixmap *pm = (QPixmap *)pixmap();
+ w += pm->width();
+ h += pm->height();
+ } else {
+ QString s( text() );
+ bool empty = s.isEmpty();
+ if ( empty )
+ s = QString::fromLatin1("XXXX");
+ QFontMetrics fm = fontMetrics();
+ QSize sz = fm.size( ShowPrefix, s );
+ if(!empty || !w)
+ w += sz.width();
+ if(!empty || !h)
+ h = QMAX(h, sz.height());
+ }
+
+ return (style().sizeFromContents(QStyle::CT_ToolButton, this, QSize(w, h)).
+ expandedTo(QApplication::globalStrut()));
+}
+
+
+KileMultiTabBarTab::KileMultiTabBarTab(const QPixmap& pic, const QString& text,
+ int id,QWidget *parent,KileMultiTabBar::KileMultiTabBarPosition pos,
+ KileMultiTabBar::KileMultiTabBarStyle style)
+ :KileMultiTabBarButton(text,0,id,parent,pos,style),
+ m_showActiveTabText(false)
+{
+ d=new KileMultiTabBarTabPrivate();
+ setIcon(pic);
+ m_expandedSize=24;
+ setToggleButton(true);
+}
+
+KileMultiTabBarTab::~KileMultiTabBarTab() {
+ delete d;
+}
+
+
+void KileMultiTabBarTab::setTabsPosition(KileMultiTabBar::KileMultiTabBarPosition pos)
+{
+ if ((pos!=m_position) && ((pos==KileMultiTabBar::Left) || (pos==KileMultiTabBar::Right))) {
+ if (!d->pix.isNull()) {
+ QWMatrix temp;// (1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F);
+ temp.rotate(180);
+ d->pix=d->pix.xForm(temp);
+ setIconSet(d->pix);
+ }
+ }
+
+ setPosition(pos);
+// repaint();
+}
+
+void KileMultiTabBarTab::setIcon(const QString& icon)
+{
+ QPixmap pic=SmallIcon(icon);
+ setIcon(pic);
+}
+
+void KileMultiTabBarTab::setIcon(const QPixmap& icon)
+{
+
+ if (m_style!=KileMultiTabBar::KDEV3) {
+ if ((m_position==KileMultiTabBar::Left) || (m_position==KileMultiTabBar::Right)) {
+ QWMatrix rotateMatrix;
+ if (m_position==KileMultiTabBar::Left)
+ rotateMatrix.rotate(90);
+ else
+ rotateMatrix.rotate(-90);
+ QPixmap pic=icon.xForm(rotateMatrix); //TODO FIX THIS, THIS SHOWS WINDOW
+ d->pix=pic;
+ setIconSet(pic);
+ } else setIconSet(icon);
+ }
+}
+
+void KileMultiTabBarTab::slotClicked()
+{
+ updateState();
+ KileMultiTabBarButton::slotClicked();
+}
+
+void KileMultiTabBarTab::setState(bool b)
+{
+ setOn(b);
+ updateState();
+}
+
+void KileMultiTabBarTab::updateState()
+{
+ if (m_style!=KileMultiTabBar::KONQSBC) {
+ if ((m_style==KileMultiTabBar::KDEV3) || (m_style==KileMultiTabBar::KDEV3ICON) || (isOn())) {
+ QPushButton::setText(m_text);
+ } else {
+ KILE_DEBUG()<<"KileMultiTabBarTab::updateState(): setting text to an empty QString***************"<<endl;
+ QPushButton::setText(QString::null);
+ }
+
+ if ((m_position==KileMultiTabBar::Right || m_position==KileMultiTabBar::Left)) {
+ setFixedWidth(24);
+ if ((m_style==KileMultiTabBar::KDEV3) || (m_style==KileMultiTabBar::KDEV3ICON) || (isOn())) {
+ setFixedHeight(KileMultiTabBarButton::sizeHint().width());
+ } else setFixedHeight(36);
+ } else {
+ setFixedHeight(24);
+ if ((m_style==KileMultiTabBar::KDEV3) || (m_style==KileMultiTabBar::KDEV3ICON) || (isOn())) {
+ setFixedWidth(KileMultiTabBarButton::sizeHint().width());
+ } else setFixedWidth(36);
+ }
+ } else {
+ if ((!isOn()) || (!m_showActiveTabText))
+ {
+ setFixedWidth(24);
+ setFixedHeight(24);
+ return;
+ }
+ if ((m_position==KileMultiTabBar::Right || m_position==KileMultiTabBar::Left))
+ setFixedHeight(m_expandedSize);
+ else
+ setFixedWidth(m_expandedSize);
+ }
+// QApplication::sendPostedEvents(0,QEvent::Paint | QEvent::Move | QEvent::Resize | QEvent::LayoutHint);
+ QApplication::sendPostedEvents(0,QEvent::Paint);
+ QApplication::flush();
+}
+
+int KileMultiTabBarTab::neededSize()
+{
+ QString text = m_text;
+ text = text.replace(QRegExp("&(?=[^&])"), QString());
+ text = text.replace("&&", "&");
+ return (((m_style!=KileMultiTabBar::KDEV3)?24:0)+QFontMetrics(QFont()).width(text)+6);
+}
+
+void KileMultiTabBarTab::setSize(int size)
+{
+ m_expandedSize=size;
+ updateState();
+}
+
+void KileMultiTabBarTab::showActiveTabText(bool show)
+{
+ m_showActiveTabText=show;
+}
+
+void KileMultiTabBarTab::drawButtonLabel(QPainter *p) {
+ drawButton(p);
+}
+void KileMultiTabBarTab::drawButton(QPainter *paint)
+{
+ if (m_style!=KileMultiTabBar::KONQSBC) drawButtonStyled(paint);
+ else drawButtonClassic(paint);
+}
+
+void KileMultiTabBarTab::drawButtonStyled(QPainter *paint) {
+
+ QSize sh;
+ const int width = 36; // rotated
+ const int height = 24;
+ if ((m_style==KileMultiTabBar::KDEV3) || (m_style==KileMultiTabBar::KDEV3ICON) || (isOn())) {
+ if ((m_position==KileMultiTabBar::Left) || (m_position==KileMultiTabBar::Right))
+ sh=QSize(this->height(),this->width());//KileMultiTabBarButton::sizeHint();
+ else sh=QSize(this->width(),this->height());
+ }
+ else
+ sh=QSize(width,height);
+
+ QPixmap pixmap( sh.width(),height); ///,sh.height());
+ pixmap.fill(eraseColor());
+ QPainter painter(&pixmap);
+
+
+ QStyle::SFlags st=QStyle::Style_Default;
+
+ st|=QStyle::Style_Enabled;
+
+ if (isOn()) st|=QStyle::Style_On;
+
+ style().drawControl(QStyle::CE_PushButton,&painter,this, QRect(0,0,pixmap.width(),pixmap.height()), colorGroup(),st);
+ style().drawControl(QStyle::CE_PushButtonLabel,&painter,this, QRect(0,0,pixmap.width(),pixmap.height()), colorGroup(),st);
+
+ switch (m_position) {
+ case KileMultiTabBar::Left:
+ paint->rotate(-90);
+ paint->drawPixmap(1-pixmap.width(),0,pixmap);
+ break;
+ case KileMultiTabBar::Right:
+ paint->rotate(90);
+ paint->drawPixmap(0,1-pixmap.height(),pixmap);
+ break;
+
+ default:
+ paint->drawPixmap(0,0,pixmap);
+ break;
+ }
+// style().drawControl(QStyle::CE_PushButtonLabel,painter,this, QRect(0,0,pixmap.width(),pixmap.height()),
+// colorGroup(),QStyle::Style_Enabled);
+
+
+}
+
+void KileMultiTabBarTab::drawButtonClassic(QPainter *paint)
+{
+ QPixmap pixmap;
+ if ( iconSet())
+ pixmap = iconSet()->pixmap( QIconSet::Small, QIconSet::Normal );
+ paint->fillRect(0, 0, 24, 24, colorGroup().background());
+
+ if (!isOn())
+ {
+
+ if (m_position==KileMultiTabBar::Right)
+ {
+ paint->fillRect(0,0,21,21,QBrush(colorGroup().background()));
+
+ paint->setPen(colorGroup().background().dark(150));
+ paint->drawLine(0,22,23,22);
+
+ paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap);
+
+ paint->setPen(colorGroup().shadow());
+ paint->drawLine(0,0,0,23);
+ paint->setPen(colorGroup().background().dark(120));
+ paint->drawLine(1,0,1,23);
+
+ }
+ else
+ if ((m_position==KileMultiTabBar::Bottom) || (m_position==KileMultiTabBar::Top))
+ {
+ paint->fillRect(0,1,23,22,QBrush(colorGroup().background()));
+
+ paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap);
+
+ paint->setPen(colorGroup().background().dark(120));
+ paint->drawLine(23,0,23,23);
+
+
+ paint->setPen(colorGroup().light());
+ paint->drawLine(0,22,23,22);
+ paint->drawLine(0,23,23,23);
+ paint->setPen(colorGroup().shadow());
+ paint->drawLine(0,0,23,0);
+ paint->setPen(colorGroup().background().dark(120));
+ paint->drawLine(0,1,23,1);
+
+ }
+ else
+ {
+ paint->setPen(colorGroup().background().dark(120));
+ paint->drawLine(0,23,23,23);
+ paint->fillRect(0,0,23,21,QBrush(colorGroup().background()));
+ paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap);
+
+ paint->setPen(colorGroup().light());
+ paint->drawLine(23,0,23,23);
+ paint->drawLine(22,0,22,23);
+
+ paint->setPen(colorGroup().shadow());
+ paint->drawLine(0,0,0,23);
+
+ }
+
+
+ }
+ else
+ {
+ if (m_position==KileMultiTabBar::Right)
+ {
+ paint->setPen(colorGroup().shadow());
+ paint->drawLine(0,height()-1,23,height()-1);
+ paint->drawLine(0,height()-2,23,height()-2);
+ paint->drawLine(23,0,23,height()-1);
+ paint->drawLine(22,0,22,height()-1);
+ paint->fillRect(0,0,21,height()-3,QBrush(colorGroup().light()));
+ paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap);
+
+ if (m_showActiveTabText)
+ {
+ if (height()<25+4) return;
+
+ QPixmap tpixmap(height()-25-3, width()-2);
+ QPainter painter(&tpixmap);
+
+ painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),QBrush(colorGroup().light()));
+
+ painter.setPen(colorGroup().text());
+ painter.drawText(0,+width()/2+QFontMetrics(QFont()).height()/2,m_text);
+
+ paint->rotate(90);
+ KILE_DEBUG()<<"tpixmap.width:"<<tpixmap.width()<<endl;
+ paint->drawPixmap(25,-tpixmap.height()+1,tpixmap);
+ }
+
+ }
+ else
+ if (m_position==KileMultiTabBar::Top)
+ {
+ paint->fillRect(0,0,width()-1,23,QBrush(colorGroup().light()));
+ paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap);
+ if (m_showActiveTabText)
+ {
+ paint->setPen(colorGroup().text());
+ paint->drawText(25,height()/2+QFontMetrics(QFont()).height()/2,m_text);
+ }
+ }
+ else
+ if (m_position==KileMultiTabBar::Bottom)
+ {
+ paint->setPen(colorGroup().shadow());
+ paint->drawLine(0,23,width()-1,23);
+ paint->drawLine(0,22,width()-1,22);
+ paint->fillRect(0,0,width()-1,21,QBrush(colorGroup().light()));
+ paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap);
+ if (m_showActiveTabText)
+ {
+ paint->setPen(colorGroup().text());
+ paint->drawText(25,height()/2+QFontMetrics(QFont()).height()/2,m_text);
+ }
+
+ }
+ else
+ {
+
+
+ paint->setPen(colorGroup().shadow());
+ paint->drawLine(0,height()-1,23,height()-1);
+ paint->drawLine(0,height()-2,23,height()-2);
+ paint->fillRect(0,0,23,height()-3,QBrush(colorGroup().light()));
+ paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap);
+ if (m_showActiveTabText)
+ {
+
+ if (height()<25+4) return;
+
+ QPixmap tpixmap(height()-25-3, width()-2);
+ QPainter painter(&tpixmap);
+
+ painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),QBrush(colorGroup().light()));
+
+ painter.setPen(colorGroup().text());
+ painter.drawText(tpixmap.width()-QFontMetrics(QFont()).width(m_text),+width()/2+QFontMetrics(QFont()).height()/2,m_text);
+
+ paint->rotate(-90);
+ KILE_DEBUG()<<"tpixmap.width:"<<tpixmap.width()<<endl;
+
+ paint->drawPixmap(-24-tpixmap.width(),2,tpixmap);
+
+ }
+
+ }
+
+ }
+}
+
+
+
+
+
+
+
+KileMultiTabBar::KileMultiTabBar(KileMultiTabBarMode bm, QWidget *parent,const char *name):QWidget(parent,name)
+{
+ m_buttons.setAutoDelete(false);
+ if (bm==Vertical)
+ {
+ m_l=new QVBoxLayout(this);
+ setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding, true);
+// setFixedWidth(24);
+ }
+ else
+ {
+ m_l=new QHBoxLayout(this);
+ setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed, true);
+// setFixedHeight(24);
+ }
+ m_l->setMargin(0);
+ m_l->setAutoAdd(false);
+
+ m_internal=new KileMultiTabBarInternal(this,bm);
+ setPosition((bm==KileMultiTabBar::Vertical)?KileMultiTabBar::Right:KileMultiTabBar::Bottom);
+ setStyle(VSNET);
+ // setStyle(KDEV3);
+ //setStyle(KONQSBC);
+ m_l->insertWidget(0,m_internal);
+ m_l->insertWidget(0,m_btnTabSep=new QFrame(this));
+ m_btnTabSep->setFixedHeight(4);
+ m_btnTabSep->setFrameStyle(QFrame::Panel | QFrame::Sunken);
+ m_btnTabSep->setLineWidth(2);
+ m_btnTabSep->hide();
+
+ updateGeometry();
+}
+
+KileMultiTabBar::~KileMultiTabBar() {
+}
+
+/*int KileMultiTabBar::insertButton(QPixmap pic,int id ,const QString&)
+{
+ (new KToolbarButton(pic,id,m_internal))->show();
+ return 0;
+}*/
+
+int KileMultiTabBar::appendButton(const QPixmap &pic ,int id,QPopupMenu *popup,const QString&)
+{
+ KileMultiTabBarButton *btn;
+ m_buttons.append(btn= new KileMultiTabBarButton(pic,QString::null,
+ popup,id,this,m_position,m_internal->m_style));
+ m_l->insertWidget(0,btn);
+ btn->show();
+ m_btnTabSep->show();
+ return 0;
+}
+
+void KileMultiTabBar::updateSeparator() {
+ bool hideSep=true;
+ for (QPtrListIterator<KileMultiTabBarButton> it(m_buttons);it.current();++it){
+ if (it.current()->isVisibleTo(this)) {
+ hideSep=false;
+ break;
+ }
+ }
+ if (hideSep) m_btnTabSep->hide();
+ else m_btnTabSep->show();
+
+}
+
+int KileMultiTabBar::appendTab(const QPixmap &pic ,int id ,const QString& text)
+{
+ m_internal->appendTab(pic,id,text);
+ return 0;
+}
+
+KileMultiTabBarButton* KileMultiTabBar::button(int id) const
+{
+ for (QPtrListIterator<KileMultiTabBarButton> it(m_buttons);it.current();++it){
+ if (it.current()->id()==id) return it.current();
+ }
+ return 0;
+}
+
+KileMultiTabBarTab* KileMultiTabBar::tab(int id) const
+{
+ return m_internal->tab(id);
+}
+
+
+
+void KileMultiTabBar::removeButton(int id)
+{
+ for (uint pos=0;pos<m_buttons.count();pos++)
+ {
+ if (m_buttons.at(pos)->id()==id)
+ {
+ m_buttons.take(pos)->deleteLater();
+ break;
+ }
+ }
+ if (m_buttons.count()==0) m_btnTabSep->hide();
+}
+
+void KileMultiTabBar::removeTab(int id)
+{
+ m_internal->removeTab(id);
+}
+
+void KileMultiTabBar::setTab(int id,bool state)
+{
+ KileMultiTabBarTab *ttab=tab(id);
+ if (ttab)
+ {
+ ttab->setState(state);
+ }
+}
+
+bool KileMultiTabBar::isTabRaised(int id) const
+{
+ KileMultiTabBarTab *ttab=tab(id);
+ if (ttab)
+ {
+ return ttab->isOn();
+ }
+
+ return false;
+}
+
+
+void KileMultiTabBar::showActiveTabTexts(bool show)
+{
+ m_internal->showActiveTabTexts(show);
+}
+
+void KileMultiTabBar::setStyle(KileMultiTabBarStyle style)
+{
+ m_internal->setStyle(style);
+}
+
+KileMultiTabBar::KileMultiTabBarStyle KileMultiTabBar::tabStyle() const
+{
+ return m_internal->m_style;
+}
+
+void KileMultiTabBar::setPosition(KileMultiTabBarPosition pos)
+{
+ m_position=pos;
+ m_internal->setPosition(pos);
+ for (uint i=0;i<m_buttons.count();i++)
+ m_buttons.at(i)->setPosition(pos);
+}
+
+KileMultiTabBar::KileMultiTabBarPosition KileMultiTabBar::position() const
+{
+ return m_position;
+}
+void KileMultiTabBar::fontChange(const QFont& /* oldFont */)
+{
+ for (uint i=0;i<tabs()->count();i++)
+ tabs()->at(i)->resize();
+ repaint();
+}
+
+QPtrList<KileMultiTabBarTab>* KileMultiTabBar::tabs() {return m_internal->tabs();}
+QPtrList<KileMultiTabBarButton>* KileMultiTabBar::buttons() {return &m_buttons;}
+
diff --git a/src/kile/kilemultitabbar.h b/src/kile/kilemultitabbar.h
new file mode 100644
index 0000000..4487542
--- /dev/null
+++ b/src/kile/kilemultitabbar.h
@@ -0,0 +1,316 @@
+/***************************************************************************
+ kilemultitabbar.h - description
+ -------------------
+ begin : 2001
+ copyright : (C) 2001,2002,2003 by Joseph Wenninger <jowenn@kde.org>
+ ***************************************************************************/
+
+/***************************************************************************
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ ***************************************************************************/
+
+//FIXME: remove for the KDE4 version again
+
+#ifndef _KileMultitabbar_h_
+#define _KileMultitabbar_h_
+
+#include <qscrollview.h>
+#include <qvbox.h>
+#include <qhbox.h>
+#include <qlayout.h>
+#include <qstring.h>
+#include <qptrlist.h>
+#include <qpushbutton.h>
+
+class QPixmap;
+class QPainter;
+class QFrame;
+
+class KileMultiTabBarPrivate;
+class KileMultiTabBarTabPrivate;
+class KileMultiTabBarButtonPrivate;
+class KileMultiTabBarInternal;
+
+/**
+ * @ingroup main
+ * @ingroup multitabbar
+ * A Widget for horizontal and vertical tabs.
+ * It is possible to add normal buttons to the top/left
+ * The handling if only one tab at a time or multiple tabs
+ * should be raisable is left to the "user".
+ *@author Joseph Wenninger
+ */
+class KileMultiTabBar: public QWidget
+{
+ Q_OBJECT
+public:
+ /**
+ * The tab bar's orientation. Also constraints the bar's position.
+ */
+ enum KileMultiTabBarMode {
+ Horizontal, ///< Horizontal orientation (i.e. on top or bottom)
+ Vertical ///< Vertical orientation (i.e. on the left or right hand side)
+ };
+
+ /**
+ * The tab bar's position
+ */
+ enum KileMultiTabBarPosition {
+ Left, ///< Left hand side
+ Right, ///< Right hand side
+ Top, ///< On top
+ Bottom ///< On bottom
+ };
+
+ /**
+ * The list of available styles for KileMultiTabBar
+ */
+ enum KileMultiTabBarStyle {
+ VSNET=0, ///< Visual Studio .Net like (only show the text of active tabs)
+ KDEV3=1, ///< KDevelop 3 like (always show the text)
+ KONQSBC=2, ///< Konqueror's classic sidebar style (unthemed) (currently disabled)
+ KDEV3ICON=3, ///< KDevelop 3 like with icons
+ STYLELAST=0xffff ///< Last style
+ };
+
+ /**
+ * Constructor.
+ * @param bm The tab bar's orientation
+ * @param parent The parent widget
+ * @param name The widget's name
+ */
+ KileMultiTabBar(KileMultiTabBarMode bm,QWidget *parent=0,const char *name=0);
+
+ /**
+ * Destructor.
+ */
+ virtual ~KileMultiTabBar();
+
+ /**
+ * append a new button to the button area. The button can later on be accessed with button(ID)
+ * eg for connecting signals to it
+ * @param pic a pixmap for the button
+ * @param id an arbitraty ID value. It will be emitted in the clicked signal for identifying the button
+ * if more than one button is connected to a signals.
+ * @param popup A popup menu which should be displayed if the button is clicked
+ * @param not_used_yet will be used for a popup text in the future
+ */
+ int appendButton(const QPixmap &pic,int id=-1,QPopupMenu* popup=0,const QString& not_used_yet=QString::null);
+ /**
+ * remove a button with the given ID
+ */
+ void removeButton(int id);
+ /**
+ * append a new tab to the tab area. It can be accessed lateron with tabb(id);
+ * @param pic a bitmap for the tab
+ * @param id an arbitrary ID which can be used later on to identify the tab
+ * @param text if a mode with text is used it will be the tab text, otherwise a mouse over hint
+ * @return Always zero. Can be safely ignored.
+ */
+ int appendTab(const QPixmap &pic,int id=-1,const QString& text=QString::null);
+ /**
+ * remove a tab with a given ID
+ * @param id The ID of the tab to remove
+ */
+ void removeTab(int id);
+ /**
+ * set a tab to "raised"
+ * @param id The ID of the tab to manipulate
+ * @param state true == activated/raised, false == not active
+ */
+ void setTab(int id ,bool state);
+ /**
+ * return the state of a tab, identified by it's ID
+ * @param id The ID of the tab to raise
+ */
+ bool isTabRaised(int id) const;
+ /**
+ * get a pointer to a button within the button area identified by its ID
+ * @param id The id of the tab
+ */
+ class KileMultiTabBarButton *button(int id) const;
+
+ /**
+ * get a pointer to a tab within the tab area, identified by its ID
+ */
+ class KileMultiTabBarTab *tab(int id) const;
+ /**
+ * set the real position of the widget.
+ * @param pos if the mode is horizontal, only use top, bottom, if it is vertical use left or right
+ */
+ void setPosition(KileMultiTabBarPosition pos);
+ /**
+ * get the tabbar position.
+ * @return The tab bar's position
+ */
+ KileMultiTabBarPosition position() const;
+ /**
+ * set the display style of the tabs
+ * @param style The new display style
+ */
+ void setStyle(KileMultiTabBarStyle style);
+ /**
+ * get the display style of the tabs
+ * @return display style
+ */
+ KileMultiTabBarStyle tabStyle() const;
+ /**
+ * Returns the list of pointers to the tabs of type KileMultiTabBarTab.
+ * @return The list of tabs.
+ * @warning be careful, don't delete tabs yourself and don't delete the list itself
+ */
+ QPtrList<KileMultiTabBarTab>* tabs();
+ /**
+ * Returns the list of pointers to the tab buttons of type KileMultiTabBarButton.
+ * @return The list of tab buttons.
+ * @warning be careful, don't delete buttons yourself and don't delete the list itself
+ */
+ QPtrList<KileMultiTabBarButton>* buttons();
+
+ /**
+ * might vanish, not sure yet
+ */
+ void showActiveTabTexts(bool show=true);
+protected:
+ friend class KileMultiTabBarButton;
+ virtual void fontChange( const QFont& );
+ void updateSeparator();
+private:
+ class KileMultiTabBarInternal *m_internal;
+ QBoxLayout *m_l;
+ QFrame *m_btnTabSep;
+ QPtrList<KileMultiTabBarButton> m_buttons;
+ KileMultiTabBarPosition m_position;
+ KileMultiTabBarPrivate *d;
+};
+
+/**
+ * @ingroup multitabbar
+ * This class represents a tab bar button in a KileMultiTabBarWidget.
+ * This class should never be created except with the appendButton call of KileMultiTabBar
+ */
+class KileMultiTabBarButton: public QPushButton
+{
+ Q_OBJECT
+public:
+ /** @internal */
+ KileMultiTabBarButton(const QPixmap& pic,const QString&, QPopupMenu *popup,
+ int id,QWidget *parent, KileMultiTabBar::KileMultiTabBarPosition pos, KileMultiTabBar::KileMultiTabBarStyle style);
+ /** @internal */
+ KileMultiTabBarButton(const QString&, QPopupMenu *popup,
+ int id,QWidget *parent, KileMultiTabBar::KileMultiTabBarPosition pos, KileMultiTabBar::KileMultiTabBarStyle style);
+ /**
+ * Destructor
+ */
+ virtual ~KileMultiTabBarButton();
+ /**
+ * Returns the tab's ID
+ * @return The tab's ID
+ */
+ int id() const;
+
+public slots:
+ /**
+ * this is used internaly, but can be used by the user, if (s)he wants to
+ * It the according call of KileMultiTabBar is invoked though this modifications will be overwritten
+ */
+ void setPosition(KileMultiTabBar::KileMultiTabBarPosition);
+ /**
+ * this is used internaly, but can be used by the user, if (s)he wants to
+ * It the according call of KileMultiTabBar is invoked though this modifications will be overwritten
+ */
+ void setStyle(KileMultiTabBar::KileMultiTabBarStyle);
+
+ /**
+ * modify the text of the button
+ */
+ void setText(const QString &);
+
+ QSize sizeHint() const;
+
+protected:
+ KileMultiTabBar::KileMultiTabBarPosition m_position;
+ KileMultiTabBar::KileMultiTabBarStyle m_style;
+ QString m_text;
+ virtual void hideEvent( class QHideEvent*);
+ virtual void showEvent( class QShowEvent*);
+private:
+ int m_id;
+ KileMultiTabBarButtonPrivate *d;
+signals:
+ /**
+ * this is emitted if the button is clicked
+ * @param id the ID identifying the button
+ */
+ void clicked(int id);
+protected slots:
+ virtual void slotClicked();
+};
+
+/**
+ * @ingroup multitabbar
+ * This class represents a tab bar's tab in a KileMultiTabBarWidget.
+ * This class should never be created except with the appendTab call of KileMultiTabBar
+ */
+class KileMultiTabBarTab: public KileMultiTabBarButton
+{
+ Q_OBJECT
+public:
+ /** @internal */
+ KileMultiTabBarTab(const QPixmap& pic,const QString&,int id,QWidget *parent,
+ KileMultiTabBar::KileMultiTabBarPosition pos,KileMultiTabBar::KileMultiTabBarStyle style);
+ /**
+ * Destructor.
+ */
+ virtual ~KileMultiTabBarTab();
+ /**
+ * set the active state of the tab
+ * @param state @c true if the tab should become active, @c false otherwise
+ */
+ void setState(bool state);
+ /**
+ * choose if the text should always be displayed
+ * this is only used in classic mode if at all
+ * @param show Whether or not to show the text
+ */
+ void showActiveTabText(bool show);
+ /**
+ * Resized the tab to the needed size.
+ */
+ void resize(){ setSize( neededSize() ); }
+private:
+ bool m_showActiveTabText;
+ int m_expandedSize;
+ KileMultiTabBarTabPrivate *d;
+protected:
+ friend class KileMultiTabBarInternal;
+ void setSize(int);
+ int neededSize();
+ void updateState();
+ virtual void drawButton(QPainter *);
+ virtual void drawButtonLabel(QPainter *);
+ void drawButtonStyled(QPainter *);
+ void drawButtonClassic(QPainter *);
+protected slots:
+ virtual void slotClicked();
+ void setTabsPosition(KileMultiTabBar::KileMultiTabBarPosition);
+
+public slots:
+ virtual void setIcon(const QString&);
+ virtual void setIcon(const QPixmap&);
+};
+
+#endif
diff --git a/src/kile/kilemultitabbar_p.h b/src/kile/kilemultitabbar_p.h
new file mode 100644
index 0000000..8cefad2
--- /dev/null
+++ b/src/kile/kilemultitabbar_p.h
@@ -0,0 +1,69 @@
+/***************************************************************************
+ kilemultitabbar_p.h - description
+ -------------------
+ begin : 2003
+ copyright : (C) 2003 by Joseph Wenninger <jowenn@kde.org>
+ ***************************************************************************/
+
+/***************************************************************************
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ ***************************************************************************/
+
+//FIXME: remove for the KDE4 version again
+
+#ifndef KILE_MULTI_TAB_BAR_P_H
+#define KILE_MULTI_TAB_BAR_P_H
+#include <qscrollview.h>
+#include <kmultitabbar.h>
+
+class KileMultiTabBarInternal: public QScrollView
+{
+ Q_OBJECT
+public:
+ KileMultiTabBarInternal(QWidget *parent,KileMultiTabBar::KileMultiTabBarMode bm);
+ int appendTab(const QPixmap &,int=-1,const QString& =QString::null);
+ KileMultiTabBarTab *tab(int) const;
+ void removeTab(int);
+ void setPosition(enum KileMultiTabBar::KileMultiTabBarPosition pos);
+ void setStyle(enum KileMultiTabBar::KileMultiTabBarStyle style);
+ void showActiveTabTexts(bool show);
+ QPtrList<KileMultiTabBarTab>* tabs(){return &m_tabs;}
+private:
+ friend class KileMultiTabBar;
+ QWidget *box;
+ QBoxLayout *mainLayout;
+ QPtrList<KileMultiTabBarTab> m_tabs;
+ enum KileMultiTabBar::KileMultiTabBarPosition m_position;
+ bool m_showActiveTabTexts;
+ enum KileMultiTabBar::KileMultiTabBarStyle m_style;
+ int m_expandedTabSize;
+ int m_lines;
+ KileMultiTabBar::KileMultiTabBarMode m_barMode;
+protected:
+ virtual bool eventFilter(QObject *,QEvent*);
+ virtual void drawContents ( QPainter *, int, int, int, int);
+
+ /**
+ * [contentsM|m]ousePressEvent are reimplemented from QScrollView
+ * in order to ignore all mouseEvents on the viewport, so that the
+ * parent can handle them.
+ */
+ virtual void contentsMousePressEvent(QMouseEvent *);
+ virtual void mousePressEvent(QMouseEvent *);
+ virtual void resizeEvent(QResizeEvent *);
+};
+#endif
+
diff --git a/src/kile/kileoutputwidget.cpp b/src/kile/kileoutputwidget.cpp
new file mode 100644
index 0000000..f30b45e
--- /dev/null
+++ b/src/kile/kileoutputwidget.cpp
@@ -0,0 +1,50 @@
+/***************************************************************************
+ begin : Sun Dec 21 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ****************************************************************************/
+
+#include "kileoutputwidget.h"
+#include "kiledebug.h"
+
+namespace KileWidget
+{
+ Output::Output(QWidget *parent, const char * name) : KTextEdit(parent, name)
+ {
+ setTextFormat(Qt::LogText);
+ }
+
+ Output::~Output()
+ {}
+
+ void Output::receive(const QString & str)
+ {
+ static QString line = "";
+
+ //find newline symbol
+ //only output if we have receive one or more
+ //full lines of text
+ int newLineAt = str.findRev('\n');
+ if ( newLineAt != -1 )
+ {
+ line += str.left(newLineAt); //don't copy the newline char
+ line.replace('<',"&lt;");
+ line.replace('>',"&gt;");
+ append(line);
+ line = str.mid(newLineAt + 1);
+ }
+ else
+ line += str;
+ }
+}
+
+#include "kileoutputwidget.moc"
diff --git a/src/kile/kileoutputwidget.h b/src/kile/kileoutputwidget.h
new file mode 100644
index 0000000..a77a37a
--- /dev/null
+++ b/src/kile/kileoutputwidget.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+ begin : Sun Dec 21 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ****************************************************************************/
+#ifndef KILEWIDGET_OUTPUTMSG_H
+#define KILEWIDGET_OUTPUTMSG_H
+
+#include <ktextedit.h>
+
+namespace KileWidget
+{
+ class Output : public KTextEdit
+ {
+ Q_OBJECT
+
+ public:
+ Output(QWidget *parent, const char *name=0);
+ ~Output();
+
+ void setReadOnly(bool r) { QTextEdit::setReadOnly(r); } //we don't want the greyed background
+
+ public slots:
+ void receive(const QString &);
+ };
+}
+
+#endif
diff --git a/src/kile/kileproject.cpp b/src/kile/kileproject.cpp
new file mode 100644
index 0000000..2cb2395
--- /dev/null
+++ b/src/kile/kileproject.cpp
@@ -0,0 +1,813 @@
+/***************************************************************************
+ begin : Fri Aug 1 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ : (C) 2007 by Holger Danielsson
+ email : Jeroen.Wijnhout@kdemail.net
+ holger.danielsson@versanet.de
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// 2007-03-12 dani
+// - use KileDocument::Extensions
+// - allowed extensions are always defined as list, f.e.: .tex .ltx .latex
+
+#include "kileproject.h"
+#include "kileversion.h"
+
+#include <qstringlist.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+
+#include <ksimpleconfig.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include "kiledebug.h"
+#include <kmessagebox.h>
+
+#include "kiledocumentinfo.h"
+#include "kiledocmanager.h"
+#include "kiletoolmanager.h"
+#include "kileinfo.h"
+#include "kileextensions.h"
+#include <krun.h>
+/*
+ 01/24/06 tbraun
+ Added the logic to get versioned kilepr files
+ We also warn if the user wants to open a project file with a different kileprversion
+*/
+
+
+/*
+ * KileProjectItem
+ */
+KileProjectItem::KileProjectItem(KileProject *project, const KURL & url, int type) :
+ m_project(project),
+ m_url(url),
+ m_type(type),
+ m_docinfo(0L),
+ m_parent(0L),
+ m_child(0L),
+ m_sibling(0L),
+ m_nLine(0),
+ m_order(-1)
+{
+ m_highlight=m_encoding=QString::null;
+ m_bOpen = m_archive = true;
+
+ if (project)
+ project->add(this);
+}
+
+void KileProjectItem::setOrder(int i)
+{
+ m_order = i;
+}
+
+void KileProjectItem::setParent(KileProjectItem * item)
+{
+ m_parent = item;
+
+ //update parent info
+ if (m_parent)
+ {
+ if (m_parent->firstChild())
+ {
+ //get last child
+ KileProjectItem *sib = m_parent->firstChild();
+ while (sib->sibling())
+ sib = sib->sibling();
+
+ sib->setSibling(this);
+ }
+ else
+ m_parent->setChild(this);
+ }
+ else
+ {
+ setChild(0);
+ setSibling(0);
+ }
+}
+
+void KileProjectItem::print(int level)
+{
+ QString str;
+ str.fill('\t', level);
+ KILE_DEBUG() << str << "+" << url().fileName() << endl;
+
+ if (firstChild())
+ firstChild()->print(++level);
+
+ if (sibling())
+ sibling()->print(level);
+}
+
+void KileProjectItem::allChildren(QPtrList<KileProjectItem> *list) const
+{
+ KileProjectItem *item = firstChild();
+
+// KILE_DEBUG() << "\tKileProjectItem::allChildren(" << list->count() << ")" << endl;
+ while(item != 0)
+ {
+ list->append(item);
+// KILE_DEBUG() << "\t\tappending " << item->url().fileName() << endl;
+ item->allChildren(list);
+ item = item->sibling();
+ }
+}
+
+void KileProjectItem::setInfo(KileDocument::TextInfo *docinfo)
+{
+ m_docinfo = docinfo;
+ if(docinfo)
+ {
+ connect(docinfo,SIGNAL(urlChanged(KileDocument::Info*, const KURL &)), this, SLOT(slotChangeURL(KileDocument::Info*, const KURL &)));
+ connect(docinfo,SIGNAL(depChanged()), m_project, SLOT(buildProjectTree()));
+ }
+}
+
+void KileProjectItem::changeURL(const KURL &url)
+{
+ // don't allow empty URLs
+ if(!url.isEmpty() && m_url != url)
+ {
+ m_url = url;
+ emit(urlChanged(this));
+ }
+}
+
+void KileProjectItem::slotChangeURL(KileDocument::Info*, const KURL &url)
+{
+ changeURL(url);
+}
+
+/*
+ * KileProject
+ */
+KileProject::KileProject(const QString& name, const KURL& url, KileDocument::Extensions *extensions) : QObject(0,name.ascii()), m_invalid(false), m_masterDocument(QString::null), m_useMakeIndexOptions(false)
+{
+ init(name, url, extensions);
+}
+
+KileProject::KileProject(const KURL& url, KileDocument::Extensions *extensions) : QObject(0,url.fileName().ascii()), m_invalid(false), m_masterDocument(QString::null), m_useMakeIndexOptions(false)
+{
+ init(url.fileName(), url, extensions);
+}
+
+KileProject::~KileProject()
+{
+ KILE_DEBUG() << "DELETING KILEPROJECT " << m_projecturl.url() << endl;
+ delete m_config;
+}
+
+void KileProject::init(const QString& name, const KURL& url, KileDocument::Extensions *extensions)
+{
+ m_name = name;
+ m_projecturl = KileDocument::Manager::symlinkFreeURL( url);;
+
+ m_projectitems.setAutoDelete(true);
+
+ m_config = new KSimpleConfig(m_projecturl.path());
+ m_extmanager = extensions;
+
+ m_baseurl = m_projecturl.directory();
+ m_baseurl.cleanPath(true);
+
+ KILE_DEBUG() << "KileProject m_baseurl = " << m_baseurl.path() << endl;
+
+ if (QFileInfo(url.path()).exists())
+ {
+ load();
+ }
+ else
+ {
+ //create the project file
+ m_config->setGroup("General");
+ m_config->writeEntry("name", m_name);
+ m_config->writeEntry("kileprversion", kilePrVersion);
+ m_config->writeEntry("kileversion", kileVersion);
+ m_config->sync();
+ }
+}
+
+void KileProject::setLastDocument(const KURL &url)
+{
+ if ( item(url) != 0 )
+ m_lastDocument = KileDocument::Manager::symlinkFreeURL(url);
+}
+
+void KileProject::setExtensions(KileProjectItem::Type type, const QString & ext)
+{
+ if (type<KileProjectItem::Source || type>KileProjectItem::Image)
+ {
+ kdWarning() << "ERROR: TYPE<1 or TYPE>3" << endl;
+ return;
+ }
+
+ // first we take all standard extensions
+ QStringList standardExtList;
+ if ( type == KileProjectItem::Source )
+ standardExtList = QStringList::split(" ", m_extmanager->latexDocuments() );
+ else if ( type == KileProjectItem::Package )
+ standardExtList = QStringList::split(" ", m_extmanager->latexPackages() );
+ else // if ( type == KileProjectItem::Image )
+ standardExtList = QStringList::split(" ", m_extmanager->images() );
+
+ // now we scan user defined list and accept all extension,
+ // except standard extensions of course
+ QString userExt;
+ if ( ! ext.isEmpty() )
+ {
+ QStringList userExtList;
+
+ QStringList::ConstIterator it;
+ QStringList list = QStringList::split(" ", ext);
+ for ( it=list.begin(); it != list.end(); ++it )
+ {
+ // some tiny extension checks
+ if ( (*it).length()<2 || (*it)[0]!='.' )
+ continue;
+
+ // some of the old definitions are wrong, so we test them all
+ if ( type==KileProjectItem::Source || type==KileProjectItem::Package)
+ {
+ if ( ! (m_extmanager->isLatexDocument(*it) || m_extmanager->isLatexPackage(*it)) )
+ {
+ standardExtList << (*it);
+ userExtList << (*it);
+ }
+ }
+ else // if ( type == KileProjectItem::Image )
+ {
+ if ( ! m_extmanager->isImage(*it) )
+ {
+ standardExtList << (*it);
+ userExtList << (*it);
+ }
+ }
+ }
+ if ( userExtList.count() > 0 )
+ userExt = userExtList.join(" ");
+ }
+
+ // now we build a regular expression for all extensions
+ // (used to search for a filename with a valid extension)
+ QString pattern = standardExtList.join("|");
+ pattern.replace(".","\\.");
+ pattern = '('+ pattern +")$";
+
+ // and save it
+ m_reExtensions[type-1].setPattern(pattern);
+
+ // if the list of user defined extensions has changed
+ // we save the new value and (re)build the project tree
+ if (m_extensions[type-1] != userExt)
+ {
+ m_extensions[type-1] = userExt;
+ buildProjectTree();
+ }
+}
+
+void KileProject::setType(KileProjectItem *item)
+{
+ if ( item->path().right(7) == ".kilepr" )
+ {
+ item->setType(KileProjectItem::ProjectFile);
+ return;
+ }
+
+ bool unknown = true;
+ for (int i = KileProjectItem::Source; i < KileProjectItem::Other; ++i)
+ {
+ if ( m_reExtensions[i-1].search(item->url().fileName()) != -1)
+ {
+ item->setType(i);
+ unknown = false;
+ break;
+ }
+ }
+
+ if (unknown)
+ item->setType(KileProjectItem::Other);
+}
+
+void KileProject::readMakeIndexOptions()
+{
+ QString grp = KileTool::groupFor("MakeIndex", m_config);
+
+ //get the default value
+ KConfig *cfg = KGlobal::config();
+ cfg->setGroup(KileTool::groupFor("MakeIndex", KileTool::configName("MakeIndex", cfg)));
+ QString deflt = cfg->readEntry("options", "'%S'.idx");
+
+ if ( useMakeIndexOptions() && !grp.isEmpty() )
+ {
+ m_config->setGroup(grp);
+ QString val = m_config->readEntry("options", deflt);
+ if ( val.isEmpty() ) val = deflt;
+ setMakeIndexOptions(val);
+ }
+ else //use default value
+ setMakeIndexOptions(deflt);
+}
+
+void KileProject::writeUseMakeIndexOptions()
+{
+ if ( useMakeIndexOptions() )
+ KileTool::setConfigName("MakeIndex", "Default", m_config);
+ else
+ KileTool::setConfigName("MakeIndex", "", m_config);
+}
+
+QString KileProject::addBaseURL(const QString &path)
+{
+ KILE_DEBUG() << "===addBaseURL(const QString & " << path << " )" << endl;
+ if ( path.isEmpty())
+ return path;
+ else if ( path.startsWith("/") )
+ return KileDocument::Manager::symlinkFreeURL(KURL::fromPathOrURL(path)).path();
+ else
+ return KileDocument::Manager::symlinkFreeURL(KURL::fromPathOrURL(m_baseurl.path() + '/' +path)).path();
+ }
+
+QString KileProject::removeBaseURL(const QString &path)
+{
+
+ if ( path.startsWith("/") )
+ {
+ QFileInfo info(path);
+ QString relPath = findRelativePath(path);
+ KILE_DEBUG() << "removeBaseURL path is" << path << " , relPath is " << relPath << endl;
+ return relPath;
+ }
+ else
+ {
+ return path;
+ }
+}
+
+bool KileProject::load()
+{
+ KILE_DEBUG() << "KileProject: loading..." <<endl;
+
+ //load general settings/options
+ m_config->setGroup("General");
+ m_name = m_config->readEntry("name", i18n("Project"));
+ m_kileversion = m_config->readEntry("kileversion",QString::null);
+ m_kileprversion = m_config->readEntry("kileprversion",QString::null);
+
+ if(!m_kileprversion.isNull() && m_kileprversion.toInt() > kilePrVersion.toInt())
+ {
+ if(KMessageBox::warningYesNo(0L,i18n("The project file of %1 was created by a newer version of kile.\
+ Opening it can lead to unexpected results.\n\
+ Do you really want to continue (not recommended)?").arg(m_name),
+ QString::null, KStdGuiItem::yes(), KStdGuiItem::no(),QString::null,KMessageBox::Dangerous) == KMessageBox::No)
+ {
+ m_invalid=true;
+ return false;
+ }
+ }
+
+ QString master = addBaseURL(m_config->readEntry("masterDocument", QString::null));
+ KILE_DEBUG() << "masterDoc == " << master << endl;
+ setMasterDocument(master);
+
+ setExtensions(KileProjectItem::Source, m_config->readEntry("src_extensions",m_extmanager->latexDocuments()));
+ setExtensions(KileProjectItem::Package, m_config->readEntry("pkg_extensions",m_extmanager->latexPackages()));
+ setExtensions(KileProjectItem::Image, m_config->readEntry("img_extensions",m_extmanager->images()));
+
+ setQuickBuildConfig(KileTool::configName("QuickBuild", m_config));
+
+ if( KileTool::configName("MakeIndex",m_config).compare("Default") == 0)
+ setUseMakeIndexOptions(true);
+ else
+ setUseMakeIndexOptions(false);
+
+ readMakeIndexOptions();
+
+ KURL url;
+ KileProjectItem *item;
+ QStringList groups = m_config->groupList();
+
+ //retrieve all the project files and create and initialize project items for them
+ for (uint i=0; i < groups.count(); ++i)
+ {
+ if (groups[i].left(5) == "item:")
+ {
+ QString path = groups[i].mid(5);
+ if (path[0] == '/' )
+ {
+ url = KURL::fromPathOrURL(path);
+ }
+ else
+ {
+ url = m_baseurl;
+ url.addPath(path);
+ url.cleanPath(true);
+ }
+ item = new KileProjectItem(this, KileDocument::Manager::symlinkFreeURL(url));
+ setType(item);
+
+ m_config->setGroup(groups[i]);
+ item->setOpenState(m_config->readBoolEntry("open", true));
+ item->setEncoding(m_config->readEntry("encoding", QString::null));
+ item->setHighlight(m_config->readEntry("highlight",QString::null));
+ item->setArchive(m_config->readBoolEntry("archive", true));
+ item->setLineNumber(m_config->readNumEntry("line", 0));
+ item->setColumnNumber(m_config->readNumEntry("column", 0));
+ item->setOrder(m_config->readNumEntry("order", -1));
+ item->changePath(groups[i].mid(5));
+
+ connect(item, SIGNAL(urlChanged(KileProjectItem*)), this, SLOT(itemRenamed(KileProjectItem*)) );
+ }
+ }
+
+ // only call this after all items are created, otherwise setLastDocument doesn't accept the url
+ m_config->setGroup("General");
+ setLastDocument(KURL::fromPathOrURL(addBaseURL(m_config->readEntry("lastDocument", QString::null))));
+
+// dump();
+
+ return true;
+}
+
+bool KileProject::save()
+{
+ KILE_DEBUG() << "KileProject: saving..." <<endl;
+
+ m_config->setGroup("General");
+ m_config->writeEntry("name", m_name);
+ m_config->writeEntry("kileprversion", kilePrVersion);
+ m_config->writeEntry("kileversion", kileVersion);
+
+ KILE_DEBUG() << "KileProject::save() masterDoc = " << removeBaseURL(m_masterDocument) << endl;
+ m_config->writeEntry("masterDocument", removeBaseURL(m_masterDocument));
+ m_config->writeEntry("lastDocument", removeBaseURL(m_lastDocument.path()));
+
+
+ writeConfigEntry("src_extensions",m_extmanager->latexDocuments(),KileProjectItem::Source);
+ writeConfigEntry("pkg_extensions",m_extmanager->latexPackages(),KileProjectItem::Package);
+ writeConfigEntry("img_extensions",m_extmanager->images(),KileProjectItem::Image);
+ // only to avoid problems with older versions
+ m_config->writeEntry("src_extIsRegExp", false);
+ m_config->writeEntry("pkg_extIsRegExp", false);
+ m_config->writeEntry("img_extIsRegExp", false);
+
+ KileProjectItem *item;
+ for (uint i=0; i < m_projectitems.count(); ++i)
+ {
+ item = m_projectitems.at(i);
+ m_config->setGroup("item:"+item->path());
+ m_config->writeEntry("open", item->isOpen());
+ m_config->writeEntry("encoding", item->encoding());
+ m_config->writeEntry("highlight", item->highlight());
+ m_config->writeEntry("archive", item->archive());
+ m_config->writeEntry("line", item->lineNumber());
+ m_config->writeEntry("column", item->columnNumber());
+ m_config->writeEntry("order", item->order());
+ }
+
+ KileTool::setConfigName("QuickBuild", quickBuildConfig(), m_config);
+
+ writeUseMakeIndexOptions();
+ if ( useMakeIndexOptions() )
+ {
+
+ QString grp = KileTool::groupFor("MakeIndex", m_config);
+ if ( grp.isEmpty() ) grp = "Default";
+ m_config->setGroup(grp);
+ m_config->writeEntry("options", makeIndexOptions() );
+ }
+
+ m_config->sync();
+
+ // dump();
+
+ return true;
+}
+
+void KileProject::writeConfigEntry(const QString &key, const QString &standardExt, KileProjectItem::Type type)
+{
+ QString userExt = extensions(type);
+ if ( userExt.isEmpty() )
+ m_config->writeEntry(key,standardExt);
+ else
+ m_config->writeEntry(key,standardExt + ' ' + extensions(type));
+}
+
+void KileProject::buildProjectTree()
+{
+ KILE_DEBUG() << "==KileProject::buildProjectTree==========================" << endl;
+
+ //determine the parent doc for each item (TODO:an item can only have one parent, not necessarily true for LaTeX docs)
+
+ const QStringList *deps;
+ QString dep;
+ KileProjectItem *itm;
+ KURL url;
+ QPtrListIterator<KileProjectItem> it(m_projectitems);
+
+ //clean first
+ while (it.current())
+ {
+ (*it)->setParent(0);
+ ++it;
+ }
+
+ //use the dependencies list of the documentinfo object to determine the parent
+ it.toFirst();
+ while (it.current())
+ {
+ //set the type correctly (changing m_extensions causes a call to buildProjectTree)
+ setType(*it);
+
+ if ( (*it)->getInfo() )
+ {
+ deps = (*it)->getInfo()->dependencies();
+ for (uint i=0; i < deps->count(); ++i)
+ {
+ dep = (*deps)[i];
+
+ if( m_extmanager->isTexFile(dep) )
+ url = KileInfo::checkOtherPaths(m_baseurl,dep,KileInfo::texinputs);
+ else if( m_extmanager->isBibFile(dep) )
+ url = KileInfo::checkOtherPaths(m_baseurl,dep,KileInfo::bibinputs);
+
+ itm = item(url);
+ if (itm && (itm->parent() == 0))
+ itm->setParent(*it);
+ }
+ }
+
+ ++it;
+ }
+
+ //make a list of all the root items (items with parent == 0)
+ m_rootItems.clear();
+ it.toFirst();
+ while (it.current())
+ {
+ if ((*it)->parent() == 0) m_rootItems.append(*it);
+ ++it;
+ }
+
+ emit(projectTreeChanged(this));
+}
+
+KileProjectItem* KileProject::item(const KURL & url)
+{
+ QPtrListIterator<KileProjectItem> it(m_projectitems);
+ while (it.current())
+ {
+ if ((*it)->url() == url)
+ return *it;
+ ++it;
+ }
+
+ return 0;
+}
+
+KileProjectItem* KileProject::item(const KileDocument::Info *info)
+{
+ QPtrListIterator<KileProjectItem> it(m_projectitems);
+ KileProjectItem *current;
+ while ((current = it.current()) != 0)
+ {
+ ++it;
+ if (current->getInfo() == info)
+ {
+ return current;
+ }
+ }
+ return 0;
+}
+
+void KileProject::add(KileProjectItem* item)
+{
+ KILE_DEBUG() << "KileProject::add projectitem" << item->url().path() << endl;
+
+ setType(item);
+
+ item->changePath(findRelativePath(item->url()));
+ connect(item, SIGNAL(urlChanged(KileProjectItem*)), this, SLOT(itemRenamed(KileProjectItem*)) );
+
+ m_projectitems.append(item);
+
+ // dump();
+}
+
+void KileProject::remove(const KileProjectItem* item)
+{
+ if (m_config->hasGroup("item:"+item->path()))
+ m_config->deleteGroup("item:"+item->path());
+ else
+ kdWarning() << "KileProject::remove() Failed to delete the group corresponding to this item!!!" <<endl;
+
+ KILE_DEBUG() << "KileProject::remove" << endl;
+ m_projectitems.remove(item);
+
+ // dump();
+}
+
+void KileProject::itemRenamed(KileProjectItem *item)
+{
+ KILE_DEBUG() << "==KileProject::itemRenamed==========================" << endl;
+ KILE_DEBUG() << "\t" << item->url().fileName() << endl;
+ m_config->deleteGroup("item:"+item->path());
+ //config.sync();
+
+ item->changePath(findRelativePath(item->url()));
+}
+
+QString KileProject::findRelativePath(const KURL &url)
+{
+ QString basepath = m_baseurl.path();
+ QString path = url.directory();
+ QString filename = url.fileName();
+
+ KILE_DEBUG() <<"===findRelativeURL==================" << endl;
+ KILE_DEBUG() << "\tbasepath : " << basepath << " path: " << path << endl;
+
+// if ( basepath == path )
+// {
+// return "./";
+// }
+
+ QStringList basedirs = QStringList::split("/", basepath, false);
+ QStringList dirs = QStringList::split("/", path, false);
+
+ uint nDirs = dirs.count();
+ //uint nBaseDirs = basedirs.count();
+
+// for (uint i=0; i < basedirs.count(); ++i)
+// {
+// KILE_DEBUG() << "\t\tbasedirs " << i << ": " << basedirs[i] << endl;
+// }
+
+// for (uint i=0; i < dirs.count(); ++i)
+// {
+// KILE_DEBUG() << "\t\tdirs " << i << ": " << dirs[i] << endl;
+// }
+
+ while ( dirs.count() > 0 && basedirs.count() > 0 && dirs[0] == basedirs[0] )
+ {
+ dirs.pop_front();
+ basedirs.pop_front();
+ }
+
+// KILE_DEBUG() << "\tafter" << endl;
+// for (uint i=0; i < basedirs.count(); ++i)
+// {
+// KILE_DEBUG() << "\t\tbasedirs " << i << ": " << basedirs[i] << endl;
+// }
+//
+// for (uint i=0; i < dirs.count(); ++i)
+// {
+// KILE_DEBUG() << "\t\tdirs " << i << ": " << dirs[i] << endl;
+// }
+
+ if (nDirs != dirs.count() )
+ {
+ path = dirs.join("/");
+
+ if (basedirs.count() > 0)
+ {
+ for (uint j=0; j < basedirs.count(); ++j)
+ {
+ path = "../" + path;
+ }
+ }
+
+ if ( path.length() > 0 && path.right(1) != "/" ) path = path + '/';
+
+ path = path+filename;
+ }
+ else //assume an absolute path was requested
+ {
+ path = url.path();
+ }
+
+// KILE_DEBUG() << "\tpath : " << path << endl;
+
+ return path;
+}
+
+bool KileProject::contains(const KURL &url)
+{
+ for (uint i=0; i < m_projectitems.count(); ++i)
+ {
+ if ( m_projectitems.at(i)->url() == url )
+ return true;
+ }
+
+ return false;
+}
+
+bool KileProject::contains(const KileDocument::Info *info)
+{
+ QPtrListIterator<KileProjectItem> it(m_projectitems);
+ KileProjectItem *current;
+ while( (current = it.current()) != 0)
+ {
+ ++it;
+ if(current->getInfo() == info)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+KileProjectItem *KileProject::rootItem(KileProjectItem *item) const
+{
+ //find the root item (i.e. the eldest parent)
+ KileProjectItem *root = item;
+ while ( root->parent() != 0)
+ root = root->parent();
+
+ //check if this root item is a LaTeX root
+ if ( root->getInfo() )
+ {
+ if (root->getInfo()->isLaTeXRoot())
+ return root;
+ else
+ {
+ //if not, see if we can find another root item that is a LaTeX root
+ QPtrListIterator<KileProjectItem> it(m_rootItems);
+ while ( it.current() )
+ {
+ if ( it.current()->getInfo() && it.current()->getInfo()->isLaTeXRoot() )
+ return it.current();
+ ++it;
+ }
+ }
+
+ //no LaTeX root found, return previously found root
+ return root;
+ }
+
+ //root is not a valid item (getInfo() return 0L), return original item
+ return item;
+}
+
+void KileProject::dump()
+{
+ KILE_DEBUG() << "KileProject::dump() " << m_name << endl;
+ for ( uint i=0; i < m_projectitems.count(); ++i)
+ {
+ KileProjectItem *item;
+ item = m_projectitems.at(i);
+ KILE_DEBUG() << "item " << i << " has path: " << item->path() << endl;
+ KILE_DEBUG() << "item->type() " << item->type() << endl;
+ KILE_DEBUG() << "OpenState: " << item->isOpen() << endl;
+ }
+}
+
+QString KileProject::archiveFileList() const
+{
+ KILE_DEBUG() << "KileProject::archiveFileList()" << endl;
+
+ QString path,list;
+ QPtrListIterator<KileProjectItem> it(m_projectitems);
+
+ while (it.current())
+ {
+ if ((*it)->archive())
+ {
+ path = (*it)->path();
+ KRun::shellQuote(path);
+ list.append(path + ' ');
+ }
+ ++it;
+ }
+ return list;
+}
+
+void KileProject::setMasterDocument(const QString & master){
+
+ if(!master.isEmpty()){
+
+ QFileInfo fi(master);
+ if(fi.exists())
+ m_masterDocument = master;
+ else{
+ m_masterDocument = QString::null;
+ KILE_DEBUG() << "setMasterDocument: masterDoc=NULL" << endl;
+ }
+
+ }
+ else
+ m_masterDocument = QString::null;
+
+ emit (masterDocumentChanged(m_masterDocument));
+}
+
+#include "kileproject.moc"
diff --git a/src/kile/kileproject.h b/src/kile/kileproject.h
new file mode 100644
index 0000000..eb936ab
--- /dev/null
+++ b/src/kile/kileproject.h
@@ -0,0 +1,235 @@
+/***************************************************************************
+ begin : Fri Aug 1 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef KILEPROJECT_H
+#define KILEPROJECT_H
+
+#include <qobject.h>
+#include <qptrlist.h>
+#include <qregexp.h>
+
+#include "kiledebug.h"
+#include <kurl.h>
+
+class QString;
+class QStringList;
+class KSimpleConfig;
+namespace KileDocument { class Info; class TextInfo; class Extensions; }
+
+/**
+ * KileProjectItem
+ **/
+class KileProject;
+class KileProjectItemList;
+class KileProjectItem : public QObject
+{
+ Q_OBJECT
+
+public:
+ KileProjectItem(KileProject *project = 0, const KURL &url = KURL(), int type = Source);
+ ~KileProjectItem() { KILE_DEBUG() << "DELETING PROJITEM " << m_path << endl;}
+
+ bool operator==(const KileProjectItem& item) { return m_url == item.url();}
+
+ enum Type { ProjectFile = 0, Source, Package, Image, Other /* should be the last item*/ };
+
+ int type() const { return m_type; }
+ void setType(int type) { m_type = type; }
+
+ bool archive() const { return m_archive; }
+ void setArchive(bool ar) { m_archive = ar; }
+
+ void setInfo(KileDocument::TextInfo * docinfo);
+ KileDocument::TextInfo* getInfo() { return m_docinfo; }
+
+ KileProject* project() const { return m_project;}
+
+ /**
+ * @returns absolute URL of this item
+ **/
+ const KURL& url() const { return m_url; }
+
+ /**
+ * @returns path of this item relative to the project file
+ **/
+ const QString& path() const { return m_path; }
+
+ bool isOpen() const { return m_bOpen; }
+ void setOpenState(bool state) { m_bOpen = state; }
+
+ const QString& encoding() const { return m_encoding;}
+ void setEncoding(const QString& encoding) {m_encoding = encoding;}
+
+ const QString& highlight() { return m_highlight;}
+ void setHighlight(const QString& highlight) {m_highlight = highlight;}
+
+ uint lineNumber() { return m_nLine; }
+ void setLineNumber(uint l) { m_nLine = l; }
+
+ uint columnNumber() { return m_nColumn; }
+ void setColumnNumber(uint l) { m_nColumn = l; }
+
+ int order() const { return m_order; }
+ void setOrder(int i);
+
+ //project tree functions
+ void setParent(KileProjectItem * item);
+
+protected:
+ void setChild(KileProjectItem *item) { m_child = item; }
+ void setSibling(KileProjectItem *item) { m_sibling = item; }
+
+public:
+ KileProjectItem* parent() const { return m_parent; }
+ KileProjectItem* firstChild() const { return m_child;}
+ KileProjectItem* sibling() const { return m_sibling; }
+
+ void allChildren(QPtrList<KileProjectItem> *) const;
+
+ void print(int level);
+
+public slots:
+ /**
+ * @warning Does nothing if "url" is empty !
+ **/
+ void changeURL(const KURL &url);
+ void changePath(const QString& path) { m_path = path;}
+
+private slots:
+ void slotChangeURL(KileDocument::Info* info, const KURL& url);
+
+signals:
+ void urlChanged(KileProjectItem*);
+
+private:
+ KileProject *m_project;
+ KURL m_url;
+ QString m_path;
+ QString m_encoding;
+ QString m_highlight;
+ bool m_bOpen, m_archive;
+ int m_type;
+ KileDocument::TextInfo *m_docinfo;
+ KileProjectItem *m_parent, *m_child, *m_sibling;
+ uint m_nLine, m_nColumn;
+ int m_order;
+};
+
+class KileProjectItemList : public QPtrList<KileProjectItem>
+{
+public:
+ KileProjectItemList() { setAutoDelete(true); }
+ ~KileProjectItemList() { KILE_DEBUG() << "DELETING KILEPROJECTITEMLIST" << endl;}
+};
+
+/**
+ * KileProject
+ **/
+class KileProject : public QObject
+{
+ Q_OBJECT
+
+public:
+ KileProject(const QString& name, const KURL& url, KileDocument::Extensions *extensions);
+ KileProject(const KURL& url, KileDocument::Extensions *extensions);
+
+ ~KileProject();
+
+ void setName(const QString & name) { m_name = name; emit (nameChanged(name));}
+ const QString& name() const { return m_name; }
+
+ void setMasterDocument(const QString & master);
+ const QString& masterDocument() const { return m_masterDocument; }
+
+ void setExtensions(KileProjectItem::Type type, const QString & ext);
+ const QString & extensions(KileProjectItem::Type type) { return m_extensions[type-1]; }
+
+ void setQuickBuildConfig(const QString & cfg) { m_quickBuildConfig = cfg; }
+ const QString & quickBuildConfig() { return m_quickBuildConfig; }
+
+ void setLastDocument(const KURL &url);
+ const KURL & lastDocument() const { return m_lastDocument; }
+
+ void setMakeIndexOptions(const QString & opt) { m_makeIndexOptions = opt; }
+ const QString & makeIndexOptions() { return m_makeIndexOptions; }
+ void readMakeIndexOptions();
+ void setUseMakeIndexOptions(bool use) { m_useMakeIndexOptions = use; }
+ void writeUseMakeIndexOptions();
+ bool useMakeIndexOptions() { return m_useMakeIndexOptions; }
+
+ const KURL& url() const { return m_projecturl; }
+ void setURL(const KURL & url ) { m_projecturl = url; }
+ const KURL& baseURL() const { return m_baseurl; }
+
+ KileProjectItem* item(const KURL &);
+ KileProjectItem* item(const KileDocument::Info *info);
+ KileProjectItemList* items() { return &m_projectitems; }
+
+ KSimpleConfig *config() { return m_config; }
+
+ bool contains(const KURL&);
+ bool contains(const KileDocument::Info *info);
+ KileProjectItem *rootItem(KileProjectItem *) const;
+ const QPtrList<KileProjectItem>* rootItems() const {return &m_rootItems;}
+ bool isInvalid(){ return m_invalid;}
+ QString archiveFileList() const;
+
+signals:
+ void nameChanged(const QString &);
+ void masterDocumentChanged(const QString &);
+ void projectTreeChanged(const KileProject *);
+
+public slots:
+ bool load();
+ bool save();
+
+ void add(KileProjectItem*);
+ void remove(const KileProjectItem*);
+
+ void itemRenamed(KileProjectItem*);
+
+ void buildProjectTree(); // moved to slots by tbraun
+
+ //debugging
+ void dump();
+
+signals:
+ void loadFile(const KURL &url , const QString & encoding);
+
+private:
+ void init(const QString& name, const KURL& url, KileDocument::Extensions *extensions);
+ QString findRelativePath(const KURL&);
+ void setType(KileProjectItem *item);
+ QString addBaseURL(const QString &path);
+ QString removeBaseURL(const QString &path);
+ void writeConfigEntry(const QString &key,const QString &standardExt,KileProjectItem::Type type);
+
+private:
+ QString m_name, m_quickBuildConfig, m_kileversion, m_kileprversion;
+ KURL m_projecturl, m_baseurl, m_lastDocument;
+ bool m_invalid;
+ QPtrList<KileProjectItem> m_rootItems;
+ KileProjectItemList m_projectitems;
+
+ QString m_extensions[3];
+ QRegExp m_reExtensions[3];
+
+ QString m_masterDocument, m_makeIndexOptions;
+ bool m_useMakeIndexOptions;
+
+ KSimpleConfig *m_config;
+ KileDocument::Extensions *m_extmanager;
+};
+
+#endif
diff --git a/src/kile/kileprojectdlgs.cpp b/src/kile/kileprojectdlgs.cpp
new file mode 100644
index 0000000..01ff6a4
--- /dev/null
+++ b/src/kile/kileprojectdlgs.cpp
@@ -0,0 +1,609 @@
+/***************************************************************************
+ begin : Sun Aug 3 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ : (C) 2007 by Holger Danielsson
+ email : Jeroen.Wijnhout@kdemail.net
+ holger.danielsson@versanet.de
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// 2007-02-15 (dani)
+// - cosmetic changes
+// - use of groupboxes to prepare further extensions
+
+// 2007-03-12 (dani)
+// - use KileDocument::Extensions
+// - allowed extensions are always defined as list, f.e.: .tex .ltx .latex
+
+#include "kileprojectdlgs.h"
+
+#include <qlabel.h>
+#include <qwhatsthis.h>
+#include <qfileinfo.h>
+#include <qptrlist.h>
+#include <qregexp.h>
+#include <qvalidator.h>
+
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kurlcompletion.h>
+#include <kfiledialog.h>
+#include <kcombobox.h>
+#include "kiledebug.h"
+#include <kapplication.h>
+#include <kiconloader.h>
+
+#include "kileproject.h"
+#include "kiletoolmanager.h"
+#include "kiledocumentinfo.h"
+#include "kileconfig.h"
+#include "kileextensions.h"
+#include "templates.h"
+
+const QString whatsthisName = i18n("Insert a short descriptive name of your project here.");
+const QString whatsthisPath = i18n("Insert the path to your project file here. If this file does not yet exists, it will be created. The filename should have the extension: .kilepr. You can also use the browse button to insert a filename.");
+const QString whatsthisExt = i18n("Insert a list (separated by spaces) of file extensions which should be treated also as files of the corresponding type in this project.");
+const QString whatsthisMaster = i18n("Select the default master document. Leave empty for auto detection.");
+
+const QString tool_default = i18n("(use global setting)");
+
+KileProjectDlgBase::KileProjectDlgBase(const QString &caption, KileDocument::Extensions *extensions, QWidget *parent, const char * name)
+ : KDialogBase( KDialogBase::Plain, caption, (Ok | Cancel), Ok, parent, name, true, true),
+ m_extmanager(extensions), m_project(0)
+{
+ // properties groupbox
+ m_pgroup = new QVGroupBox(i18n("Project"), plainPage());
+ m_pgroup->setColumnLayout(0, Qt::Vertical );
+ m_pgroup->layout()->setSpacing( 6 );
+ m_pgroup->layout()->setMargin( 11 );
+ m_pgrid = new QGridLayout( m_pgroup->layout() );
+ m_pgrid->setAlignment( Qt::AlignTop );
+
+ m_title = new KLineEdit(m_pgroup, "le_projectname");
+ QWhatsThis::add(m_title, whatsthisName);
+ m_plabel = new QLabel(i18n("Project &title:"), m_pgroup);
+ m_plabel->setBuddy(m_title);
+ QWhatsThis::add(m_plabel, whatsthisName);
+
+ // extensions groupbox
+ m_egroup= new QVGroupBox(i18n("Extensions"), plainPage());
+ m_egroup->setColumnLayout(0, Qt::Vertical );
+ m_egroup->layout()->setSpacing( 6 );
+ m_egroup->layout()->setMargin( 11 );
+ m_egrid = new QGridLayout( m_egroup->layout() );
+ m_egrid->setAlignment( Qt::AlignTop );
+
+ m_extensions = new KLineEdit(m_egroup, "le_ext");
+ QRegExp reg("[\\. a-zA-Z0-9]+");
+ QRegExpValidator *extValidator = new QRegExpValidator(reg,m_egroup);
+ m_extensions->setValidator(extValidator);
+
+ m_sel_extensions = new KComboBox(false, m_egroup, "le_sel_ext");
+ m_sel_extensions->insertItem(i18n("Source Files"));
+ m_sel_extensions->insertItem(i18n("Package Files"));
+ m_sel_extensions->insertItem(i18n("Image Files"));
+ m_lbPredefinedExtensions = new QLabel(i18n("Predefined:"),m_egroup);
+ m_lbStandardExtensions = new QLabel(QString::null,m_egroup);
+
+ QWhatsThis::add(m_sel_extensions, whatsthisExt);
+ QWhatsThis::add(m_extensions, whatsthisExt);
+
+ fillProjectDefaults();
+
+ connect(m_sel_extensions, SIGNAL(highlighted(int)),
+ this, SLOT(slotExtensionsHighlighted(int)));
+
+ connect(m_extensions, SIGNAL(textChanged(const QString&)),
+ this, SLOT(slotExtensionsTextChanged(const QString&)));
+}
+
+KileProjectDlgBase::~KileProjectDlgBase()
+{
+}
+
+void KileProjectDlgBase::slotExtensionsHighlighted(int index)
+{
+ disconnect(m_extensions, SIGNAL(textChanged(const QString&)),
+ this, SLOT(slotExtensionsTextChanged(const QString&)));
+ m_extensions->setText(m_val_extensions[index]);
+ connect(m_extensions, SIGNAL(textChanged(const QString&)),
+ this, SLOT(slotExtensionsTextChanged(const QString&)));
+
+ m_lbStandardExtensions->setText( m_val_standardExtensions[index] );
+}
+
+void KileProjectDlgBase::slotExtensionsTextChanged(const QString &text)
+{
+ m_val_extensions[m_sel_extensions->currentItem()] = text;
+}
+
+bool KileProjectDlgBase::acceptUserExtensions()
+{
+ QRegExp reg("\\.\\w+");
+
+ for (int i=KileProjectItem::Source; i<KileProjectItem::Other; ++i)
+ {
+ m_val_extensions[i-1] = m_val_extensions[i-1].stripWhiteSpace();
+ if ( ! m_val_extensions[i-1].isEmpty() )
+ {
+ // some tiny extension checks
+ QStringList::ConstIterator it;
+ QStringList list = QStringList::split(" ", m_val_extensions[i-1]);
+ for ( it=list.begin(); it != list.end(); ++it )
+ {
+ if ( ! reg.exactMatch(*it) )
+ {
+ KMessageBox::error(this, i18n("Error in extension") + " '" + (*it) + "':\n" + i18n("All user defined extensions should look like '.xyz'"), i18n("Invalid extension"));
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+void KileProjectDlgBase::setExtensions(KileProjectItem::Type type, const QString & ext)
+{
+ if (m_sel_extensions->currentItem() == type-1)
+ m_extensions->setText(ext);
+ else
+ m_val_extensions[type-1] = ext;
+}
+
+void KileProjectDlgBase::setProject(KileProject *project, bool override)
+{
+ m_project = project;
+
+ if ((!override) || (project == 0))
+ return;
+
+ for (int i = KileProjectItem::Source; i < KileProjectItem::Other; ++i)
+ {
+ m_val_extensions[i - 1] = project->extensions((KileProjectItem::Type) i);
+ }
+
+ m_title->setText(m_project->name());
+ m_extensions->setText(m_val_extensions[0]);
+ m_lbStandardExtensions->setText( m_val_standardExtensions[0] );
+}
+
+KileProject* KileProjectDlgBase::project()
+{
+ return m_project;
+}
+
+void KileProjectDlgBase::fillProjectDefaults()
+{
+ m_val_extensions[0] = QString::null;
+ m_val_extensions[1] = QString::null;
+ m_val_extensions[2] = QString::null;
+ //m_val_extensions[3] = OTHER_EXTENSIONS;
+
+ m_val_standardExtensions[0] = m_extmanager->latexDocuments();
+ m_val_standardExtensions[1] = m_extmanager->latexPackages();
+ m_val_standardExtensions[2] = m_extmanager->images();
+
+ m_extensions->setText(m_val_extensions[0]);
+ m_lbStandardExtensions->setText( m_val_standardExtensions[0] );
+}
+
+
+/*
+ * KileNewProjectDlg
+ */
+KileNewProjectDlg::KileNewProjectDlg(KileTemplate::Manager *templateManager, KileDocument::Extensions *extensions, QWidget* parent, const char* name)
+ : KileProjectDlgBase(i18n("Create New Project"), extensions, parent, name), m_templateManager(templateManager),
+ m_filename(QString::null)
+{
+ // Layout
+ QVBoxLayout *vbox = new QVBoxLayout(plainPage(), 6,6 );
+
+ // first groupbox
+ m_pgrid->addWidget(m_plabel, 0,0);
+ m_pgrid->addWidget(m_title, 0,2);
+ connect(m_title, SIGNAL(textChanged(const QString&)), this, SLOT(makeProjectPath()));
+
+ m_location = new KLineEdit(m_pgroup, "le_projectlocation");
+ m_location->setMinimumWidth(200);
+
+ QLabel *lb1 = new QLabel(i18n("Project &file:"), m_pgroup);
+ QWhatsThis::add(lb1, whatsthisPath);
+ QWhatsThis::add(m_location, whatsthisPath);
+ lb1->setBuddy(m_location);
+ m_pbChooseDir= new KPushButton(i18n("Select Folder..."), m_pgroup, "dirchooser_button" );
+ m_pbChooseDir->setPixmap( SmallIcon("fileopen") );
+ int wpixmap = m_pbChooseDir->pixmap()->width();
+ m_pbChooseDir->setFixedWidth(wpixmap+10);
+ m_pbChooseDir->setFixedHeight(wpixmap+10);
+
+ m_pgrid->addWidget(lb1,1,0);
+ m_pgrid->addMultiCellWidget(m_location,1,1,2,3);
+ m_pgrid->addWidget(m_pbChooseDir,1,5);
+ m_pgrid->setColSpacing(1,8);
+ m_pgrid->setColSpacing(4,8);
+ m_pgrid->setColStretch(3,1);
+
+ connect(m_pbChooseDir, SIGNAL(clicked()), this, SLOT(browseLocation()));
+
+ // second groupbox
+ QVGroupBox* group2= new QVGroupBox(i18n("File"), plainPage());
+ QWidget *widget2 = new QWidget(group2);
+ QGridLayout *grid2 = new QGridLayout(widget2, 3,2, 6,6);
+ m_cb = new QCheckBox(i18n("Create a new file and add it to this project"),widget2);
+ m_cb->setChecked(true);
+ m_lb = new QLabel(i18n("File&name (relative to where the project file is):"),widget2);
+ m_file = new KLineEdit(widget2);
+ m_lb->setBuddy(m_file);
+ m_templateIconView = new TemplateIconView(widget2);
+ m_templateIconView->setTemplateManager(m_templateManager);
+ m_templateManager->scanForTemplates();
+ m_templateIconView->fillWithTemplates(KileDocument::LaTeX);
+ QWhatsThis::add(m_cb, i18n("If you want Kile to create a new file and add it to the project, then check this option and select a template from the list that will appear below."));
+
+ grid2->addMultiCellWidget(m_cb, 0,0, 0,1);
+ grid2->addWidget(m_lb, 1,0);
+ grid2->addWidget(m_file, 1,1);
+ grid2->addMultiCellWidget(m_templateIconView, 2,2, 0,1);
+ grid2->setColStretch(1,1);
+ connect(m_cb, SIGNAL(clicked()), this, SLOT(clickedCreateNewFileCb()));
+
+ // third groupbox
+ m_egrid->addWidget(m_sel_extensions, 6,0);
+ m_egrid->addMultiCellWidget(m_extensions, 6,6, 1,3);
+ m_egrid->addWidget(m_lbPredefinedExtensions, 7,0);
+ m_egrid->addMultiCellWidget(m_lbStandardExtensions, 7,7, 1,3);
+
+ // add to layout
+ vbox->addWidget(m_pgroup);
+ vbox->addWidget(group2);
+ vbox->addWidget(m_egroup);
+ vbox->addStretch();
+
+ fillProjectDefaults();
+}
+
+KileNewProjectDlg::~KileNewProjectDlg()
+{}
+
+KileProject* KileNewProjectDlg::project()
+{
+ if (!m_project) {
+ m_project = new KileProject(projectTitle(), KURL(location()), m_extmanager);
+
+ KileProjectItem::Type type;
+ for (int i = KileProjectItem::Source; i < KileProjectItem::Other; ++i) {
+ type = (KileProjectItem::Type) i;
+ m_project->setExtensions(type, extensions(type));
+ }
+
+ m_project->buildProjectTree();
+ }
+
+ return m_project;
+}
+
+void KileNewProjectDlg::clickedCreateNewFileCb()
+{
+ if (m_cb->isChecked())
+ {
+ m_file->show();
+ m_lb->show();
+ m_templateIconView->show();
+ }
+ else
+ {
+ m_file->hide();
+ m_lb->hide();
+ m_templateIconView->hide();
+ }
+}
+
+QString KileNewProjectDlg::bare()
+{
+ return projectTitle().lower().stripWhiteSpace().replace(QRegExp("\\s*"),"")+".kilepr";
+}
+
+void KileNewProjectDlg::browseLocation()
+{
+ QString dir = m_dir;
+ if (!QFileInfo(m_dir).exists())
+ dir = QString::null;
+
+ dir = KFileDialog::getExistingDirectory(dir, this);
+
+ if (! dir.isNull())
+ {
+ m_dir = dir;
+ if (m_dir.right(1) != "/") m_dir = m_dir + '/';
+ m_location->setText(m_dir+bare());
+ }
+}
+
+void KileNewProjectDlg::makeProjectPath()
+{
+ m_filename=bare();
+ KILE_DEBUG() << "BEFORE " << QFileInfo(location()).absFilePath() << " " << QFileInfo(location()).dirPath() << endl;
+ m_dir = QFileInfo(location()).dirPath();
+ if (m_dir.right(1) != "/") m_dir = m_dir + '/';
+
+ KILE_DEBUG() << "LOCATION " << location() << " AND " << m_dir << endl;
+ m_location->setText(m_dir+m_filename);
+}
+
+void KileNewProjectDlg::slotOk()
+{
+ if ( ! acceptUserExtensions() )
+ return;
+
+ //replace ~ and environment variables in the paths
+ KURLCompletion uc;
+ uc.setReplaceEnv(true);
+ uc.setReplaceHome(true);
+ m_location->setText(uc.replacedPath(location()));
+ m_file->setText(uc.replacedPath(file()));
+
+ if ( projectTitle().stripWhiteSpace().isEmpty())
+ {
+ if (KMessageBox::warningYesNo(this, i18n("You did not enter a project name, if you continue the project name will be set to: Untitled."), i18n("No Name")) == KMessageBox::Yes)
+ m_title->setText(i18n("Untitled"));
+ else
+ return;
+ }
+
+ if ( location().stripWhiteSpace().isEmpty() )
+ {
+ KMessageBox::error(this, i18n("Please enter the location where the project file should be save to. Also make sure it ends with .kilepr ."), i18n("Empty Location"));
+ return;
+ }
+
+ QFileInfo fi(location().stripWhiteSpace());
+ QFileInfo dr(fi.dirPath());
+ QDir dir = dr.dir();
+
+ if ( location().stripWhiteSpace().right(7) != ".kilepr")
+ {
+ KMessageBox::error(this, i18n("The extension of the project filename is not .kilepr , please correct the extension"), i18n("Wrong Filename Extension"));
+ return;
+ }
+ else
+ {
+
+ if (dir.isRelative())
+ {
+ KMessageBox::error(this, i18n("The path for the project file is not an absolute path, absolute paths always begin with an /"),i18n("Relative Path"));
+ return;
+ }
+
+ KILE_DEBUG() << "==KileNewProjectDlg::slotOk()==============" << endl;
+ KILE_DEBUG() << "\t" << location() << " " << fi.dirPath() << endl;
+ if (! dr.exists())
+ {
+ bool suc = true;
+ QStringList dirs = QStringList::split("/", fi.dirPath());
+ QString path;
+
+ for (uint i=0; i < dirs.count(); ++i)
+ {
+ path += '/' + dirs[i];
+ dir.setPath(path);
+ KILE_DEBUG() << "\tchecking : " << dir.absPath() << endl;
+ if ( ! dir.exists() )
+ {
+ dir.mkdir(dir.absPath());
+ suc = dir.exists();
+ KILE_DEBUG() << "\t\tcreated : " << dir.absPath() << " suc = " << suc << endl;
+ }
+
+ if (!suc)
+ {
+ KMessageBox::error(this, i18n("Could not create the project folder, check your permissions."));
+ return;
+ }
+ }
+ }
+
+ if (! dr.isWritable())
+ {
+ KMessageBox::error(this, i18n("The project folder is not writable, check your permissions."));
+ return;
+ }
+ }
+
+ if ( createNewFile() )
+ {
+ if ( file().stripWhiteSpace().isEmpty())
+ {
+ KMessageBox::error(this, i18n("Please enter a filename for the file that should be added to this project."),
+ i18n("No File Name Given"));
+ return;
+ }
+
+ //check for validity of name first, then check for existence (fixed by tbraun)
+ KURL fileURL; fileURL.setFileName(file());
+ KURL validURL = KileDocument::Info::makeValidTeXURL(fileURL,m_extmanager->isTexFile(fileURL),true);
+ if ( validURL != fileURL )
+ m_file->setText(validURL.fileName());
+
+ if ( QFileInfo( QDir(fi.dirPath()) , file().stripWhiteSpace()).exists() )
+ {
+ if (KMessageBox::warningYesNo(this, i18n("The file \"%1\" already exists, overwrite it?").arg(file()),
+ i18n("File Already Exists")) == KMessageBox::No)
+ return;
+ }
+ }
+
+ if (QFileInfo(location()).exists())
+ {
+ KMessageBox::error(this, i18n("The project file already exists, please select another name. Delete the existing project file if your intention was to overwrite it."),i18n("Project File Already Exists"));
+ return;
+ }
+
+ accept();
+}
+
+void KileNewProjectDlg::fillProjectDefaults()
+{
+ m_dir = KileConfig::defaultProjectLocation();
+ if( !m_dir.endsWith("/") )
+ m_dir += '/';
+ KILE_DEBUG() << "M_DIR " << m_dir << endl;
+ m_location->setText(m_dir);
+ m_cb->setChecked(true);
+
+ KileProjectDlgBase::fillProjectDefaults();
+}
+
+TemplateItem* KileNewProjectDlg::getSelection() const
+{
+ return static_cast<TemplateItem*>(m_templateIconView->currentItem());
+}
+
+/*
+ * KileProjectOptionsDlg
+ */
+KileProjectOptionsDlg::KileProjectOptionsDlg(KileProject *project, KileDocument::Extensions *extensions, QWidget *parent, const char * name) :
+ KileProjectDlgBase(i18n("Project Options"), extensions, parent, name )
+{
+ // Layout
+ QVBoxLayout *vbox = new QVBoxLayout(plainPage(), 6,6 );
+
+ m_pgrid->addWidget(m_plabel, 0,0);
+ m_pgrid->addWidget(m_title, 0,2);
+// m_pgrid->addWidget(labelEncoding, 1,0);
+// m_pgrid->addWidget(m_lbEncoding, 1,2);
+ m_pgrid->setColSpacing(1,8);
+ m_pgrid->setColStretch(3,1);
+ // second groupbox
+
+ m_egrid->addWidget(m_sel_extensions, 6,0);
+ m_egrid->addMultiCellWidget(m_extensions, 6,6, 1,3);
+ m_egrid->addWidget(m_lbPredefinedExtensions, 7,0);
+ m_egrid->addMultiCellWidget(m_lbStandardExtensions, 7,7, 1,3);
+
+ // third groupbox
+ QVGroupBox* group3 = new QVGroupBox(i18n("Properties"), plainPage());
+ group3->setColumnLayout(0, Qt::Vertical );
+ group3->layout()->setSpacing( 6 );
+ group3->layout()->setMargin( 11 );
+ QGridLayout *grid3 = new QGridLayout( group3->layout() );
+ grid3->setAlignment( Qt::AlignTop );
+
+ m_master = new KComboBox(false, group3, "master");
+ //m_master->setDisabled(true);
+ QLabel *lb1 = new QLabel(i18n("&Master document:"), group3);
+ lb1->setBuddy(m_master);
+ lb1->setMinimumWidth( m_sel_extensions->sizeHint().width() );
+ QWhatsThis::add(m_master, whatsthisMaster);
+ QWhatsThis::add(lb1,whatsthisMaster);
+
+ m_master->insertItem(i18n("(auto-detect)"));
+ QPtrListIterator<KileProjectItem> rit(*(project->rootItems()));
+ int index = 0;
+ while (rit.current())
+ {
+ if ((*rit)->type() == KileProjectItem::Source)
+ {
+ m_master->insertItem((*rit)->url().fileName());
+ ++index;
+ if ( (*rit)->url().path() == project->masterDocument() )
+ m_master->setCurrentItem(index);
+ }
+ ++rit;
+ }
+
+ if (project->masterDocument().isNull())
+ m_master->setCurrentItem(0);
+
+ QLabel *lb2 = new QLabel(i18n("&QuickBuild configuration:"), group3);
+ m_cbQuick = new KComboBox(group3);
+ lb2->setBuddy(m_cbQuick);
+ m_cbQuick->insertItem(tool_default);
+ m_cbQuick->insertStringList(KileTool::configNames("QuickBuild", kapp->config()));
+ m_cbQuick->setCurrentText(project->quickBuildConfig().length() > 0 ? project->quickBuildConfig() : tool_default );
+
+ //don't put this after the call to toggleMakeIndex
+ setProject(project, true);
+
+ m_ckMakeIndex = new QCheckBox(i18n("&MakeIndex options"), group3);
+ connect(m_ckMakeIndex, SIGNAL(toggled(bool)), this, SLOT(toggleMakeIndex(bool)));
+ m_leMakeIndex = new KLineEdit(group3);
+ m_ckMakeIndex->setChecked(project->useMakeIndexOptions());
+ toggleMakeIndex(m_ckMakeIndex->isChecked());
+
+ grid3->addWidget(lb1,0,0);
+ grid3->addWidget(m_master,0,1);
+ grid3->addWidget(lb2,1,0);
+ grid3->addWidget(m_cbQuick,1,1);
+ grid3->addWidget(m_ckMakeIndex,2,0);
+ grid3->addMultiCellWidget(m_leMakeIndex,2,2,1,2);
+ grid3->setColStretch(2,1);
+
+ // add to layout
+ vbox->addWidget(m_pgroup);
+ vbox->addWidget(m_egroup);
+ vbox->addWidget(group3);
+ vbox->addStretch();
+}
+
+KileProjectOptionsDlg::~KileProjectOptionsDlg()
+{
+}
+
+void KileProjectOptionsDlg::toggleMakeIndex(bool on)
+{
+ KILE_DEBUG() << "TOGGLED!" << endl;
+ m_leMakeIndex->setEnabled(on);
+ m_project->setUseMakeIndexOptions(on);
+ m_project->writeUseMakeIndexOptions();
+ m_project->readMakeIndexOptions();
+ m_leMakeIndex->setText(m_project->makeIndexOptions());
+}
+
+void KileProjectOptionsDlg::slotOk()
+{
+ if ( ! acceptUserExtensions() )
+ return;
+
+ this->m_project->setName(m_title->text());
+
+ QPtrListIterator<KileProjectItem> rit(*(m_project->rootItems()));
+ while (rit.current())
+ {
+ if ((*rit)->url().fileName() == m_master->currentText() )
+ m_project->setMasterDocument((*rit)->url().path());
+ ++rit;
+ }
+ if (m_master->currentItem() == 0) m_project->setMasterDocument(QString::null);
+
+ m_val_extensions[m_sel_extensions->currentItem()] = m_extensions->text();
+
+ for (int i = KileProjectItem::Source; i < KileProjectItem::Other; ++i)
+ {
+ m_project->setExtensions( (KileProjectItem::Type) i, m_val_extensions[i-1] );
+ }
+
+ if ( m_cbQuick->currentText() == tool_default )
+ m_project->setQuickBuildConfig("");
+ else
+ m_project->setQuickBuildConfig(m_cbQuick->currentText());
+
+ m_project->setUseMakeIndexOptions(m_ckMakeIndex->isChecked());
+ if ( m_project->useMakeIndexOptions() )
+ m_project->setMakeIndexOptions(m_leMakeIndex->text());
+
+ m_project->save();
+
+ accept();
+}
+
+
+#include "kileprojectdlgs.moc"
diff --git a/src/kile/kileprojectdlgs.h b/src/kile/kileprojectdlgs.h
new file mode 100644
index 0000000..a9cb85a
--- /dev/null
+++ b/src/kile/kileprojectdlgs.h
@@ -0,0 +1,138 @@
+/***************************************************************************
+ begin : Sun Aug 3 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEPROJECTDLGS_H
+#define KILEPROJECTDLGS_H
+
+#include <qcheckbox.h>
+#include <qlayout.h>
+#include <qvgroupbox.h>
+
+#include <kdialogbase.h>
+#include <klineedit.h>
+#include <kpushbutton.h>
+
+#include "kileproject.h"
+#include "templates.h"
+
+class TemplateIconView;
+class QLabel;
+class KileProject;
+class KComboBox;
+class QVGroupBox;
+class TemplateItem;
+
+namespace KileDocument { class Extensions; }
+namespace KileTemplate { class Manager; }
+
+class KileProjectDlgBase : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KileProjectDlgBase(const QString &caption, KileDocument::Extensions *extensions, QWidget *parent = 0, const char * name = 0);
+ virtual ~KileProjectDlgBase();
+
+ void setProject(KileProject *project, bool override);
+ virtual KileProject* project();
+
+ void setProjectTitle(const QString &title) { m_title->setText(title); }
+ const QString projectTitle() { return m_title->text(); }
+
+ void setExtensions(KileProjectItem::Type type, const QString & ext);
+ const QString extensions(KileProjectItem::Type type)
+ { return m_val_extensions[type-1]; }
+
+protected slots:
+ virtual void slotOk() = 0;
+ virtual void fillProjectDefaults();
+
+private slots:
+ void slotExtensionsHighlighted(int index);
+ void slotExtensionsTextChanged(const QString &text);
+
+protected:
+ KileDocument::Extensions *m_extmanager;
+
+ QVGroupBox *m_pgroup, *m_egroup;
+ QGridLayout *m_pgrid, *m_egrid;
+ QLabel *m_plabel;
+
+ KLineEdit *m_title, *m_extensions;
+ QLabel *m_lbPredefinedExtensions, *m_lbStandardExtensions;
+ KileProject *m_project;
+ KComboBox *m_sel_extensions;
+
+ QString m_val_extensions[KileProjectItem::Other - 1];
+ QString m_val_standardExtensions[KileProjectItem::Other - 1];
+
+ bool acceptUserExtensions();
+
+};
+
+class KileNewProjectDlg : public KileProjectDlgBase
+{
+ Q_OBJECT
+
+public:
+ KileNewProjectDlg(KileTemplate::Manager *templateManager, KileDocument::Extensions *extensions, QWidget* parent = 0, const char* name = 0);
+ ~KileNewProjectDlg();
+
+ KileProject* project();
+
+ QString bare();
+ QString location() { return m_location->text(); }
+
+ TemplateItem* getSelection() const;
+ QString file() { return m_file->text();}
+ bool createNewFile() { return m_cb->isChecked(); }
+
+private slots:
+ void clickedCreateNewFileCb();
+ void browseLocation();
+ void makeProjectPath();
+ void slotOk();
+ void fillProjectDefaults();
+
+private:
+ KileTemplate::Manager *m_templateManager;
+ KLineEdit *m_location, *m_file, *m_name;
+ TemplateIconView *m_templateIconView;
+ QCheckBox *m_cb;
+ QLabel *m_lb;
+
+ KPushButton *m_pbChooseDir;
+ QString m_dir, m_filename;
+};
+
+class KileProjectOptionsDlg : public KileProjectDlgBase
+{
+ Q_OBJECT
+
+public:
+ KileProjectOptionsDlg(KileProject *project, KileDocument::Extensions *extensions, QWidget *parent = 0, const char * name = 0);
+ ~KileProjectOptionsDlg();
+
+private slots:
+ void slotOk();
+ void toggleMakeIndex(bool);
+
+private:
+ KComboBox *m_master, *m_cbQuick;
+ KLineEdit *m_leMakeIndex;
+ QCheckBox *m_ckMakeIndex;
+};
+
+#endif
diff --git a/src/kile/kileprojectview.cpp b/src/kile/kileprojectview.cpp
new file mode 100644
index 0000000..aa8a3b2
--- /dev/null
+++ b/src/kile/kileprojectview.cpp
@@ -0,0 +1,691 @@
+/***************************************************************************
+ begin : Tue Aug 12 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ (C) 2006 by Michel Ludwig
+ email : Jeroen.Wijnhout@kdemail.net
+ michel.ludwig@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kileprojectview.h"
+
+#include <qheader.h>
+
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kiconloader.h>
+#include <kpopupmenu.h>
+#include <kurl.h>
+#include <krun.h>
+#include <kmimetype.h>
+#include <kurldrag.h>
+
+#include "kileinfo.h"
+#include "kiledocumentinfo.h"
+#include "kiledocmanager.h"
+
+const int KPV_ID_OPEN = 0, KPV_ID_SAVE = 1, KPV_ID_CLOSE = 2,
+ KPV_ID_OPTIONS = 3, KPV_ID_ADD = 4, KPV_ID_REMOVE = 5,
+ KPV_ID_BUILDTREE = 6, KPV_ID_ARCHIVE = 7, KPV_ID_ADDFILES = 8,
+ KPV_ID_INCLUDE = 9, KPV_ID_OPENWITH = 10, KPV_ID_OPENALLFILES = 11;
+
+/*
+ * KileProjectViewItem
+ */
+void KileProjectViewItem::urlChanged(const KURL &url)
+{
+ // don't allow empty URLs
+ if(!url.isEmpty())
+ {
+ setURL(url);
+ setText(0, url.fileName());
+ }
+}
+
+void KileProjectViewItem::nameChanged(const QString & name)
+{
+ setText(0,name);
+}
+
+void KileProjectViewItem::isrootChanged(bool isroot)
+{
+ KILE_DEBUG() << "SLOT isrootChanged " << text(0) << " to " << isroot << endl;
+ if (isroot)
+ {
+ setPixmap(0,SmallIcon("masteritem"));
+ }
+ else
+ {
+ if ( text(0).right(7) == ".kilepr" )
+ setPixmap(0,SmallIcon("kile"));
+ else if (type() == KileType::ProjectItem)
+ setPixmap(0,SmallIcon("projectitem"));
+ else
+ setPixmap(0,SmallIcon("file"));
+ }
+}
+
+void KileProjectViewItem::slotURLChanged(KileDocument::Info*, const KURL & url)
+{
+ urlChanged(url);
+}
+
+int KileProjectViewItem::compare(QListViewItem * i, int col, bool ascending) const
+{
+ KileProjectViewItem *item = dynamic_cast<KileProjectViewItem*>(i);
+
+ // sort:
+ // - first: container items in fixed order (projectfile, packages, images, other)
+ // - second: root items without container (sorted in ascending order)
+ if ( item->type() == KileType::Folder )
+ {
+ if ( type() != KileType::Folder )
+ return 1;
+ else
+ return ( m_folder < item->folder() ) ? -1 : 1;
+ }
+ else if ( type() == KileType::Folder )
+ return -1;
+ else
+ return QListViewItem::compare(i, col, ascending);
+}
+
+/*
+ * KileProjectView
+ */
+KileProjectView::KileProjectView(QWidget *parent, KileInfo *ki) : KListView(parent), m_ki(ki), m_nProjects(0), m_toggle(0)
+{
+ addColumn(i18n("Files & Projects"),-1);
+ addColumn(i18n("Include in Archive"),10);
+ setSorting(-1);
+ setFocusPolicy(QWidget::ClickFocus);
+ header()->hide();
+ setRootIsDecorated(true);
+ setAllColumnsShowFocus(true);
+ setFullWidth(true);
+ setSelectionModeExt(KListView::NoSelection);
+
+ m_popup = new KPopupMenu(this, "projectview_popup");
+
+ connect(this, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint & )), this,SLOT(popup(KListView *, QListViewItem * , const QPoint & )));
+
+ connect(this, SIGNAL(executed(QListViewItem*)), this, SLOT(slotClicked(QListViewItem*)));
+ setAcceptDrops(true);
+ connect(this, SIGNAL(dropped(QDropEvent *, QListViewItem *)), m_ki->docManager(), SLOT(openDroppedURLs(QDropEvent *)));
+}
+
+void KileProjectView::slotClicked(QListViewItem *item)
+{
+ if (item == 0)
+ item = currentItem();
+
+ KileProjectViewItem *itm = static_cast<KileProjectViewItem*>(item);
+ if (itm)
+ {
+ if (itm->type() == KileType::File )
+ emit(fileSelected(itm->url()));
+ else if ( itm->type() == KileType::ProjectItem )
+ emit(fileSelected(itm->projectItem()));
+ else if ( itm->type() != KileType::Folder )
+ {
+ // don't open project configuration files (*.kilepr)
+ if ( itm->url().path().right(7) != ".kilepr" )
+ {
+ //determine mimeType and open file with preferred application
+ KMimeType::Ptr pMime = KMimeType::findByURL(itm->url());
+ if ( pMime->name().startsWith("text/") )
+ emit(fileSelected(itm->url()));
+ else
+ KRun::runURL(itm->url(), pMime->name());
+ }
+ }
+ clearSelection();
+ }
+}
+
+void KileProjectView::slotFile(int id)
+{
+ KileProjectViewItem *item = static_cast<KileProjectViewItem*>(currentItem());
+ if (item )
+ {
+ if ( item->type() == KileType::File )
+ {
+ switch (id)
+ {
+ case KPV_ID_OPEN : emit(fileSelected(item->url())); break;
+ case KPV_ID_SAVE : emit(saveURL(item->url())); break;
+ case KPV_ID_ADD : emit(addToProject(item->url())); break;
+ case KPV_ID_CLOSE : emit(closeURL(item->url())); return; //don't access "item" later on
+ default : break;
+ }
+ }
+ }
+}
+
+void KileProjectView::slotProjectItem(int id)
+{
+ KileProjectViewItem *item = static_cast<KileProjectViewItem*>(currentItem());
+ if ( item )
+ {
+ if ( item->type()==KileType::ProjectItem || item->type()==KileType::ProjectExtra )
+ {
+ switch (id)
+ {
+ case KPV_ID_OPEN : emit(fileSelected(item->projectItem())); break;
+ case KPV_ID_SAVE : emit(saveURL(item->url())); break;
+ case KPV_ID_REMOVE :
+ emit(removeFromProject(item->projectItem()));
+ break;
+ case KPV_ID_INCLUDE :
+ if (item->text(1) == "*") item->setText(1,"");
+ else item->setText(1,"*");
+ emit(toggleArchive(item->projectItem()));
+ break;
+ case KPV_ID_CLOSE : emit(closeURL(item->url())); break; //we can access "item" later as it isn't deleted
+ case KPV_ID_OPENWITH :
+ KRun::displayOpenWithDialog(item->url());
+ break;
+ default : break;
+ }
+ }
+ }
+}
+
+void KileProjectView::slotProject(int id)
+{
+ KileProjectViewItem *item = static_cast<KileProjectViewItem*>(currentItem());
+ if ( item )
+ {
+ if ( item->type() == KileType::Project )
+ {
+ switch (id)
+ {
+ case KPV_ID_BUILDTREE : emit(buildProjectTree(item->url())); break;
+ case KPV_ID_OPTIONS : emit(projectOptions(item->url())); break;
+ case KPV_ID_CLOSE : emit(closeProject(item->url())); return; //don't access "item" later on
+ case KPV_ID_ARCHIVE : emit(projectArchive(item->url())); break;
+ case KPV_ID_ADDFILES : emit(addFiles(item->url())); break;
+ case KPV_ID_OPENALLFILES : emit(openAllFiles(item->url())); break;
+ default : break;
+ }
+ }
+ }
+}
+
+void KileProjectView::slotRun(int id)
+{
+ KileProjectViewItem *itm = static_cast<KileProjectViewItem*>(currentItem());
+
+ if (id == 0)
+ KRun::displayOpenWithDialog(itm->url());
+ else
+ KRun::run(*m_offerList[id-1], itm->url());
+
+ itm->setSelected(false);
+}
+
+//FIXME clean this mess up
+void KileProjectView::popup(KListView *, QListViewItem * item, const QPoint & point)
+{
+ if (item != 0)
+ {
+ KileProjectViewItem *itm = static_cast<KileProjectViewItem*>(item);
+ if ( itm->type() == KileType::Folder )
+ return;
+
+ m_popup->clear();
+ m_popup->disconnect();
+
+ bool isKilePrFile = false;
+ if (itm->type() != KileType::Project && itm->projectItem() && itm->projectItem()->project())
+ isKilePrFile = itm->projectItem()->project()->url() == itm->url();
+
+ bool insertsep = false;
+ if (itm->type() == KileType::ProjectExtra)
+ {
+ if ( ! isKilePrFile )
+ {
+ KPopupMenu *apps = new KPopupMenu( m_popup);
+ m_offerList = KTrader::self()->query(KMimeType::findByURL(itm->url())->name(), "Type == 'Application'");
+ for (uint i=0; i < m_offerList.count(); ++i)
+ apps->insertItem(SmallIcon(m_offerList[i]->icon()), m_offerList[i]->name(), i+1);
+
+ apps->insertSeparator();
+ apps->insertItem(i18n("Other..."), 0);
+ connect(apps, SIGNAL(activated(int)), this, SLOT(slotRun(int)));
+ m_popup->insertItem(SmallIcon("fork"), i18n("&Open With"),apps);
+ insertsep = true;
+ }
+ }
+
+ if (itm->type() == KileType::File || itm->type() == KileType::ProjectItem)
+ {
+ if ( ! m_ki->isOpen(itm->url()) )
+ m_popup->insertItem(SmallIcon("fileopen"), i18n("&Open"), KPV_ID_OPEN);
+ else
+ m_popup->insertItem(SmallIcon("filesave"), i18n("&Save"), KPV_ID_SAVE);
+ insertsep = true;
+ }
+
+ if (itm->type() == KileType::File)
+ {
+ if ( m_nProjects > 0)
+ {
+ if ( insertsep )
+ m_popup->insertSeparator();
+ m_popup->insertItem(SmallIcon("project_add"),i18n("&Add to Project"), KPV_ID_ADD);
+ insertsep = true;
+ }
+ connect(m_popup, SIGNAL(activated(int)), this, SLOT(slotFile(int)));
+ }
+ else if (itm->type() == KileType::ProjectItem || itm->type() == KileType::ProjectExtra)
+ {
+ KileProjectItem *pi = itm->projectItem();
+ if (pi)
+ {
+ if ( insertsep )
+ m_popup->insertSeparator();
+ m_popup->insertItem(i18n("&Include in Archive"), KPV_ID_INCLUDE);
+ m_popup->setItemChecked(KPV_ID_INCLUDE, pi->archive());
+ insertsep = true;
+ }
+ if ( !isKilePrFile )
+ {
+ if ( insertsep )
+ m_popup->insertSeparator();
+ m_popup->insertItem(SmallIcon("project_remove"),i18n("&Remove From Project"), KPV_ID_REMOVE);
+ insertsep = true;
+ }
+ connect(m_popup, SIGNAL(activated(int)), this, SLOT(slotProjectItem(int)));
+ }
+ else if (itm->type() == KileType::Project)
+ {
+ if ( insertsep )
+ m_popup->insertSeparator();
+ m_popup->insertItem(i18n("A&dd Files..."), KPV_ID_ADDFILES);
+ m_popup->insertSeparator();
+ m_popup->insertItem(i18n("Open All &Project Files"), KPV_ID_OPENALLFILES);
+ m_popup->insertSeparator();
+ m_popup->insertItem(SmallIcon("relation"),i18n("Refresh Project &Tree"), KPV_ID_BUILDTREE);
+ m_popup->insertItem(SmallIcon("configure"),i18n("Project &Options"), KPV_ID_OPTIONS);
+ m_popup->insertItem(SmallIcon("package"),i18n("&Archive"), KPV_ID_ARCHIVE);
+ connect(m_popup, SIGNAL(activated(int)), this, SLOT(slotProject(int)));
+ insertsep = true;
+ }
+
+ if ( (itm->type() == KileType::File) || (itm->type() == KileType::ProjectItem) || (itm->type()== KileType::Project))
+ {
+ if ( insertsep )
+ m_popup->insertSeparator();
+ m_popup->insertItem(SmallIcon("fileclose"), i18n("&Close"), KPV_ID_CLOSE);
+ }
+
+ m_popup->exec(point);
+ }
+}
+
+void KileProjectView::makeTheConnection(KileProjectViewItem *item)
+{
+ KILE_DEBUG() << "\tmakeTheConnection " << item->text(0) << endl;
+
+ if (item->type() == KileType::Project)
+ {
+ KileProject *project = m_ki->docManager()->projectFor(item->url());
+ if (project==0)
+ kdWarning() << "makeTheConnection COULD NOT FIND AN PROJECT OBJECT FOR " << item->url().path() << endl;
+ else
+ connect(project, SIGNAL(nameChanged(const QString &)), item, SLOT(nameChanged(const QString &)));
+ }
+ else
+ {
+ KileDocument::TextInfo *docinfo = m_ki->docManager()->textInfoFor(item->url().path());
+ item->setInfo(docinfo);
+ if (docinfo ==0 ) {KILE_DEBUG() << "\tmakeTheConnection COULD NOT FIND A DOCINFO" << endl; return;}
+ connect(docinfo, SIGNAL(urlChanged(KileDocument::Info*, const KURL&)), item, SLOT(slotURLChanged(KileDocument::Info*, const KURL&)));
+ connect(docinfo, SIGNAL(isrootChanged(bool)), item, SLOT(isrootChanged(bool)));
+ //set the pixmap
+ item->isrootChanged(docinfo->isLaTeXRoot());
+ }
+}
+
+KileProjectViewItem* KileProjectView::folder(const KileProjectItem *pi, KileProjectViewItem *item)
+{
+ KileProjectViewItem *parent = parentFor(pi, item);
+
+ if (parent == 0)
+ {
+ kdError() << "no parent for " << pi->url().path() << endl;
+ return 0;
+ }
+
+ // we have already found the parent folder
+ if ( parent->type() == KileType::Folder )
+ return parent;
+
+ // we are looking at the children, if there is an existing folder for this type
+ KileProjectViewItem *folder;
+
+ // determine the foldername for this type
+ QString foldername;
+ switch ( pi->type() )
+ {
+ case (KileProjectItem::ProjectFile):
+ foldername = i18n("projectfile");
+ break;
+ case (KileProjectItem::Package):
+ foldername = i18n("packages");
+ break;
+ case (KileProjectItem::Image):
+ foldername = i18n("images");
+ break;
+ case (KileProjectItem::Other):
+ default :
+ foldername = i18n("other");
+ break;
+ }
+
+ // if there already a folder for this type on this level?
+ bool found = false;
+ folder = parent->firstChild();
+ while ( folder )
+ {
+ if ( folder->text(0) == foldername )
+ {
+ found = true;
+ break;
+ }
+ folder = folder->nextSibling();
+ }
+
+ // if no folder was found, we must create a new one
+ if ( ! found )
+ {
+ folder = new KileProjectViewItem(parent,foldername);
+ KILE_DEBUG() << "new folder: " << parent->url().url() << endl;
+
+ folder->setFolder(pi->type());
+ folder->setType(KileType::Folder);
+ }
+
+ return folder;
+}
+
+void KileProjectView::add(const KileProject *project)
+{
+ KileProjectViewItem *parent = new KileProjectViewItem(this, project);
+
+ parent->setType(KileType::Project);
+ parent->setURL(project->url());
+ parent->setOpen(true);
+ parent->setPixmap(0,SmallIcon("relation"));
+ makeTheConnection(parent);
+
+ //KileProjectViewItem *nonsrc = new KileProjectViewItem(parent, i18n("non-source"));
+ //parent->setNonSrc(nonsrc);
+
+ refreshProjectTree(project);
+
+ ++m_nProjects;
+}
+
+KileProjectViewItem * KileProjectView::projectViewItemFor(const KURL & url)
+{
+ KileProjectViewItem *item = 0;
+
+ //find project view item
+ item = static_cast<KileProjectViewItem*>(firstChild());
+
+ while ( item)
+ {
+ if ( (item->type() == KileType::Project) && (item->url() == url) )
+ break;
+ item = static_cast<KileProjectViewItem*>(item->nextSibling());
+ }
+
+ return item;
+}
+
+KileProjectViewItem * KileProjectView::itemFor(const KURL & url)
+{
+ KileProjectViewItem *item=0;
+
+ QListViewItemIterator it(this);
+ while (it.current())
+ {
+ item = static_cast<KileProjectViewItem*>(*it);
+ if (item->url() == url)
+ break;
+ ++it;
+ }
+
+ return item;
+}
+
+KileProjectViewItem* KileProjectView::parentFor(const KileProjectItem *projitem, KileProjectViewItem *projvi)
+{
+ //find parent projectviewitem of projitem
+ KileProjectItem *parpi = projitem->parent();
+ KileProjectViewItem *parpvi = projvi, *vi;
+
+ if (parpi) {
+ //find parent viewitem that has an URL parpi->url()
+ QListViewItemIterator it( projvi );
+ KILE_DEBUG() << "\tlooking for " << parpi->url().path() << endl;
+ while (it.current())
+ {
+ vi = static_cast<KileProjectViewItem*>(*it);
+ KILE_DEBUG() << "\t\t" << vi->url().path() << endl;
+ if (vi->url() == parpi->url())
+ {
+ parpvi = vi;
+ KILE_DEBUG() << "\t\tfound" <<endl;
+ break;
+ }
+ ++it;
+ }
+
+ KILE_DEBUG() << "\t\tnot found" << endl;
+ }
+ else {
+ KILE_DEBUG() << "\tlooking for folder type " << projitem->type() << endl;
+ for (parpvi = parpvi->firstChild(); parpvi; parpvi = parpvi->nextSibling())
+ {
+ if ( (parpvi->type() == KileType::Folder) && (parpvi->folder() == projitem->type()) )
+ {
+ KILE_DEBUG() << "\t\tfound" << endl;
+ break;
+ }
+ }
+ }
+
+ return (parpvi == 0) ? projvi : parpvi;
+}
+
+KileProjectViewItem* KileProjectView::add(KileProjectItem *projitem, KileProjectViewItem * projvi /* = 0*/)
+{
+ KILE_DEBUG() << "\tKileProjectView::adding projectitem " << projitem->path() << endl;
+
+ const KileProject *project = projitem->project();
+
+ if (projvi == 0 )
+ {
+ projvi= projectViewItemFor(project->url());
+ }
+
+ KILE_DEBUG() << "\tparent projectviewitem " << projvi->url().fileName() << endl;
+
+ KileProjectViewItem *item, *parent;
+
+ switch (projitem->type()) {
+ case (KileProjectItem::Source):
+ item = new KileProjectViewItem(projvi, projitem);
+ item->setType(KileType::ProjectItem);
+ item->setPixmap(0,SmallIcon("projectitem"));
+ break;
+ case (KileProjectItem::Package):
+ parent = folder(projitem, projvi);
+ item = new KileProjectViewItem(parent, projitem);
+ item->setType(KileType::ProjectItem);
+ item->setPixmap(0,SmallIcon("projectitem"));
+ break;
+ case (KileProjectItem::ProjectFile):
+ default:
+ parent = folder(projitem, projvi);
+ item = new KileProjectViewItem(parent, projitem);
+ item->setType(KileType::ProjectExtra);
+ item->setPixmap(0,SmallIcon( (projitem->type()==KileProjectItem::ProjectFile) ? "kile" : "file" ));
+ break;
+ }
+
+ item->setArchiveState(projitem->archive());
+ item->setURL(projitem->url());
+ makeTheConnection(item);
+
+ projvi->sortChildItems(0,true);
+
+ return item;
+}
+
+void KileProjectView::addTree(KileProjectItem *projitem, KileProjectViewItem * projvi)
+{
+ KileProjectViewItem * item = add(projitem, projvi);
+
+ if (projitem->firstChild())
+ addTree(projitem->firstChild(), item);
+
+ if (projitem->sibling())
+ addTree(projitem->sibling(), projvi);
+}
+
+void KileProjectView::refreshProjectTree(const KileProject *project)
+{
+ KILE_DEBUG() << "\tKileProjectView::refreshProjectTree(" << project->name() << ")" << endl;
+ KileProjectViewItem *parent= projectViewItemFor(project->url());
+
+ //clean the tree
+ if (parent)
+ {
+ KILE_DEBUG() << "\tusing parent projectviewitem " << parent->url().fileName() << endl;
+ parent->setFolder(-1);
+ QListViewItem *vi = parent->firstChild(), *next;
+ while (vi)
+ {
+ next = vi->nextSibling();
+ delete vi;
+ vi = next;
+ }
+ }
+ else
+ return;
+
+ //create the non-sources dir
+ //KileProjectViewItem *nonsrc = new KileProjectViewItem(parent, i18n("non-sources"));
+ //parent->setNonSrc(nonsrc);
+
+ QPtrList<KileProjectItem> list = *(project->rootItems());
+ QPtrListIterator<KileProjectItem> it(list);
+ while (it.current())
+ {
+ addTree(*it, parent);
+ ++it;
+ }
+
+ parent->sortChildItems(0, true);
+}
+
+void KileProjectView::add(const KURL & url)
+{
+ KILE_DEBUG() << "\tKileProjectView::adding item " << url.path() << endl;
+ //check if file is already present
+ QListViewItemIterator it( this );
+ KileProjectViewItem *item;
+ while ( it.current())
+ {
+ item = static_cast<KileProjectViewItem*>(*it);
+ if ( (item->type() != KileType::Project) && (item->url() == url) )
+ return;
+ ++it;
+ }
+
+ item = new KileProjectViewItem(this, url.fileName());
+ item->setType(KileType::File);
+ item->setURL(url);
+ makeTheConnection(item);
+}
+
+void KileProjectView::remove(const KileProject *project)
+{
+ KileProjectViewItem *item = static_cast<KileProjectViewItem*>(firstChild());
+
+ while ( item)
+ {
+ if ( item->url() == project->url() )
+ {
+ takeItem(item);
+ delete item;
+ --m_nProjects;
+ break;
+ }
+ item = static_cast<KileProjectViewItem*>(item->nextSibling());
+ }
+}
+
+/**
+ * Removes a file from the projectview, does not remove project-items. Only files without a project.
+ **/
+void KileProjectView::remove(const KURL &url)
+{
+ KileProjectViewItem *item = static_cast<KileProjectViewItem*>(firstChild());
+
+ while ( item)
+ {
+ if ( (item->type() == KileType::File) && (item->url() == url) )
+ {
+ takeItem(item);
+ delete item;
+ break;
+ }
+ item = static_cast<KileProjectViewItem*>(item->nextSibling());
+ }
+}
+
+void KileProjectView::removeItem(const KileProjectItem *projitem, bool open)
+{
+ QListViewItemIterator it( this );
+ KileProjectViewItem *item;
+ while ( it.current())
+ {
+ item = static_cast<KileProjectViewItem*>(*it);
+ if ( (item->type() == KileType::ProjectItem) && (item->projectItem() == projitem) )
+ {
+ KILE_DEBUG() << "removing projectviewitem" << endl;
+ item->parent()->takeItem(item);
+ delete item;
+ }
+ ++it;
+ }
+
+ if ( open )
+ {
+ item = new KileProjectViewItem(this, projitem->url().fileName());
+ item->setType(KileType::File);
+ item->setURL(projitem->url());
+ makeTheConnection(item);
+ }
+
+}
+
+bool KileProjectView::acceptDrag(QDropEvent *e) const
+{
+ return KURLDrag::canDecode(e); // only accept URL drops
+}
+
+#include "kileprojectview.moc"
diff --git a/src/kile/kileprojectview.h b/src/kile/kileprojectview.h
new file mode 100644
index 0000000..6761428
--- /dev/null
+++ b/src/kile/kileprojectview.h
@@ -0,0 +1,163 @@
+/***************************************************************************
+ begin : Tue Aug 12 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ (C) 2006 by Michel Ludwig
+ email : Jeroen.Wijnhout@kdemail.net
+ michel.ludwig@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef KILEPROJECTVIEW_H
+#define KILEPROJECTVIEW_H
+
+#include <ktrader.h>
+#include <klistview.h>
+
+#include "kileproject.h"
+
+class KURL;
+class KPopupMenu;
+class KToggleAction;
+class KileDocument::Info;
+class KileInfo;
+
+namespace KileType {enum ProjectView { Project=0, ProjectItem, ProjectExtra, File, Folder};}
+
+class KileProjectViewItem : public QObject, public KListViewItem
+{
+ Q_OBJECT
+
+public:
+ KileProjectViewItem (QListView *parent, KileProjectItem *item, bool ar = false) : KListViewItem(parent, item->url().fileName()), m_folder(-1), m_projectItem(item) { setArchiveState(ar);}
+ KileProjectViewItem (QListView *parent, QListViewItem *after, KileProjectItem *item, bool ar = false) : KListViewItem(parent, after, item->url().fileName()), m_folder(-1), m_projectItem(item) { setArchiveState(ar);}
+ KileProjectViewItem (QListViewItem *parent, KileProjectItem *item, bool ar = false) : KListViewItem(parent, item->url().fileName()), m_folder(-1), m_projectItem(item) { setArchiveState(ar);}
+
+ //use this to create folders
+ KileProjectViewItem (QListViewItem *parent, const QString & name) : KListViewItem(parent, name), m_folder(-1), m_projectItem(0L) {}
+
+ //use this to create non-project files
+ KileProjectViewItem (QListView *parent, const QString & name) : KListViewItem(parent, name), m_folder(-1), m_projectItem(0L) {}
+
+ KileProjectViewItem (QListView *parent, const KileProject *project) : KListViewItem(parent, project->name()), m_folder(-1), m_projectItem(0L) {}
+
+
+ ~KileProjectViewItem() {KILE_DEBUG() << "DELETING PROJVIEWITEM " << m_url.fileName() << endl;}
+
+ KileProjectItem* projectItem() { return m_projectItem; }
+
+ KileProjectViewItem* parent() { return dynamic_cast<KileProjectViewItem*>(KListViewItem::parent()); }
+ KileProjectViewItem* firstChild() { return dynamic_cast<KileProjectViewItem*>(KListViewItem::firstChild()); }
+ KileProjectViewItem* nextSibling() { return dynamic_cast<KileProjectViewItem*>(KListViewItem::nextSibling()); }
+
+ void setInfo(KileDocument::Info *docinfo) { m_docinfo = docinfo;}
+ KileDocument::Info * getInfo() { return m_docinfo;}
+
+ void setType(KileType::ProjectView type) {m_type = type;}
+ KileType::ProjectView type() const { return m_type;}
+
+ int compare(QListViewItem * i, int col, bool ascending) const;
+
+ void setURL(const KURL & url) { m_url=url;}
+ const KURL& url() { return m_url;}
+
+ void setArchiveState(bool ar) { setText(1,ar ? "*" : "");}
+
+ void setFolder(int folder) { m_folder = folder; }
+ int folder() { return m_folder; }
+
+public slots:
+ /**
+ * @warning Does nothing if "url" is empty !
+ **/
+ void urlChanged(const KURL & url);
+ void nameChanged(const QString & name);
+ void isrootChanged(bool isroot);
+
+private slots:
+ /**
+ * Dummy slot, simply forwarding to urlChanged(const KURL& url).
+ **/
+ void slotURLChanged(KileDocument::Info*, const KURL & url);
+
+
+private:
+ KURL m_url;
+ KileType::ProjectView m_type;
+ KileDocument::Info *m_docinfo;
+ int m_folder;
+ KileProjectItem *m_projectItem;
+};
+
+class KileProjectView : public KListView
+{
+ Q_OBJECT
+
+public:
+ KileProjectView(QWidget *parent, KileInfo *ki);
+
+signals:
+ void fileSelected(const KileProjectItem *);
+ void fileSelected(const KURL &);
+ void saveURL(const KURL&);
+ void closeURL(const KURL&);
+ void projectOptions(const KURL &);
+ void projectArchive(const KURL &);
+ void addFiles(const KURL &);
+ void openAllFiles(const KURL &);
+ void toggleArchive(KileProjectItem *);
+ void closeProject(const KURL &);
+ void addToProject(const KURL &);
+ void removeFromProject(const KileProjectItem *);
+ void buildProjectTree(const KURL &);
+
+public slots:
+ void slotClicked(QListViewItem * item = 0);
+
+ void slotFile(int id);
+ void slotProjectItem(int id);
+ void slotProject(int id);
+
+ void slotRun(int id);
+
+ void refreshProjectTree(const KileProject *);
+ void add(const KURL & url);
+ void add(const KileProject *project);
+ void remove(const KURL & url);
+ void remove(const KileProject *project);
+ void removeItem(const KileProjectItem *, bool);
+ KileProjectViewItem* add(KileProjectItem *item, KileProjectViewItem * projvi = 0);
+
+public:
+ void addTree(KileProjectItem *item, KileProjectViewItem * projvi );
+
+ KileProjectViewItem* projectViewItemFor(const KURL &);
+ KileProjectViewItem* itemFor(const KURL &);
+ KileProjectViewItem* parentFor(const KileProjectItem *projitem, KileProjectViewItem *projvi);
+
+protected:
+ virtual bool acceptDrag(QDropEvent *e) const;
+
+private slots:
+ void popup(KListView *, QListViewItem *, const QPoint &);
+
+private:
+ void makeTheConnection(KileProjectViewItem *);
+ KileProjectViewItem* folder(const KileProjectItem *item, KileProjectViewItem *);
+
+private:
+ KileInfo *m_ki;
+ KPopupMenu *m_popup;
+ uint m_nProjects;
+ KToggleAction *m_toggle;
+
+ KTrader::OfferList m_offerList;
+};
+
+#endif
diff --git a/src/kile/kilesidebar.cpp b/src/kile/kilesidebar.cpp
new file mode 100644
index 0000000..abeda90
--- /dev/null
+++ b/src/kile/kilesidebar.cpp
@@ -0,0 +1,272 @@
+/**************************************************************************************
+ begin : Fri 18-06-2004
+ edit : Wed 1 Jun 2006
+ copyright : (C) 2004 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
+ (C) 2006 by Thomas Braun (braun@physik.fu-berlin.de)
+ (C) 2006 by Michel Ludwig (michel.ludwig@kdemail.net)
+ **************************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kilesidebar.h"
+
+#include <qwidgetstack.h>
+#include <qlayout.h>
+
+#include <kdeversion.h>
+#include "kiledebug.h"
+#include "kilemultitabbar.h"
+
+#include "symbolview.h"
+
+KileSideBar::KileSideBar(int size, QWidget *parent, const char *name, Qt::Orientation orientation /*= Vertical*/) :
+ QFrame(parent, name),
+ m_nTabs(0),
+ m_nCurrent(0),
+ m_bMinimized(false),
+ m_nMinSize(0),
+ m_nMaxSize(1000),
+ m_nSize(size)
+{
+ setLineWidth(0);
+ setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
+
+ QLayout *layout;
+
+ m_tabStack = new QWidgetStack(this);
+ m_tabStack->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
+
+ KileMultiTabBar::KileMultiTabBarMode tabbarori = KileMultiTabBar::Horizontal;
+ KileMultiTabBar::KileMultiTabBarPosition tabbarpos = KileMultiTabBar::Top;
+ if ( orientation == Qt::Horizontal )
+ {
+ layout = new QVBoxLayout(this);
+ tabbarori = KileMultiTabBar::Horizontal;
+ tabbarpos = KileMultiTabBar::Top;
+ }
+ else if ( orientation == Qt::Vertical )
+ {
+ layout = new QHBoxLayout(this);
+ tabbarori = KileMultiTabBar::Vertical;
+ tabbarpos = KileMultiTabBar::Right;
+ }
+
+ m_tabBar = new KileMultiTabBar(tabbarori, this);
+ m_tabBar->setPosition(tabbarpos);
+
+ #if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
+ m_tabBar->setStyle(KileMultiTabBar::KDEV3ICON);
+ #else
+ m_tabBar->setStyle(KileMultiTabBar::KDEV3);
+ #endif
+
+ if ( orientation == Qt::Horizontal )
+ {
+ setMinimumHeight(m_tabBar->height());
+ m_nMinSize = m_tabBar->height();
+ m_nMaxSize = m_tabBar->maximumHeight();
+ layout->add(m_tabBar);
+ layout->add(m_tabStack);
+ }
+ else if ( orientation == Qt::Vertical )
+ {
+ setMinimumWidth(m_tabBar->width());
+ m_nMinSize = m_tabBar->width();
+ m_nMaxSize = m_tabBar->maximumWidth();
+ layout->add(m_tabStack);
+ layout->add(m_tabBar);
+ }
+}
+
+KileSideBar::~KileSideBar()
+{
+}
+
+int KileSideBar::addTab(QWidget *tab, const QPixmap &pic, const QString &text /* = QString::null*/)
+{
+ m_widgetToIndex[tab] = m_nTabs;
+
+ m_tabBar->appendTab(pic, m_nTabs, text);
+ m_tabStack->addWidget(tab, m_nTabs);
+ connect(m_tabBar->tab(m_nTabs), SIGNAL(clicked(int)), this, SLOT(showTab(int)));
+
+ return m_nTabs++;
+}
+
+
+void KileSideBar::setVisible(bool show)
+{
+ KILE_DEBUG() << "==KileSideBar::setVisible(" << show << ")===========" << endl;
+ if (show) expand();
+ else shrink();
+}
+
+void KileSideBar::shrink()
+{
+ if ( !isVisible() ) return;
+
+ m_bMinimized = true;
+
+ m_nSize = width();
+ m_nMinSize = minimumWidth();
+ m_nMaxSize = maximumWidth();
+
+ m_tabStack->hide();
+ setFixedWidth(m_tabBar->width());
+
+ emit visibilityChanged(false);
+}
+
+void KileSideBar::expand()
+{
+ if ( isVisible() ) return;
+
+ m_bMinimized = false;
+
+ m_tabStack->show();
+
+ resize(m_nSize, height());
+ setMinimumWidth(m_nMinSize);
+ setMaximumWidth(m_nMaxSize);
+
+ emit visibilityChanged(true);
+}
+
+QWidget* KileSideBar::currentPage()
+{
+ return m_tabStack->visibleWidget();
+}
+
+int KileSideBar::findNextShownTab(int i)
+{
+ if(m_nTabs <= 0)
+ {
+ return -1;
+ }
+ for(int j = 1; j < m_nTabs; ++j)
+ {
+ int index = (i + j) % m_nTabs;
+ if(m_tabBar->tab(index)->isShown())
+ {
+ return index;
+ }
+ }
+ return -1;
+}
+
+void KileSideBar::removePage(QWidget *w)
+{
+ QMap<QWidget*,int>::iterator it = m_widgetToIndex.find(w);
+ if(it == m_widgetToIndex.end())
+ {
+ return;
+ }
+ int index = *it;
+ m_tabStack->removeWidget(w);
+ disconnect(m_tabBar->tab(index), SIGNAL(clicked(int)), this, SLOT(showTab(int)));
+ m_tabBar->removeTab(index);
+ m_widgetToIndex.remove(it);
+ if(index == m_nCurrent && m_nTabs >= 2)
+ {
+ showTab(findNextShownTab(index));
+ }
+ --m_nTabs;
+}
+
+void KileSideBar::setPageVisible(QWidget *w, bool b) {
+ QMap<QWidget*,int>::iterator it = m_widgetToIndex.find(w);
+ if(it == m_widgetToIndex.end())
+ {
+ return;
+ }
+ int index = *it;
+ KileMultiTabBarTab *tab = m_tabBar->tab(index);
+ if(tab->isShown() == b) {
+ return;
+ }
+ tab->setShown(b);
+ if(!b && index == m_nCurrent && m_nTabs >= 2)
+ {
+ showTab(findNextShownTab(index));
+ }
+}
+
+void KileSideBar::showPage(QWidget *widget)
+{
+ if ( m_widgetToIndex.contains(widget) )
+ switchToTab(m_widgetToIndex[widget]);
+}
+
+void KileSideBar::showTab(int id)
+{
+ if(id >= m_nTabs || id < 0)
+ {
+ return;
+ }
+ if ( id != m_nCurrent)
+ {
+ switchToTab(id);
+ if (m_bMinimized) expand();
+ }
+ else
+ toggleTab();
+}
+
+void KileSideBar::toggleTab()
+{
+ if (m_bMinimized) expand();
+ else shrink();
+}
+
+void KileSideBar::switchToTab(int id)
+{
+ if(id >= m_nTabs || id < 0) {
+ return;
+ }
+ m_tabBar->setTab(m_nCurrent, false);
+ m_tabBar->setTab(id, true);
+
+ m_tabStack->raiseWidget(id);
+
+ m_nCurrent = id;
+}
+
+KileBottomBar::KileBottomBar(int size, QWidget *parent, const char *name) :
+ KileSideBar(size, parent, name, Qt::Horizontal)
+{}
+
+void KileBottomBar::shrink()
+{
+ m_bMinimized = true;
+
+ m_nSize = height();
+ m_nMinSize = minimumHeight();
+ m_nMaxSize = maximumHeight();
+
+ m_tabStack->hide();
+ setFixedHeight(m_tabBar->height());
+
+ emit visibilityChanged(false);
+}
+
+void KileBottomBar::expand()
+{
+ m_bMinimized = false;
+
+ m_tabStack->show();
+
+ resize(width(), m_nSize);
+ setMinimumHeight(m_nMinSize);
+ setMaximumHeight(m_nMaxSize);
+
+ emit visibilityChanged(true);
+}
+
+#include "kilesidebar.moc"
diff --git a/src/kile/kilesidebar.h b/src/kile/kilesidebar.h
new file mode 100644
index 0000000..8a713d1
--- /dev/null
+++ b/src/kile/kilesidebar.h
@@ -0,0 +1,99 @@
+/**************************************************************************************
+ begin : Fri 18-06-2004
+ edit : Wed 1 Jun 2006
+ copyright : (C) 2004 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
+ (C) 2006 by Thomas Braun (braun@physik.fu-berlin.de)
+ (C) 2006 by Michel Ludwig (michel.ludwig@kdemail.net)
+ **************************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILESIDEBAR_H
+#define KILESIDEBAR_H
+
+#include <qframe.h>
+#include <qmap.h>
+
+class QWidgetStack;
+class KileMultiTabBar;
+class SymbolView;
+
+/**
+@author Jeroen Wijnhout
+*/
+class KileSideBar : public QFrame
+{
+ Q_OBJECT
+
+public:
+ KileSideBar(int size, QWidget *parent = 0, const char *name = 0, Qt::Orientation orientation = Qt::Vertical);
+ ~KileSideBar();
+
+ int addTab(QWidget *tab, const QPixmap &pic, const QString &text = QString::null);
+
+ int currentTab() { return m_nCurrent; }
+
+ bool isVisible() { return !m_bMinimized; }
+
+ void setSize(int sz) { m_nSize = sz; }
+ int size() { return m_nSize; }
+
+ QWidget* currentPage();
+ void removePage(QWidget *w);
+
+ /**
+ * Shows or hides the tab connected to the widget "w". If the tab to be hidden is
+ * currently selected, the next tab will be shown (cyclically).
+ *
+ * @param b set to "true" to show the tab connected to the widget "w", "false" to
+ * hide it
+ **/
+ void setPageVisible(QWidget *w, bool b);
+
+signals:
+ void visibilityChanged(bool );
+
+public slots:
+ void setVisible(bool );
+
+ virtual void shrink();
+ virtual void expand();
+
+ void showTab(int);
+ void showPage(QWidget *);
+ void toggleTab();
+ void switchToTab(int id);
+
+private:
+ int findNextShownTab(int i);
+
+protected:
+ QWidgetStack *m_tabStack;
+ KileMultiTabBar *m_tabBar;
+ int m_nTabs;
+ int m_nCurrent;
+ QMap<int,int> m_indexToPage;
+ QMap<QWidget*,int> m_widgetToIndex;
+ bool m_bMinimized;
+ int m_nMinSize, m_nMaxSize, m_nSize;
+};
+
+class KileBottomBar : public KileSideBar
+{
+ Q_OBJECT
+
+public:
+ KileBottomBar(int size, QWidget *parent = 0, const char *name = 0);
+
+ void shrink();
+ void expand();
+};
+
+#endif
diff --git a/src/kile/kilestatsdlg.cpp b/src/kile/kilestatsdlg.cpp
new file mode 100644
index 0000000..a351469
--- /dev/null
+++ b/src/kile/kilestatsdlg.cpp
@@ -0,0 +1,207 @@
+/***************************************************************************
+ begin : Tuesday Nov 1 2005
+ copyright : (C) 2005 by Thomas Braun
+ email : braun@physik.fu-berlin.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kilestatsdlg.h"
+
+// A dialog that displays statistical information about the active project/file
+
+KileStatsDlg::KileStatsDlg(KileProject *project, KileDocument::TextInfo* docinfo, QWidget* parent, const char* name, const QString &caption)
+ : KDialogBase(KDialogBase::Tabbed,0,parent,name,true,caption, KDialogBase::Help | KDialogBase::Ok | KDialogBase::User1 | KDialogBase::User2 , KDialogBase::Ok, false),
+ m_project(project),
+ m_docinfo(docinfo)
+{
+ setButtonText(KDialogBase::User1,i18n("Copy"));
+ setButtonText(KDialogBase::User2,i18n("Copy as LaTeX"));
+ setHelp("statistics");
+
+ m_summarystats = new long[SIZE_STAT_ARRAY];
+ m_summarystats[0]=m_summarystats[1]=m_summarystats[2]=m_summarystats[3]=m_summarystats[4]=m_summarystats[5]=0;
+
+ const long* stats;
+ QString tempName;
+ uint index=0;
+ KileWidgetStatistics* tempWidget;
+ KileWidgetStatistics* summary;
+ KileDocument::TextInfo* tempDocinfo;
+
+ m_hasSelection=false; // class variable, if the user has selected text,
+ summary = new KileWidgetStatistics( addPage( i18n("Summary") ) );
+ summary->m_commentAboutHelp->setText(i18n("For information about the accuracy see the Help."));
+ // we have in every case a summary tab
+
+ m_pagetowidget[index]=summary;
+ m_pagetoname[index]=i18n("Summary");
+ index++; // used with activePageIndex() to get the active widget and the tabname, arrays would be more efficient, but Maps are less dangerous
+
+ if(m_docinfo->getDoc()->hasSelection()) // the user should really have that doc as active in which the selection is
+ m_hasSelection=true;
+
+
+ if(!m_project) // the active doc doesn't belong to a project
+ {
+ setCaption(i18n("Statistics for %1").arg(m_docinfo->getDoc()->url().fileName()));
+ stats = m_docinfo->getStatistics();
+ fillWidget(stats,summary);
+ }
+ else // active doc belongs to a project
+ {
+ setCaption(i18n("Statistics for the Project %1").arg(m_project->name()));
+ KILE_DEBUG() << "Project file is " << project->baseURL() << endl;
+
+ KileProjectItemList *items = project->items();
+
+ if(m_hasSelection) // if the active doc has a selection
+ {
+ stats = m_docinfo->getStatistics();
+ fillWidget(stats,summary); // if yes we fill the summary widget and are finished
+ }
+ else
+ {
+ for(uint k = 0; k < items->count() ; k++)
+ {
+ if(items->at(k)->type() == KileProjectItem::ProjectFile) // ignore project files
+ continue;
+
+ tempDocinfo = items->at(k)->getInfo();
+ if(tempDocinfo && tempDocinfo->getDoc()) // closed items don't have a doc
+ {
+ tempName = tempDocinfo->getDoc()->url().fileName();
+ stats = tempDocinfo->getStatistics();
+
+ for(uint j = 0; j < SIZE_STAT_ARRAY; j++)
+ m_summarystats[j]+=stats[j];
+
+ tempWidget = new KileWidgetStatistics( addPage(tempName) );
+ KILE_DEBUG() << "TempName is " << tempName << endl;
+ m_pagetowidget[index]=tempWidget;
+ m_pagetoname[index]=tempName;
+ index++;
+ fillWidget(stats, tempWidget);
+ }
+ else
+ m_notAllFilesOpenWarning=true; // print warning
+ }
+
+ fillWidget(m_summarystats,summary);
+ if(m_notAllFilesOpenWarning)
+ summary->m_warning->setText(i18n("To get statistics for all project files, you have to open them all."));
+
+#if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
+ KILE_DEBUG() << "All keys in name " << m_pagetoname.keys() << " Nr. of keys " << m_pagetowidget.count() << endl;
+ KILE_DEBUG() << "All keys in widget " << m_pagetowidget.keys() << " Nr. of keys " << m_pagetowidget.count() << endl;
+#endif
+ }
+ }
+// setInitialSize( QSize(550,560), true);
+}
+
+KileStatsDlg::~KileStatsDlg()
+{
+ delete [] m_summarystats;
+}
+
+
+void KileStatsDlg::fillWidget(const long* stats, KileWidgetStatistics* widget)
+{
+
+// we don't have to write 0's in the number labels because this is the default value
+if (!stats || !widget)
+ return;
+
+if(m_hasSelection)
+ widget->m_warning->setText(i18n("WARNING: These are the statistics for the selected text only."));
+
+widget->m_wordChar->setText(QString::number(stats[0]));
+widget->m_commandChar->setText(QString::number(stats[1]));
+widget->m_whitespaceChar->setText(QString::number(stats[2]));
+widget->m_totalChar->setText(QString::number(stats[0]+stats[1]+stats[2]));
+
+widget->m_wordString->setText(QString::number(stats[3]));
+widget->m_commandString->setText(QString::number(stats[4]));
+widget->m_environmentString->setText(QString::number(stats[5]));
+widget->m_totalString->setText(QString::number(stats[3]+stats[4]+stats[5]));
+
+widget->updateColumns();
+}
+
+void KileStatsDlg::slotUser1() // Copy
+{
+ KILE_DEBUG() << "Copy Button was clicked" << endl;
+ KILE_DEBUG() << "Open tab is " << activePageIndex() << ' ' + ( m_pagetoname.contains(activePageIndex()) ? m_pagetoname[activePageIndex()] : "No such entry" )<< endl;
+
+ QClipboard *clip = KApplication::clipboard();
+ QString text;
+ convertText(&text,false);
+ clip->setText(text,QClipboard::Selection); // the text will be available with the middle mouse button
+}
+
+void KileStatsDlg::slotUser2() // CopyAsLaTeX
+{
+ KILE_DEBUG() << "CopyAsLateX Button was clicked" << endl;
+ KILE_DEBUG() << "Open tab is " << activePageIndex() << ' ' + ( m_pagetoname.contains(activePageIndex()) ? m_pagetoname[activePageIndex()] : "No such entry" )<< endl;
+
+ QClipboard *clip = KApplication::clipboard();
+ QString text;
+ convertText(&text,true);
+ clip->setText(text,QClipboard::Selection);
+}
+
+void KileStatsDlg::convertText(QString* text, bool forLaTeX) // the bool determines if we want plainText or LaTeXCode
+{
+ KileWidgetStatistics* widget = m_pagetowidget[activePageIndex()];
+ QString name = m_pagetoname[activePageIndex()];
+ QString charGroupName = i18n("Characters"); // always ensure that these are the same than in kilestatswidget.ui, there is no way to get the label of a button group, so this ugly hack is needed
+ QString stringGroupName = i18n("Strings");
+
+ if (forLaTeX)
+ text->append("\\begin{tabular}{ll}\n");
+
+if(m_project && activePageIndex())
+ text->append(i18n("Statistics for project %1, file %2").arg(m_project->name()).arg(name));
+else if(m_project)
+ text->append(i18n("Statistics for project %1").arg(m_project->name()));
+else if(m_docinfo->getDoc()->url().isValid())
+ text->append(i18n("Statistics for %1").arg(m_docinfo->getDoc()->url().fileName()));
+else
+ text->append(i18n("Statistics for Untitled"));
+
+ if (forLaTeX)
+ text->append(" & \\\\\\hline\n");
+ else
+ text->append("\n\n");
+ text->append(charGroupName + ( forLaTeX ? " & \\\\\n" : "\n") );
+ text->append(widget->m_wordCharText->text() + ( forLaTeX ? " & " : "\t" ) + widget->m_wordChar->text() + ( forLaTeX ? " \\\\\n" : "\n"));
+ text->append(widget->m_commandCharText->text() + ( forLaTeX ? " & " : "\t" ) + widget->m_commandChar->text() + ( forLaTeX ? " \\\\\n" : "\n"));
+ text->append(widget->m_whitespaceCharText->text() + ( forLaTeX ? " & " : "\t" ) + widget->m_whitespaceChar->text() + ( forLaTeX ? " \\\\\n" : "\n"));
+ text->append(widget->m_totalCharText->text() + ( forLaTeX ? " & " : "\t" ) + widget->m_totalChar->text() + ( forLaTeX ? " \\\\\n" : "\n"));
+
+ text->append( ( forLaTeX ? " & \\\\\n" : "\n") );
+ text->append(stringGroupName + ( forLaTeX ? " & \\\\\n" : "\n") );
+ text->append(widget->m_wordStringText->text() + ( forLaTeX ? " & " : "\t" ) + widget->m_wordString->text() + ( forLaTeX ? " \\\\\n" : "\n"));
+ text->append(widget->m_commandStringText->text() + ( forLaTeX ? " & " : "\t" ) + widget->m_commandString->text() + ( forLaTeX ? " \\\\\n" : "\n"));
+ text->append(widget->m_environmentStringText->text() + ( forLaTeX ? " & " : "\t" ) + widget->m_environmentString->text() + ( forLaTeX ? " \\\\\n" : "\n"));
+ text->append(widget->m_totalStringText->text() + ( forLaTeX ? " & " : "\t" ) + widget->m_totalString->text() + ( forLaTeX ? " \\\\\\hline\n": "\n"));
+
+ if (forLaTeX)
+ text->append("\\end{tabular}\n");
+
+ if(m_hasSelection) // we can't have both cases
+ text->append( ( forLaTeX? "\\par\\bigskip\n": "\n") + widget->m_warning->text() + '\n');
+ else if(m_notAllFilesOpenWarning)
+ text->append( ( forLaTeX? "\\par\\bigskip\n": "\n") + widget->m_warning->text() + '\n');
+}
+
+
+
diff --git a/src/kile/kilestatsdlg.h b/src/kile/kilestatsdlg.h
new file mode 100644
index 0000000..e1aeb50
--- /dev/null
+++ b/src/kile/kilestatsdlg.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ begin : Tuesday Nov 1 2005
+ copyright : (C) 2005 by Thomas Braun
+ email : braun@physik.fu-berlin.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILESTATSDLG_H
+#define KILESTATSDLG_H
+
+
+#include <kdialogbase.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <qclipboard.h>
+#include <qlabel.h>
+
+#include "kileproject.h"
+#include "kiledocumentinfo.h"
+#include "kilestatswidget.h"
+
+class KileStatsDlg : public KDialogBase
+{
+public:
+ KileStatsDlg(KileProject *project, KileDocument::TextInfo* docinfo, QWidget* parent = 0, const char* name = 0, const QString &caption = QString::null);
+ ~KileStatsDlg();
+
+private:
+ void fillWidget (const long* stats, KileWidgetStatistics* widget);
+ void slotUser1();
+ void slotUser2();
+ void convertText(QString* text, bool forLaTeX);
+
+protected:
+ KileProject *m_project;
+ KileDocument::TextInfo *m_docinfo;
+ long *m_summarystats;
+ bool m_hasSelection;
+ bool m_notAllFilesOpenWarning;
+ QMap<int, KileWidgetStatistics*> m_pagetowidget;
+ QMap<int, QString> m_pagetoname;
+};
+
+#endif
diff --git a/src/kile/kilestatswidget.cpp b/src/kile/kilestatswidget.cpp
new file mode 100644
index 0000000..63ac7e6
--- /dev/null
+++ b/src/kile/kilestatswidget.cpp
@@ -0,0 +1,133 @@
+/***************************************************************************
+ begin : Tuesday Nov 15 2005
+ copyright : (C) 2005 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kilestatswidget.h"
+
+#include <kdialog.h>
+#include <klocale.h>
+
+#include <qvariant.h>
+#include <qlabel.h>
+#include <qbuttongroup.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include "kiledebug.h"
+
+KileWidgetStatistics::KileWidgetStatistics( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ QVBoxLayout *vbox = new QVBoxLayout(parent, 5,KDialog::spacingHint() );
+
+ // characters groupbox
+ QGroupBox *chargroup = new QGroupBox( i18n("Characters"),parent);
+ chargroup->setColumnLayout(0, Qt::Vertical );
+ chargroup->layout()->setSpacing( 6 );
+ chargroup->layout()->setMargin( 11 );
+ chargrouplayout = new QGridLayout( chargroup->layout() );
+ chargrouplayout->setAlignment( Qt::AlignTop );
+
+ m_wordCharText = new QLabel(i18n("Words and numbers:"), chargroup);
+ m_commandCharText = new QLabel(i18n("LaTeX commands and environments:"), chargroup);
+ m_whitespaceCharText = new QLabel(i18n("Punctuation, delimiter and whitespaces:"), chargroup);
+ m_totalCharText = new QLabel(i18n("Total characters:"), chargroup);
+ m_wordChar = new QLabel( chargroup, "m_wordChar" );
+ m_commandChar = new QLabel( chargroup, "m_commandChar" );
+ m_whitespaceChar = new QLabel( chargroup, "m_whitespaceChar" );
+ m_totalChar = new QLabel( chargroup, "m_totalChar" );
+
+ QFrame *charframe = new QFrame(chargroup);
+ charframe->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ charframe->setLineWidth(1);
+
+ chargrouplayout->addWidget( m_wordCharText, 0,0 );
+ chargrouplayout->addWidget( m_commandCharText, 1,0 );
+ chargrouplayout->addWidget( m_whitespaceCharText, 2,0 );
+ chargrouplayout->addWidget( m_totalCharText, 4,0 );
+ chargrouplayout->addWidget( m_wordChar, 0,2,Qt::AlignRight );
+ chargrouplayout->addWidget( m_commandChar, 1,2,Qt::AlignRight );
+ chargrouplayout->addWidget( m_whitespaceChar, 2,2,Qt::AlignRight );
+ chargrouplayout->addMultiCellWidget( charframe, 3,3,1,2 );
+ chargrouplayout->addWidget( m_totalChar, 4,2,Qt::AlignRight );
+ chargrouplayout->setColSpacing(1,16);
+ chargrouplayout->setColSpacing(3,1);
+ chargrouplayout->setColStretch(3,1);
+
+ // string groupbox
+ QGroupBox *stringgroup = new QGroupBox( i18n("Strings"),parent);
+ stringgroup->setColumnLayout(0, Qt::Vertical );
+ stringgroup->layout()->setSpacing( 6 );
+ stringgroup->layout()->setMargin( 11 );
+ stringgrouplayout = new QGridLayout( stringgroup->layout() );
+ stringgrouplayout->setAlignment( Qt::AlignTop );
+
+ m_wordStringText = new QLabel(i18n("Words:"), stringgroup);
+ m_commandStringText = new QLabel(i18n("LaTeX commands:"), stringgroup);
+ m_environmentStringText = new QLabel(i18n("LaTeX environments:"), stringgroup);
+ m_totalStringText = new QLabel(i18n("Total strings:"), stringgroup);
+ m_wordString = new QLabel( stringgroup, "m_wordString" );
+ m_commandString = new QLabel( stringgroup, "m_commandStringText" );
+ m_environmentString = new QLabel( stringgroup, "m_environmentStringText" );
+ m_totalString = new QLabel( stringgroup, "m_totalStringText" );
+
+ QFrame *stringframe = new QFrame(stringgroup);
+ stringframe->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ stringframe->setLineWidth(1);
+
+ stringgrouplayout->addWidget( m_wordStringText, 0,0 );
+ stringgrouplayout->addWidget( m_commandStringText, 1,0 );
+ stringgrouplayout->addWidget( m_environmentStringText, 2,0 );
+ stringgrouplayout->addWidget( m_totalStringText, 4,0 );
+ stringgrouplayout->addWidget( m_wordString, 0,2,Qt::AlignRight );
+ stringgrouplayout->addWidget( m_commandString, 1,2,Qt::AlignRight );
+ stringgrouplayout->addWidget( m_environmentString, 2,2,Qt::AlignRight );
+ stringgrouplayout->addMultiCellWidget( stringframe, 3,3,1,2 );
+ stringgrouplayout->addWidget( m_totalString, 4,2,Qt::AlignRight );
+ stringgrouplayout->setColSpacing(1,16);
+ stringgrouplayout->setColSpacing(3,1);
+ stringgrouplayout->setColStretch(3,1);
+
+ m_commentAboutHelp = new QLabel(parent);
+ m_warning = new QLabel(parent);
+
+ vbox->addWidget(chargroup);
+ vbox->addWidget(stringgroup);
+ vbox->addSpacing(12);
+ vbox->addWidget(m_commentAboutHelp);
+ vbox->addWidget(m_warning);
+ vbox->addStretch(1);
+
+ int w = m_commandCharText->sizeHint().width();
+ if ( m_whitespaceCharText->sizeHint().width() > w )
+ w = m_whitespaceCharText->sizeHint().width();
+ stringgrouplayout->setColSpacing(0,w);
+
+}
+
+KileWidgetStatistics::~KileWidgetStatistics()
+{
+}
+
+void KileWidgetStatistics::updateColumns()
+{
+ int w = m_totalChar->sizeHint().width();
+ if ( m_totalString->sizeHint().width() > w )
+ w = m_totalString->sizeHint().width();
+ chargrouplayout->setColSpacing(2,w);
+ stringgrouplayout->setColSpacing(2,w);
+}
+
+
+#include "kilestatswidget.moc"
diff --git a/src/kile/kilestatswidget.h b/src/kile/kilestatswidget.h
new file mode 100644
index 0000000..d30ee64
--- /dev/null
+++ b/src/kile/kilestatswidget.h
@@ -0,0 +1,66 @@
+/***************************************************************************
+ begin : Tuesday Nov 15 2005
+ copyright : (C) 2005 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KILEWIDGETSTATISTICS_H
+#define KILEWIDGETSTATISTICS_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+
+class QVBoxLayout;
+class QGridLayout;
+class QLabel;
+class QGroupBox;
+
+class KileWidgetStatistics : public QWidget
+{
+ Q_OBJECT
+
+public:
+ KileWidgetStatistics( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KileWidgetStatistics();
+
+ QLabel* m_commentAboutHelp;
+ QLabel* m_warning;
+
+ QLabel* m_wordChar;
+ QLabel* m_commandChar;
+ QLabel* m_whitespaceChar;
+ QLabel* m_totalChar;
+ QLabel* m_wordCharText;
+ QLabel* m_commandCharText;
+ QLabel* m_whitespaceCharText;
+ QLabel* m_totalCharText;
+
+ QLabel* m_wordString;
+ QLabel* m_environmentString;
+ QLabel* m_commandString;
+ QLabel* m_totalString;
+ QLabel* m_wordStringText;
+ QLabel* m_environmentStringText;
+ QLabel* m_commandStringText;
+ QLabel* m_totalStringText;
+
+ void updateColumns();
+
+private:
+ QGridLayout *chargrouplayout;
+ QGridLayout *stringgrouplayout;
+
+
+};
+
+#endif // KILEWIDGETSTATISTICS_H
diff --git a/src/kile/kilestdactions.cpp b/src/kile/kilestdactions.cpp
new file mode 100644
index 0000000..1c17cf2
--- /dev/null
+++ b/src/kile/kilestdactions.cpp
@@ -0,0 +1,374 @@
+//
+//
+// C++ Implementation: kilestdactions
+//
+// Description:
+//
+//
+// Author: Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>, (C) 2003
+//
+// Copyright: See COPYING file that comes with parent distribution
+//
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <kmainwindow.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+
+#include "kileactions.h"
+#include "kileedit.h"
+#include "kileinfo.h"
+
+namespace KileStdActions
+{
+
+void setupStdTags(KileInfo *ki, KMainWindow *parent)
+{
+ (void) new KileAction::Tag(i18n("Document Class Selection - \\documentclass{}"),0,parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(), "tag_documentclass",
+ "\\documentclass[10pt]{","}", 21,0,i18n("\\documentclass[options]{class}\nclass : article,report,book,letter\nsize options : 10pt, 11pt, 12pt\npaper size options: a4paper, a5paper, b5paper, letterpaper, legalpaper, executivepaper\n"
+ "other options: \nlandscape -- selects landscape format; default is portrait. \ntitlepage, notitlepage -- selects if there should be a separate title page.\nleqno -- display equation number on left side of equations; default is right side.\n"
+ "fleqn -- display formulae flush left; default is centered.\nonecolumn, twocolumn -- one or two columns; defaults to one column\noneside, twoside -- selects one- or two-sided layout.\n" ));
+
+ (void) new KileAction::Tag(i18n("Package Import - \\usepackage{}"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_usepackage",
+ "\\usepackage{","}",12,0,i18n("Any options given in the \\documentclass command that are unknown by the selected document class\n"
+ "are passed on to the packages loaded with \\usepackage."));
+
+ (void) new KileAction::Tag(i18n("AMS Packages"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_amspackages","\\usepackage{amsmath}\n\\usepackage{amsfonts}\n\\usepackage{amssymb}\n",QString::null,0,3,i18n("The principal American Mathematical Society packages"));
+ (void) new KileAction::Tag(i18n("Start Document Body - \\begin{document}"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_env_document","\\begin{document}\n", "\n\\end{document}", 0,1,i18n("Text is allowed only between \\begin{document} and \\end{document}.\nThe 'preamble' (before \\begin{document} ) may contain declarations only."));
+ (void) new KileAction::Tag(i18n("Generate Title - \\maketitle"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_maketitle","\\maketitle",QString::null,10,0,i18n("This command generates a title on a separate title page\n- except in the article class, where the title normally goes at the top of the first page."));
+ (void) new KileAction::Tag(i18n("Table of Contents - \\tableofcontents"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_tableofcontents","\\tableofcontents",QString::null,16,0,i18n("Put this command where you want the table of contents to go"));
+ (void) new KileAction::Tag(i18n("Title Definition - \\title{}"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_title","\\title{","}",7,0,i18n( "\\title{text}\nThe \\title command declares text to be the title.\nUse \\\\ to tell LaTeX where to start a new line in a long title."));
+ (void) new KileAction::Tag(i18n("Author Definition - \\author{}"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_author","\\author{","}",8,0,i18n( "\\author{names}\nThe \\author command declares the author(s), where names is a list of authors separated by \\and commands."));
+
+ (void) new KileAction::Tag(i18n("Center - \\begin{center}"),"text_center",0, parent,
+ SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_center", "\\begin{center}\n","%E\n\\end{center}", 0,1, i18n("Each line must be terminated with the string \\\\."));
+ (void) new KileAction::Tag(i18n("Align Left - \\begin{flushleft}"),"text_left",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_flushleft", "\\begin{flushleft}\n","%E\n\\end{flushleft}", 0,1, i18n("Each line must be terminated with the string \\\\.") );
+ (void) new KileAction::Tag(i18n("Align Right - \\begin{flushright}"),"text_right",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_flushright", "\\begin{flushright}\n","%E\n\\end{flushright}", 0,1, i18n("Each line must be terminated with the string \\\\.") );
+ (void) new KileAction::Tag(i18n("Quote - \\begin{quote}"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_quote","\\begin{quote}\n","%E\n\\end{quote} ",0,1,i18n("The text is justified at both margins.\nLeaving a blank line between text produces a new paragraph.") );
+ (void) new KileAction::Tag(i18n("Quotation - \\begin{quotation}"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_quotation","\\begin{quotation}\n","%E\n\\end{quotation} ",0,1, i18n("The text is justified at both margins and there is paragraph indentation.\nLeaving a blank line between text produces a new paragraph.") );
+ (void) new KileAction::Tag(i18n("Verse - \\begin{verse}"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_verse", "\\begin{verse}\n","%E\n\\end{verse} ",0,1,i18n("The verse environment is designed for poetry.\nSeparate the lines of each stanza with \\\\, and use one or more blank lines to separate the stanzas.") );
+
+ (void) new KileAction::Tag(i18n("Verbatim - \\begin{verbatim}"),"verbatim",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_verbatim","\\begin{verbatim}\n","%E\n\\end{verbatim} ",0,1,i18n("Environment that gets LaTeX to print exactly what you type in."));
+ (void) new KileAction::Tag(i18n("Bulleted List - \\begin{itemize}"),"itemize",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_env_itemize","\\begin{itemize}\n%E\\item \n", "\\end{itemize}\n", 6,1,i18n("The itemize environment produces a 'bulleted' list.\nEach item of an itemized list begins with an \\item command."));
+ (void) new KileAction::Tag(i18n("Enumeration - \\begin{enumerate}"),"enumerate",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_env_enumerate","\\begin{enumerate}\n%E\\item \n","\\end{enumerate}\n", 6,1,i18n("The enumerate environment produces a numbered list.\nEach item of an enumerated list begins with an \\item command."));
+ (void) new KileAction::Tag(i18n("Description - \\begin{description}"),"description",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_env_description","\\begin{description}\n%E\\item[]\n ", "\\end{description}",6,1,i18n("The description environment is used to make labeled lists.\nEach item of the list begins with an \\item[label] command.\nThe 'label' is bold face and flushed right."));
+
+ (void) new KileAction::Tag(i18n("Table - \\begin{table}"),"frame_spreadsheet",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_table","\\begin{table}\n","%E\n\\caption{}\n\\end{table} ",0,1,
+ i18n("\\begin{table}[placement]\nbody of the table\n\\caption{table title}\n\\end{table}\nTables are objects that are not part of the normal text, and are usually floated to a convenient place\n"
+ "The optional argument [placement] determines where LaTeX will try to place your table\nh : Here - at the position in the text where the table environment appear\nt : Top - at the top of a text page\nb : Bottom - at the bottom of a text page\n"
+ "p : Page of floats - on a separate float page, which is a page containing no text, only floats\nThe body of the table is made up of whatever text, LaTeX commands, etc., you wish.\nThe \\caption command allows you to title your table."));
+
+ (void) new KileAction::Tag(i18n("Figure - \\begin{figure}"),"frame_image",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_figure" ,"\\begin{figure}\n","%E\n\\caption{}\n\\end{figure} ",0,1,
+ i18n("\\begin{figure}[placement]\nbody of the figure\n\\caption{figure title}\n\\end{figure}\nFigures are objects that are not part of the normal text, and are usually floated to a convenient place\n"
+ "The optional argument [placement] determines where LaTeX will try to place your figure\nh : Here - at the position in the text where the figure environment appear\nt : Top - at the top of a text page\n"
+ "b : Bottom - at the bottom of a text page\np : Page of floats - on a separate float page, which is a page containing no text, only floats\nThe body of the figure is made up of whatever text, LaTeX commands, etc., you wish.\nThe \\caption command allows you to title your figure."));
+
+ (void) new KileAction::Tag(i18n("Title Page - \\begin{titlepage}"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_titlepage" ,"\\begin{titlepage}\n","%E\n\\end{titlepage} ",0,1,
+ i18n("\\begin{titlepage}\ntext\n\\end{titlepage}\nThe titlepage environment creates a title page, i.e. a page with no printed page number or heading."));
+
+ new KileAction::Tag(i18n("Italics - \\textit{}"),"text_italic",Qt::ALT+Qt::SHIFT+Qt::Key_I, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_textit","\\textit{","}",8,0,i18n("\\textit{italic text}"));
+ new KileAction::Tag(i18n("Slanted - \\textsl{}"),"slanted",Qt::ALT+Qt::SHIFT+Qt::Key_A, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_textsl","\\textsl{","}",8,0,i18n("\\textsl{slanted text}"));
+ new KileAction::Tag(i18n("Boldface - \\textbf{}"),"text_bold",Qt::ALT+Qt::SHIFT+Qt::Key_B, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_textbf","\\textbf{","}",8,0,i18n("\\textbf{boldface text}"));
+ new KileAction::Tag(i18n("Typewriter - \\texttt{}"),"typewriter",Qt::ALT+Qt::SHIFT+Qt::Key_T, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_texttt","\\texttt{","}",8,0,i18n("\\texttt{typewriter text}"));
+ new KileAction::Tag(i18n("Small Caps - \\textsc{}"),Qt::ALT+Qt::SHIFT+Qt::Key_C, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_textsc","\\textsc{","}",8,0,i18n("\\textsc{small caps text}"));
+ new KileAction::Tag("\\item","item",Qt::ALT+Qt::SHIFT+Qt::Key_H, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_item","\\item ",QString::null,6,0, i18n("\\item[label] Hello!"));
+
+ (void) new KileAction::Tag(i18n("Tabbing - \\begin{tabbing}"),"tabbing",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_env_tabbing" ,"\\begin{tabbing}\n","%E\n\\end{tabbing} ",0,1,i18n("The tabbing environment provides a way to align text in columns.\n\\begin{tabbing}\ntext \\= more text \\= still more text \\= last text \\\\\nsecond row \\> \\> more \\\\\n\\end{tabbing}\nCommands :\n\\= Sets a tab stop at the current position.\n\\> Advances to the next tab stop.\n\\< Allows you to put something to the left of the local margin without changing the margin. Can only be used at the start of the line.\n\\+ Moves the left margin of the next and all the following commands one tab stop to the right\n\\- Moves the left margin of the next and all the following commands one tab stop to the left\n\\' Moves everything that you have typed so far in the current column to the right of the previous column, flush against the current column's tab stop. \n\\` Allows you to put text flush right against any tab stop, including tab stop 0\n\\kill Sets tab stops without producing text.\n\\a In a tabbing environment, the commands \\=, \\' and \\` do not produce accents as normal. Instead, the commands \\a=, \\a' and \\a` are used."));
+ (void) new KileAction::Tag("Tabular - \\begin{tabular}","tabular",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_env_tabular" ,"\\begin{tabular}{","}\n%E\n\\end{tabular} ",16,0,i18n("\\begin{tabular}[pos]{cols}\ncolumn 1 entry & column 2 entry ... & column n entry \\\\\n...\n\\end{tabular}\npos : Specifies the vertical position; default is alignment on the center of the environment.\n t - align on top row\n b - align on bottom row\ncols : Specifies the column formatting.\n l - A column of left-aligned items.\n r - A column of right-aligned items.\n c - A column of centered items.\n | - A vertical line the full height and depth of the environment.\n @{text} - this inserts text in every row.\nThe \\hline command draws a horizontal line the width of the table.\nThe \\cline{i-j} command draws horizontal lines across the columns specified, beginning in column i and ending in column j,\nThe \\vline command draws a vertical line extending the full height and depth of its row."));
+ (void) new KileAction::Tag("Multicolumn Cells - \\multicolumn","multicolumn",0, parent, SLOT(insertTag(const KileAction::TagData&)),parent->actionCollection(),"tag_multicolumn","\\multicolumn{","}{}{} ",13,0,i18n("\\multicolumn{cols}{pos}{text}\ncol, specifies the number of columns to span.\npos specifies the formatting of the entry: c for centered, l for flushleft, r for flushright.\ntext specifies what text is to make up the entry."));
+ (void) new KileAction::Tag(i18n("Horizontal Line - \\hline"),"hline",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_hline" ,"\\hline ",QString::null,7,0,i18n("The \\hline command draws a horizontal line the width of the table."));
+ (void) new KileAction::Tag(i18n("Vertical Line - \\vline"),"vline",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_vline" ,"\\vline ",QString::null,7,0,i18n("The \\vline command draws a vertical line extending the full height and depth of its row."));
+ (void) new KileAction::Tag(i18n("Horizontal Line Across Columns - \\cline{m-n}"),"cline",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_cline" ,"\\cline{-} ",QString::null,7,0,i18n("The \\cline{i-j} command draws horizontal lines across the columns specified, beginning in column i and ending in column j,"));
+
+ (void) new KileAction::Tag(i18n("Newpage - \\newpage"), 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_newpage","\\newpage ",QString::null,9,0,i18n("The \\newpage command ends the current page"));
+ (void) new KileAction::Tag(i18n("Line Break - \\linebreak"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_linebreak","\\linebreak ",QString::null,11,0,i18n("The \\linebreak command tells LaTeX to break the current line at the point of the command."));
+ (void) new KileAction::Tag(i18n("Page Break - \\pagebreak"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_pagebreak","\\pagebreak ",QString::null,11,0,i18n("The \\pagebreak command tells LaTeX to break the current page at the point of the command."));
+ (void) new KileAction::Tag(i18n("\"Big\" Vertical Space - \\bigskip"), 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bigskip","\\bigskip ",QString::null,9,0,i18n("The \\bigskip command adds a 'big' vertical space."));
+ (void) new KileAction::Tag(i18n("\"Medium\" vertical Space - \\medskip"), 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_medskip","\\medskip ",QString::null,9,0,i18n("The \\medskip command adds a 'medium' vertical space."));
+
+ // includegraphics (dani)
+ (void) new KileAction::Tag(i18n("Image Insertion - \\includegraphics{file}"), "graphics", KShortcut("Alt+I,G"),parent,SLOT(includeGraphics()), parent->actionCollection(),"tag_includegraphics",0L);
+ // two new shortcuts (dani)
+ (void) new KileAction::InputTag(ki,i18n("Customizable File Inclusion - \\include{file}"),"include",KShortcut("Alt+I,F"), parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_include",parent, KileAction::KeepHistory | KileAction::ShowBrowseButton | KileAction::AddProjectFile, "\\include{%R","}",9,0, i18n("\\include{file}\nThe \\include command is used in conjunction with the \\includeonly command for selective inclusion of files."),i18n("Type or select a filename: "));
+ (void) new KileAction::InputTag(ki,i18n("File Inclusion - \\input{file}"),"include",KShortcut("Alt+I,P"), parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_input", parent, KileAction::KeepHistory | KileAction::ShowBrowseButton | KileAction::AddProjectFile, "\\input{%R","}",7,0,i18n("\\input{file}\nThe \\input command causes the indicated file to be read and processed, exactly as if its contents had been inserted in the current file at that point."),i18n("Type or select a filename: "));
+ (void) new KileAction::Tag(i18n("Bibliography Style Selection - \\bibliographystyle{}"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bibliographystyle", "\\bibliographystyle{","} ",19,0,i18n("The argument to \\bibliographystyle refers to a file style.bst, which defines how your citations will look\nThe standard styles distributed with BibTeX are:\nalpha : sorted alphabetically. Labels are formed from name of author and year of publication.\nplain : sorted alphabetically. Labels are numeric.\nunsrt : like plain, but entries are in order of citation.\nabbrv : like plain, but more compact labels."));
+ (void) new KileAction::Tag(i18n("Bibliography Generation - \\bibliography{}"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bibliography","\\bibliography{%S", "}\n",14, 0,i18n("The argument to \\bibliography refers to the bib file (without extension)\nwhich should contain your database in BibTeX format.\nKile inserts automatically the base name of the TeX file"));
+
+ KileAction::Select *actionstructure_list = new KileAction::Select(i18n("Sectioning"), 0, parent->actionCollection(), "structure_list");
+ QPtrList<KAction> alist;
+ alist.append(new KileAction::InputTag(ki,"&part","part",0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_part", parent, KileAction::ShowAlternative|KileAction::ShowLabel , "\\part%A{%R}","\n", 0,1,i18n("\\part{title}\n\\part*{title} : do not include a number and do not make an entry in the table of contents\n"), i18n("&Part"),i18n("No &numbering")));
+ alist.append(new KileAction::InputTag(ki,"&chapter","chapter",0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_chapter" ,parent, KileAction::ShowAlternative|KileAction::ShowLabel , "\\chapter%A{%R}","\n", 0,1,i18n("\\chapter{title}\n\\chapter*{title} : do not include a number and do not make an entry in the table of contents\nOnly for 'report' and 'book' class document."), i18n("C&hapter"),i18n("No &numbering")));
+ alist.append(new KileAction::InputTag(ki,"&section","section",0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_section",parent, KileAction::ShowAlternative|KileAction::ShowLabel , "\\section%A{%R}","\n", 0,1,i18n("\\section{title}\n\\section*{title} : do not include a number and do not make an entry in the table of contents"), i18n("&Section"),i18n("No &numbering")));
+ alist.append(new KileAction::InputTag(ki,"s&ubsection","subsection",0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_subsection" ,parent, KileAction::ShowAlternative|KileAction::ShowLabel , "\\subsection%A{%R}","\n", 0,1,i18n("\\subsection{title}\n\\subsection*{title} : do not include a number and do not make an entry in the table of contents"), i18n("&Subsection"),i18n("No &numbering")));
+ alist.append(new KileAction::InputTag(ki,"su&bsubsection","subsubsection",0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_subsubsection",parent, KileAction::ShowAlternative|KileAction::ShowLabel , "\\subsubsection%A{%R}","\n", 0,1,i18n("\\subsubsection{title}\n\\subsubsection*{title} : do not include a number and do not make an entry in the table of contents"), i18n("&Subsubsection"),i18n("No &numbering")));
+ alist.append(new KileAction::InputTag(ki,"p&aragraph",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_paragraph",parent, KileAction::ShowAlternative|KileAction::ShowLabel , "\\paragraph%A{%R}","\n", 0,1,i18n("\\paragraph{title}\n\\paragraph*{title} : do not include a number and do not make an entry in the table of contents"), i18n("&Paragraph"),i18n("No &numbering")));
+ alist.append(new KileAction::InputTag(ki,"subpa&ragraph",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_subparagraph",parent, KileAction::ShowAlternative|KileAction::ShowLabel , "\\subparagraph%A{%R}","\n", 0,1,i18n("\\subparagraph{title}\n\\subparagraph*{title} : do not include a number and do not make an entry in the table of contents"), i18n("&Subparagraph"),i18n("No &numbering")));
+ actionstructure_list->setItems(alist);
+ actionstructure_list->setCurrentItem(2);
+
+ KileAction::Select *actionsize_list = new KileAction::Select(i18n("Size"), 0, parent->actionCollection(), "size_list");
+ alist.clear();
+ alist.append(new KileAction::Tag(i18n("tiny"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\begin{tiny}","\\end{tiny}",12,0));
+ alist.append(new KileAction::Tag(i18n("scriptsize"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\begin{scriptsize}","\\end{scriptsize}",18,0));
+ alist.append(new KileAction::Tag(i18n("footnotesize"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\begin{footnotesize}","\\end{footnotesize}",20,0));
+ alist.append(new KileAction::Tag(i18n("small"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\begin{small}","\\end{small}",13,0));
+ alist.append(new KileAction::Tag(i18n("normalsize"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\begin{normalsize}","\\end{normalsize}",18,0));
+ alist.append(new KileAction::Tag(i18n("large"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\begin{large}","\\end{large}",13,0));
+ alist.append(new KileAction::Tag(i18n("Large"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\begin{Large}","\\end{Large}",13,0));
+ alist.append(new KileAction::Tag(i18n("LARGE"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\begin{LARGE}","\\end{LARGE}",13,0));
+ alist.append(new KileAction::Tag(i18n("huge"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(), "","\\begin{huge}","\\end{huge}", 12,0));
+ alist.append(new KileAction::Tag(i18n("Huge"),0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(), "","\\begin{Huge}","\\end{Huge}", 12,0));
+ actionsize_list->setItems(alist);
+ actionsize_list->setCurrentItem(4);
+
+ KileAction::Select *actionother_list = new KileAction::Select(i18n("Other"), 0, parent->actionCollection(), "other_list");
+ alist.clear();
+ alist.append(new KileAction::Tag("label", 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_label", "\\label{","} ",7,0,i18n("\\label{key}")));
+ alist.append(new KileAction::Tag("index", 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_index","\\index{","}",7,0,i18n( "\\index{word}")));
+ alist.append(new KileAction::Tag("footnote",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_footnote", "\\footnote{","}",10,0,i18n( "\\footnote{text}")));
+ alist.append(new KileAction::InputTag(ki,"ref",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_ref", parent, KileAction::FromLabelList, "\\ref{%R", "}", 5,0, QString::null, i18n("Label") ));
+ alist.append(new KileAction::InputTag(ki,"pageref",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_pageref", parent, KileAction::FromLabelList, "\\pageref{%R", "}", 9,0, QString::null, i18n("Label") ));
+ alist.append(new KileAction::InputTag(ki,"cite",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_cite", parent, KileAction::FromBibItemList, "\\cite{%R", "}", 6,0, i18n("This command generates an in-text citation to the reference associated with the ref entry in the bib file\nYou can open the bib file with Kile to see all the available references"), i18n("Reference")));
+ alist.append(new KAction(i18n("cite from ViewBib"),0, parent, SLOT(citeViewBib()), parent->actionCollection(),"citeViewBib" ));
+
+ actionother_list->setItems(alist);
+
+ (void) new KileAction::Tag(i18n("Underline - \\underline{}"),"text_under",0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_underline", "\\underline{","}",11);
+
+ QString icon = ( locate("icon","default.kde/22x22/actions/key_enter.png").isEmpty() ) ? "newline" : "key_enter";
+ (void) new KAction(i18n("Smart New Line"), icon, Qt::SHIFT+Qt::Key_Return , ki->editorExtension(), SLOT(insertIntelligentNewline()), parent->actionCollection(),"tag_newline");
+ (void) new KAction(i18n("Smart Tabulator"), Qt::ALT+Qt::Key_Ampersand, ki->editorExtension(), SLOT(insertIntelligentTabulator()), parent->actionCollection(),"tag_tabulator" );
+
+ // new tags (dani 29.01.2005)
+ KActionCollection* ac = parent->actionCollection();
+
+ // environments
+ (void) new KileAction::Tag(i18n("Abstract - \\begin{abstract}"),0, parent,SLOT(insertTag(const KileAction::TagData&)), ac,"tag_env_abstract","\\begin{abstract}\n","%E\n\\end{abstract} ",0,1, i18n("\\begin{abstract}\ntext\n\\end{abstract}\nThe abstract environment creates a title page, i.e. a page with no printed page number or heading."));
+
+ (void) new KileAction::Tag("Tabular* - \\begin{tabular*}",0, parent,SLOT(insertTag(const KileAction::TagData&)), ac,"tag_env_tabular*","\\begin{tabular*}{}{","}\n%E\n\\end{tabular*}\n",17,0, i18n("\\begin{tabular*}{width}[pos]{cols}\ncolumn 1 entry & column 2 entry ... & column n entry \\\\\n...\n\\end{tabular*}\nThis is an extended version of the tabular environment with an extra parameter for the width. There must be rubber space between columns that can stretch to fill out the specified width."));
+
+ (void) new KileAction::Tag(i18n("Minipage - \\begin{minipage}"),"minipage",0, parent,SLOT(insertTag(const KileAction::TagData&)),ac,"tag_env_minipage","\\begin{minipage}[","]{}\n%E\n\\end{minipage} ",17,0, i18n("The minipage environment is similar to a \\parbox command. It takes the same optional position argument and mandatory width argument. You may use other paragraph-making environments inside a minipage."));
+
+ // lists
+ (void) new KileAction::Tag(i18n("Table of Figures - \\listoffigures"),0, parent,SLOT(insertTag(const KileAction::TagData&)), ac,"tag_listoffigures","\\listoffigures",QString::null,14,0, i18n("Put this command where you want the list of figures to go."));
+
+ (void) new KileAction::Tag(i18n("Table of Tables - \\listoftables"),0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_listoftables","\\listoftables",QString::null,14,0, i18n("Put this command where you want the list of tables to go."));
+
+ (void) new KileAction::Tag(i18n("Generate Index - \\makeindex"),0, parent,SLOT(insertTag(const KileAction::TagData&)), ac,"tag_makeindex","\\makeindex",QString::null,10,0, i18n("Put this command when you want to generate the raw index."));
+
+ (void) new KileAction::Tag(i18n("Print Index - \\printindex"),0, parent,SLOT(insertTag(const KileAction::TagData&)), ac,"tag_printindex","\\printindex",QString::null,11,0, i18n("Put this command when you want to print the formatted index."));
+
+ (void) new KileAction::Tag(i18n("Glossary - \\makeglossary"),0, parent,SLOT(insertTag(const KileAction::TagData&)), ac,"tag_makeglossary","\\makeglossary",QString::null,13,0, i18n("Put this command when you want to print a glossary."));
+
+ (void) new KileAction::Tag("Bibliography - \\begin{thebibliography}",0, parent,SLOT(insertTag(const KileAction::TagData&)), ac,"tag_env_thebibliography" ,"\\begin{thebibliography}{","}\n\n\\end{thebibliography} ",24,0, i18n("\\begin{thebibliography}{widest-label}\n\\bibitem[label]{cite_key}\n...\n\\end{thebibliography}\n\nwidest-label : Text that, when printed, is approximately as wide as the widest item label produces by the \\bibitem commands\n\\bibitem : Specify a bibliography item"));
+
+ // verbatim code
+ (void) new KileAction::Tag(i18n("Verbatim (show spaces) - \\begin{verbatim*}"),0, parent,SLOT(insertTag(const KileAction::TagData&)),ac,"tag_env_verbatim*","\\begin{verbatim*}\n","%E\n\\end{verbatim*}\n",0,1, i18n("Environment that gets LaTeX to print exactly what you type in. In this variant, spaces are printed in a special manner."));
+
+ (void) new KileAction::Tag(i18n("Embedded Code - \\verb||"),"verb",0, parent,SLOT(insertTag(const KileAction::TagData&)),ac,"tag_verb","\\verb|","|",6,0, i18n("Macro form of the verbatim environment."));
+
+ (void) new KileAction::Tag(i18n("Embedded Code (show spaces) - \\verb*||"),0, parent,SLOT(insertTag(const KileAction::TagData&)),ac,"tag_verb*","\\verb*|","|",7,0, i18n("Macro form of the verbatim* environment."));
+
+ // horizontal/vertical space
+ (void) new KileAction::Tag(i18n("\"Small\" Vertical Space - \\smallskip"),0, parent,SLOT(insertTag(const KileAction::TagData&)), ac,"tag_smallskip","\\smallskip ",QString::null,10,0, i18n("The \\smallskip command adds a 'small' vertical space."));
+
+ (void) new KileAction::Tag("\\enskip",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_enskip", "\\enskip ", QString::null, 8);
+
+ (void) new KileAction::Tag(i18n("Horizontal Variable Space - \\hfill"),0, parent,SLOT(insertTag(const KileAction::TagData&)),ac,"tag_hfill","\\hfill",QString::null,6,0, i18n("The \\hfill fill command produces a \"rubber length\" which can stretch or shrink horizontally. It will be filled with spaces."));
+
+ (void) new KileAction::Tag(i18n("Horizontal Dots - \\dotfill"),0, parent,SLOT(insertTag(const KileAction::TagData&)),ac,"tag_dotfill","\\dotfill",QString::null,8,0, i18n("The \\dotfill command produces a \"rubber length\" that produces dots instead of just spaces."));
+
+ (void) new KileAction::Tag(i18n("Horizontal Rule - \\hrulefill"),0, parent,SLOT(insertTag(const KileAction::TagData&)),ac,"tag_hrulefill","\\hrulefill",QString::null,10,0, i18n("The \\hrulefill fill command produces a \"rubber length\" which can stretch or shrink horizontally. It will be filled with a horizontal rule."));
+
+ (void) new KileAction::Tag(i18n("Vertical Variable Space - \\vfill"),0, parent,SLOT(insertTag(const KileAction::TagData&)),ac,"tag_vfill","\\vfill",QString::null,6,0, i18n("The \\vfill fill command produces a \"rubber length\" which can stretch or shrink vertically."));
+
+ (void) new KileAction::Tag(i18n("Horizontal Space - \\hspace{}"),0, parent,SLOT(insertTag(const KileAction::TagData&)),ac,"tag_hspace","\\hspace{","}",8,0, i18n("The \\hspace command adds horizontal space. The length of the space can be expressed in any terms that LaTeX understands, i.e., points, inches, etc. You can add negative as well as positive space with an \\hspace command. Adding negative space is like backspacing."));
+
+ (void) new KileAction::Tag(i18n("Horizontal Space (forced) - \\hspace*{}"),0, parent,SLOT(insertTag(const KileAction::TagData&)),ac,"tag_hspace*","\\hspace*{","}",9,0, i18n("The \\hspace* command adds horizontal space like the \\hspace command. LaTeX removes horizontal space that comes at the end of a line. If you do not want LaTeX to remove this space, include the optional * argument. Then the space is never removed."));
+
+ (void) new KileAction::Tag(i18n("Vertical Space - \\vspace{}"),0, parent,SLOT(insertTag(const KileAction::TagData&)),ac,"tag_vspace","\\vspace{","}",8,0, i18n("The \\vspace command adds vertical space. The length of the space can be expressed in any terms that LaTeX understands, i.e., points, inches, etc. You can add negative as well as positive space with an \\vspace command."));
+
+ (void) new KileAction::Tag(i18n("Vertical Space (forced) - \\vspace*{}"),0, parent,SLOT(insertTag(const KileAction::TagData&)),ac,"tag_vspace*","\\vspace*{","}",9,0, i18n("The \\vspace* command adds vertical space like the \\vspace command. LaTeX removes vertical space that comes at the end of a page. If you do not want LaTeX to remove this space, include the optional * argument. Then the space is never removed."));
+
+ // fonts
+ new KileAction::Tag(i18n("Emphasized - \\emph{}"),"emph",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_emph","\\emph{","}",6,0,i18n("\\emph{emphasized text}"));
+ new KileAction::Tag(i18n("Strong - \\strong{}"),"strong",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_strong","\\strong{","}",8,0,i18n("\\strong{text}"));
+
+ (void) new KileAction::Tag("Roman - \\rmfamily",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_rmfamily", "\\rmfamily", QString::null, 9);
+ (void) new KileAction::Tag("Sansserif - \\sffamily",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_sffamily", "\\sffamily", QString::null, 9);
+ (void) new KileAction::Tag("Monospace - \\ttfamily",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_ttfamily", "\\ttfamily", QString::null, 9);
+
+ (void) new KileAction::Tag("Medium - \\mdseries",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_mdseries", "\\mdseries", QString::null, 9);
+ (void) new KileAction::Tag("Bold - \\bfseries",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_bfseries", "\\bfseries", QString::null, 9);
+
+ (void) new KileAction::Tag("Upright - \\upshape",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_upshape", "\\upshape", QString::null, 8);
+ (void) new KileAction::Tag("Italic - \\itshape",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_itshape", "\\itshape", QString::null, 8);
+ (void) new KileAction::Tag("Slanted - \\slshape",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_slshape", "\\slshape", QString::null, 8);
+ (void) new KileAction::Tag("Smallcaps - \\scshape",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_scshape", "\\scshape", QString::null, 8);
+
+}
+
+void setupBibTags(KMainWindow *parent)
+{
+ (void) new KileAction::Tag(i18n("Article in Journal"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_article","@Article{,\nauthor = {},\ntitle = {},\njournal = {},\nyear = {},\nOPTkey = {},\nOPTvolume = {},\nOPTnumber = {},\nOPTpages = {},\nOPTmonth = {},\nOPTnote = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,9,0,i18n("Bib fields - Article in Journal\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+ (void) new KileAction::Tag(i18n("Article in Conference Proceedings"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_inproc","@InProceedings{,\nauthor = {},\ntitle = {},\nbooktitle = {},\nOPTcrossref = {},\nOPTkey = {},\nOPTpages = {},\nOPTyear = {},\nOPTeditor = {},\nOPTvolume = {},\nOPTnumber = {},\nOPTseries = {},\nOPTaddress = {},\nOPTmonth = {},\nOPTorganization = {},\nOPTpublisher = {},\nOPTnote = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,15,0,i18n("Bib fields - Article in Conference Proceedings\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+ (void) new KileAction::Tag(i18n("Article in Collection"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_incol","@InCollection{,\nauthor = {},\ntitle = {},\nbooktitle = {},\nOPTcrossref = {},\nOPTkey = {},\nOPTpages = {},\nOPTpublisher = {},\nOPTyear = {},\nOPTeditor = {},\nOPTvolume = {},\nOPTnumber = {},\nOPTseries = {},\nOPTtype = {},\nOPTchapter = {},\nOPTaddress = {},\nOPTedition = {},\nOPTmonth = {},\nOPTnote = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,14,0,i18n("Bib fields - Article in a Collection\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+ (void) new KileAction::Tag(i18n("Chapter or Pages in Book"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_inbook","@InBook{,\nALTauthor = {},\nALTeditor = {},\ntitle = {},\nchapter = {},\npublisher = {},\nyear = {},\nOPTkey = {},\nOPTvolume = {},\nOPTnumber = {},\nOPTseries = {},\nOPTtype = {},\nOPTaddress = {},\nOPTedition = {},\nOPTmonth = {},\nOPTpages = {},\nOPTnote = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,8,0,i18n("Bib fields - Chapter or Pages in a Book\nALT.... : you have the choice between these two fields\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+ (void) new KileAction::Tag(i18n("Conference Proceedings"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_proceedings","@Proceedings{,\ntitle = {},\nyear = {},\nOPTkey = {},\nOPTeditor = {},\nOPTvolume = {},\nOPTnumber = {},\nOPTseries = {},\nOPTaddress = {},\nOPTmonth = {},\nOPTorganization = {},\nOPTpublisher = {},\nOPTnote = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,13,0,i18n("Bib Fields - Conference Proceedings\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+ (void) new KileAction::Tag(i18n("Book"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_book","@Book{,\nALTauthor = {},\nALTeditor = {},\ntitle = {},\npublisher = {},\nyear = {},\nOPTkey = {},\nOPTvolume = {},\nOPTnumber = {},\nOPTseries = {},\nOPTaddress = {},\nOPTedition = {},\nOPTmonth = {},\nOPTnote = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,6,0,i18n("Bib Fields - Book\nALT.... : you have the choice between these two fields\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+ (void) new KileAction::Tag(i18n("Booklet"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_booklet","@Booklet{,\ntitle = {},\nOPTkey = {},\nOPTauthor = {},\nOPThowpublished = {},\nOPTaddress = {},\nOPTmonth = {},\nOPTyear = {},\nOPTnote = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,9,0,i18n("Bib fields - Booklet\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+ (void) new KileAction::Tag(i18n("PhD. Thesis"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_phdthesis","@PhdThesis{,\nauthor = {},\ntitle = {},\nschool = {},\nyear = {},\nOPTkey = {},\nOPTtype = {},\nOPTaddress = {},\nOPTmonth = {},\nOPTnote = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,11,0,i18n("Bib fields - PhD. Thesis\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+ (void) new KileAction::Tag(i18n("Master's Thesis"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_masterthesis","@MastersThesis{,\nauthor = {},\ntitle = {},\nschool = {},\nyear = {},\nOPTkey = {},\nOPTtype = {},\nOPTaddress = {},\nOPTmonth = {},\nOPTnote = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,15,0,i18n("Bib fields - Master's Thesis\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+ (void) new KileAction::Tag(i18n("Technical Report"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_techreport","@TechReport{,\nauthor = {},\ntitle = {},\ninstitution = {},\nyear = {},\nOPTkey = {},\nOPTtype = {},\nOPTnumber = {},\nOPTaddress = {},\nOPTmonth = {},\nOPTnote = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,12,0,i18n("Bib fields - Technical Report\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+ (void) new KileAction::Tag(i18n("Technical Manual"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_manual","@Manual{,\ntitle = {},\nOPTkey = {},\nOPTauthor = {},\nOPTorganization = {},\nOPTaddress = {},\nOPTedition = {},\nOPTmonth = {},\nOPTyear = {},\nOPTnote = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,8,0,i18n("Bib fields - Technical Manual\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+ (void) new KileAction::Tag(i18n("Unpublished"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_unpublished","@Unpublished{,\nauthor = {},\ntitle = {},\nnote = {},\nOPTkey = {},\nOPTmonth = {},\nOPTyear = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,13,0,i18n("Bib fields - Unpublished\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+ (void) new KileAction::Tag(i18n("Miscellaneous"),0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bib_misc","@Misc{,\nOPTkey = {},\nOPTauthor = {},\nOPTtitle = {},\nOPThowpublished = {},\nOPTmonth = {},\nOPTyear = {},\nOPTnote = {},\nOPTannote = {},\nOPTurl = {},\nOPTdoi = {},\nOPTissn = {},\nOPTlocalfile = {},\nOPTabstract = {}\n}\n",QString::null,6,0,i18n("Bib fields - Miscellaneous\nOPT.... : optional fields (use the 'Clean' command to remove them)"));
+}
+
+void setupMathTags(KMainWindow *parent)
+{
+ (void) new KileAction::Tag("\\mathrm{}", 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_mathrm","\\mathrm{","}",8);
+ (void) new KileAction::Tag("\\mathit{}", 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_mathit" ,"\\mathit{","}",8);
+ (void) new KileAction::Tag("\\mathbf{}", 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_mathbf" ,"\\mathbf{","}",8);
+ (void) new KileAction::Tag("\\mathsf{}", 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_mathsf" ,"\\mathsf{","}",8);
+ (void) new KileAction::Tag("\\mathtt{}", 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_mathtt" ,"\\mathtt{","}",8);
+ (void) new KileAction::Tag("\\mathcal{}", 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_mathcal" ,"\\mathcal{","}",9);
+ (void) new KileAction::Tag("\\mathbb{}", 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_mathbb" ,"\\mathbb{","}",8);
+ (void) new KileAction::Tag("\\mathfrak{}",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_mathfrak" ,"\\mathfrak{","}",10);
+
+ (void) new KileAction::Tag("\\acute{}","acute",0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_acute", "\\acute{","}",7);
+ (void) new KileAction::Tag("\\grave{}","grave",0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_grave", "\\grave{","}", 7);
+ (void) new KileAction::Tag("\\tilde{}","tilde",0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_tilde", "\\tilde{","}", 7);
+ (void) new KileAction::Tag("\\bar{}","bar", 0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_bar", "\\bar{","}", 5);
+ (void) new KileAction::Tag("\\vec{}","vec", 0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_vec", "\\vec{","}", 5);
+ (void) new KileAction::Tag("\\hat{}","hat", 0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_hat", "\\hat{","}", 5);
+ (void) new KileAction::Tag("\\check{}","check",0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_check", "\\check{","}", 7);
+ (void) new KileAction::Tag("\\breve{}","breve",0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_breve", "\\breve{","}", 7);
+ (void) new KileAction::Tag("\\dot{}","dot", 0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_dot", "\\dot{","}", 5);
+ (void) new KileAction::Tag("\\ddot{}","ddot", 0 , parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_ddot", "\\ddot{","}", 6);
+
+ (void) new KileAction::Tag(i18n("small"), 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_space_small", "\\,", QString::null, 2);
+ (void) new KileAction::Tag(i18n("medium"), 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_space_medium", "\\:", QString::null,2);
+ (void) new KileAction::Tag(i18n("large"), 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_space_large", "\\;", QString::null,2);
+ (void) new KileAction::Tag("\\quad", 0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_quad", "\\quad ", QString::null, 6);
+ (void) new KileAction::Tag("\\qquad",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_qquad", "\\qquad ", QString::null, 7);
+
+ (void) new KileAction::Tag(i18n("Math Mode - $...$"),"mathmode",Qt::ALT+Qt::SHIFT+Qt::Key_M, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_mathmode","$","$",1);
+ (void) new KileAction::Tag("Displaymath Mode - \\[...\\]", "displaymathmode",Qt::ALT+Qt::SHIFT+Qt::Key_E, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_equation", "\\[","\\]", 2);
+ (void) new KileAction::Tag(i18n("Equation - \\begin{equation}"),"equation",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_env_equation","\\begin{equation}\n","%E\n\\end{equation} ",0,1);
+ (void) new KileAction::Tag(i18n("Subscript - _{}"),"math_lsup",Qt::ALT+Qt::SHIFT+Qt::Key_D, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_subscript","_{","}",2);
+ (void) new KileAction::Tag(i18n("Superscript - ^{}"),"math_lsub",Qt::ALT+Qt::SHIFT+Qt::Key_U, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_superscript","^{","}",2);
+ (void) new KileAction::Tag(i18n("Normal - \\frac{}{}"),"smallfrac",Qt::ALT+Qt::SHIFT+Qt::Key_F, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_frac", "\\frac{","}{}",6);
+ (void) new KileAction::Tag(i18n("Displaystyle - \\dfrac{}{}"),"dfrac",Qt::ALT+Qt::SHIFT+Qt::Key_Q, parent, SLOT(insertAmsTag(const KileAction::TagData&)), parent->actionCollection(),"tag_dfrac", "\\dfrac{","}{}", 7);
+ (void) new KileAction::Tag(i18n("Square Root - \\sqrt{}"),"math_sqrt",Qt::ALT+Qt::SHIFT+Qt::Key_S, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_sqrt", "\\sqrt{","}", 6);
+ (void) new KileAction::Tag("\\left",Qt::ALT+Qt::SHIFT+Qt::Key_L, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_left", "\\left", QString::null, 5);
+ (void) new KileAction::Tag("\\right",Qt::ALT+Qt::SHIFT+Qt::Key_R, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_right", "\\right", QString::null, 6);
+ (void) new KileAction::Tag(i18n("Array - \\begin{array}"),"array",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"tag_env_array", "\\begin{array}{}\n", "%E\n\\end{array}", 14, 0,
+ i18n("\\begin{array}{col1col2...coln}\ncolumn 1 entry & column 2 entry ... & column n entry \\\\ \n...\n\\end{array}\nEach column, coln, is specified by a single letter that tells how items in that column should be formatted.\n"
+ " c -- for centered \n l -- for flush left \n r -- for flush right\n"));
+
+ QPtrList<KAction> alist;
+ KileAction::Select *actionleft_list = new KileAction::Select(i18n("Left Delimiter"), 0, parent->actionCollection(), "left_list");
+ alist.clear();
+ alist.append(new KileAction::Tag("left (",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\left( ",QString::null,7,0));
+ alist.append(new KileAction::Tag("left [",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\left[ ",QString::null,7,0));
+ alist.append(new KileAction::Tag("left {",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\left\\lbrace ",QString::null,14,0));
+ alist.append(new KileAction::Tag("left <",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\left\\langle ",QString::null,14,0));
+ alist.append(new KileAction::Tag("left )",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\left) ",QString::null,7,0));
+ alist.append(new KileAction::Tag("left ]",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\left] ",QString::null,7,0));
+ alist.append(new KileAction::Tag("left }",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\left\\rbrace ",QString::null,14,0));
+ alist.append(new KileAction::Tag("left >",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\left\\rangle ",QString::null,14,0));
+ alist.append(new KileAction::Tag("left .",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\left. ",QString::null,7,0));
+
+ actionleft_list->setItems(alist);
+
+ KileAction::Select *actionright_list = new KileAction::Select(i18n("Right Delimiter"), 0, parent->actionCollection(), "right_list");
+ alist.clear();
+ alist.append(new KileAction::Tag("right )",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\right) ",QString::null,8,0));
+ alist.append(new KileAction::Tag("right ]",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\right] ",QString::null,8,0));
+ alist.append(new KileAction::Tag("right }",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\right\\rbrace ",QString::null,14,0));
+ alist.append(new KileAction::Tag("right >",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\right\\rangle ",QString::null,14,0));
+ alist.append(new KileAction::Tag("right (",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\right( ",QString::null,8,0));
+ alist.append(new KileAction::Tag("right [",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\right[ ",QString::null,8,0));
+ alist.append(new KileAction::Tag("right {",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\right\\lbrace ",QString::null,14,0));
+ alist.append(new KileAction::Tag("right <",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\right\\langle ",QString::null,14,0));
+ alist.append(new KileAction::Tag("right.",0, parent, SLOT(insertTag(const KileAction::TagData&)), parent->actionCollection(),"","\\right. ",QString::null,8,0));
+
+ actionright_list->setItems(alist);
+
+ // new math tags (dani 29.01.2005)
+ KActionCollection* ac = parent->actionCollection();
+
+ (void) new KileAction::Tag(i18n("Textstyle - \\tfrac{}{}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)), ac,"tag_tfrac", "\\tfrac{","}{}", 7);
+
+ (void) new KileAction::Tag(i18n("Normal - \\binom{}{}"),"binom",0, parent, SLOT(insertAmsTag(const KileAction::TagData&)), ac,"tag_binom", "\\binom{","}{}", 7);
+
+ (void) new KileAction::Tag(i18n("Displaystyle - \\dbinom{}{}"),0, parent,SLOT(insertAmsTag(const KileAction::TagData&)), ac,"tag_dbinom", "\\dbinom{","}{}", 8);
+
+ (void) new KileAction::Tag(i18n("Textstyle - \\tbinom{}{}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)), ac,"tag_tbinom", "\\tbinom{","}{}", 8);
+
+ (void) new KileAction::Tag(i18n("n-th root - \\sqrt[]{}"),"nroot",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_nroot", "\\sqrt[]{","}", 6);
+
+ (void) new KileAction::Tag("Left-Right - \\left(..\\right)",0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_leftright", "\\left( \\right)", QString::null, 7);
+
+ (void) new KileAction::Tag(i18n("Extendable Left Arrow - \\xleftarrow{}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)), ac,"tag_xleftarrow", "\\xleftarrow{","}", 12);
+
+ (void) new KileAction::Tag(i18n("Extendable Right Arrow - \\xrightarrow{}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)), ac,"tag_xrightarrow", "\\xrightarrow{","}", 13);
+
+ (void) new KileAction::Tag(i18n("Boxed Formula - \\boxed{}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)), ac,"tag_boxed", "\\boxed{","}", 7);
+
+ (void) new KileAction::Tag(i18n("bigl - \\bigl"),0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_bigl", "\\bigl",QString::null, 5);
+ (void) new KileAction::Tag(i18n("Bigl - \\Bigl"),0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_Bigl", "\\Bigl",QString::null, 5);
+ (void) new KileAction::Tag(i18n("biggl - \\biggl"),0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_biggl", "\\biggl",QString::null, 6);
+ (void) new KileAction::Tag(i18n("Biggl - \\Biggl"),0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_Biggl", "\\Biggl",QString::null, 6);
+
+ (void) new KileAction::Tag(i18n("bigr - \\bigr"),0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_bigr", "\\bigr",QString::null, 5);
+ (void) new KileAction::Tag(i18n("Bigr - \\Bigr"),0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_Bigr", "\\Bigr",QString::null, 5);
+ (void) new KileAction::Tag(i18n("biggr - \\biggr"),0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_biggr", "\\biggr",QString::null, 6);
+ (void) new KileAction::Tag(i18n("Biggr - \\Biggr"),0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_Biggr", "\\Biggr",QString::null, 6);
+
+ // text in mathmode
+ (void) new KileAction::Tag(i18n("Text in Mathmode - \\text{}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)), ac,"tag_text", "\\text{","}", 6);
+
+ (void) new KileAction::Tag(i18n("Intertext - \\intertext{}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)), ac,"tag_intertext", "\\intertext{","}\n", 11);
+
+ // math environments
+ (void) new KileAction::Tag(i18n("Displaymath - \\begin{displaymath}"),0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_env_displaymath","\\begin{displaymath}\n","%E\n\\end{displaymath}\n",0,1);
+
+ (void) new KileAction::Tag(i18n("Equation (not numbered) - \\begin{equation*}"),0, parent, SLOT(insertTag(const KileAction::TagData&)), ac,"tag_env_equation*","\\begin{equation*}\n","%E\n\\end{equation*}\n",0,1);
+
+ // AMS environments
+ (void) new KileAction::Tag(i18n("Multline - \\begin{multline}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_multline","\\begin{multline}\n","%E\n\\end{multline}\n", 0,1);
+ (void) new KileAction::Tag(i18n("Multline* - \\begin{multline*}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_multline*","\\begin{multline*}\n","%E\n\\end{multline*}\n", 0,1);
+
+ (void) new KileAction::Tag(i18n("Split - \\begin{split}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_split","\\begin{split}\n","%E\n\\end{split}\n", 0,1);
+
+ (void) new KileAction::Tag(i18n("Gather - \\begin{gather}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_gather","\\begin{gather}\n","%E\n\\end{gather}\n", 0,1);
+ (void) new KileAction::Tag(i18n("Gather* - \\begin{gather*}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_gather*","\\begin{gather*}\n","%E\n\\end{gather*}\n", 0,1);
+
+ (void) new KileAction::Tag(i18n("Align - \\begin{align}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_align","\\begin{align}\n","%E\n\\end{align}\n", 0,1);
+ (void) new KileAction::Tag(i18n("Align* - \\begin{align*}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_align*","\\begin{align*}\n","%E\n\\end{align*}\n", 0,1);
+
+ (void) new KileAction::Tag(i18n("Flalign - \\begin{flalign}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_flalign","\\begin{flalign}\n","%E\n\\end{flalign}\n", 0,1);
+ (void) new KileAction::Tag(i18n("Flalign* - \\begin{flalign*}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_flalign*","\\begin{flalign*}\n","%E\n\\end{flalign*}\n", 0,1);
+
+ (void) new KileAction::Tag(i18n("Alignat - \\begin{alignat}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_alignat","\\begin{alignat}{","}\n%E\n\\end{alignat}\n", 16,0);
+ (void) new KileAction::Tag(i18n("Alignat* - \\begin{alignat*}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_alignat*","\\begin{alignat*}{","}\n%E\n\\end{alignat*}\n", 17,0);
+
+ (void) new KileAction::Tag(i18n("Aligned - \\begin{aligned}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_aligned","\\begin{aligned}\n","%E\n\\end{aligned}\n", 0,1);
+ (void) new KileAction::Tag(i18n("Gathered - \\begin{gathered}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_gathered","\\begin{gathered}\n","%E\n\\end{gathered}\n", 0,1);
+ (void) new KileAction::Tag(i18n("Alignedat - \\begin{alignedat}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_alignedat","\\begin{alignedat}\n","%E\n\\end{alignedat}\n", 0,1);
+
+ (void) new KileAction::Tag(i18n("Cases - \\begin{cases}"),0, parent, SLOT(insertAmsTag(const KileAction::TagData&)),ac,"tag_env_cases","\\begin{cases}\n","%E\n\\end{cases}\n", 0,1);
+
+}
+
+}
diff --git a/src/kile/kilestdactions.h b/src/kile/kilestdactions.h
new file mode 100644
index 0000000..bc86577
--- /dev/null
+++ b/src/kile/kilestdactions.h
@@ -0,0 +1,31 @@
+//
+//
+// C++ Interface: kilestdactions
+//
+// Description:
+//
+//
+// Author: Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>, (C) 2003
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILESTDACTIONS_H
+#define KILESTDACTIONS_H
+class KAction;
+class KMainWindow;
+
+namespace KileStdActions
+{
+ void setupStdTags(KileInfo *ki, KMainWindow *parent);
+ void setupBibTags(KMainWindow *parent);
+ void setupMathTags(KMainWindow *parent);
+}
+
+#endif
diff --git a/src/kile/kilestdtools.cpp b/src/kile/kilestdtools.cpp
new file mode 100644
index 0000000..57f4530
--- /dev/null
+++ b/src/kile/kilestdtools.cpp
@@ -0,0 +1,414 @@
+/***************************************************************************
+ begin : Thu Nov 27 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kilestdtools.h"
+
+#include <qfileinfo.h>
+#include <qregexp.h>
+
+#include <kconfig.h>
+#include <klocale.h>
+#include <kate/document.h>
+#include <kstandarddirs.h>
+
+#include "kileconfig.h"
+#include "kiletool.h"
+#include "kiletoolmanager.h"
+#include "kiletool_enums.h"
+#include "kileinfo.h"
+#include "kilelistselector.h"
+#include "kiledocmanager.h"
+#include "kiledocumentinfo.h"
+#include "latexoutputinfo.h"
+
+namespace KileTool
+{
+ Base* Factory::create(const QString & tool, bool prepare /* = true */)
+ {
+ //perhaps we can find the tool in the config file
+ if (m_config->hasGroup(groupFor(tool, m_config)))
+ {
+ m_config->setGroup(groupFor(tool, m_config));
+ QString toolClass = m_config->readEntry("class", "");
+
+ if ( toolClass == "LaTeX")
+ return new LaTeX(tool, m_manager, prepare);
+
+ if ( toolClass == "LaTeXpreview")
+ return new PreviewLaTeX(tool, m_manager, prepare);
+
+ if ( toolClass == "ForwardDVI" )
+ return new ForwardDVI(tool, m_manager, prepare);
+
+ if ( toolClass == "ViewHTML" )
+ return new ViewHTML(tool, m_manager, prepare);
+
+ if ( toolClass == "ViewBib" )
+ return new ViewBib(tool, m_manager, prepare);
+
+ if ( toolClass == "Base" )
+ return new Base(tool, m_manager, prepare);
+
+ if ( toolClass == "Compile" )
+ return new Compile(tool, m_manager, prepare);
+
+ if ( toolClass == "Convert" )
+ return new Convert(tool, m_manager, prepare);
+
+ if ( toolClass == "Archive" )
+ return new Archive(tool, m_manager, prepare);
+
+ if ( toolClass == "View" )
+ return new View(tool, m_manager, prepare);
+
+ if ( toolClass == "Sequence" )
+ return new Sequence(tool, m_manager, prepare);
+ }
+
+ //unknown tool, return 0
+ return 0L;
+ }
+
+ void Factory::writeStdConfig()
+ {
+ QString from_cfg = KGlobal::dirs()->findResource("appdata", "kilestdtools.rc");
+ QString to_cfg = KGlobal::dirs()->saveLocation("config") + "/kilerc";
+ KConfig *pCfg = new KConfig(from_cfg, false, false);
+ pCfg->copyTo(to_cfg, m_config);
+ }
+
+ /////////////// LaTeX ////////////////
+
+ int LaTeX::m_reRun = 0;
+
+ bool LaTeX::updateBibs()
+ {
+ KileDocument::TextInfo *docinfo = manager()->info()->docManager()->textInfoFor(source());
+ if ( docinfo )
+ {
+ if ( manager()->info()->allBibliographies()->count() > 0 )
+ return needsUpdate ( baseDir() + '/' + S() + ".bbl" , manager()->info()->lastModifiedFile(docinfo) );
+ }
+
+ return false;
+ }
+
+ bool LaTeX::updateIndex()
+ {
+ KileDocument::TextInfo *docinfo = manager()->info()->docManager()->textInfoFor(source());
+ if ( docinfo )
+ {
+ const QStringList *pckgs = manager()->info()->allPackages();
+ if ( pckgs->contains("makeidx") )
+ return needsUpdate ( baseDir() + '/' + S() + ".ind", manager()->info()->lastModifiedFile(docinfo) );
+ }
+
+ return false;
+ }
+
+ bool LaTeX::updateAsy()
+ {
+ KileDocument::TextInfo *docinfo = manager()->info()->docManager()->textInfoFor(source());
+ if ( docinfo)
+ {
+
+ const QStringList *pckgs = manager()->info()->allPackages();
+ if ( pckgs->contains("asymptote") )
+ {
+ static QRegExp msg("File " + QRegExp::escape(S()) + "_?\\d+_?.(?:eps|pdf|tex) does not exist");
+ int sz = manager()->info()->outputInfo()->size();
+ for (int i = 0; i < sz; ++i )
+ {
+ if( (*manager()->info()->outputInfo())[i].message().contains(msg) )
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ bool LaTeX::finish(int r)
+ {
+ KILE_DEBUG() << "==bool LaTeX::finish(" << r << ")=====" << endl;
+
+ int nErrors = 0, nWarnings = 0;
+ if ( filterLogfile() ) {
+ checkErrors(nErrors,nWarnings);
+ }
+
+ if ( readEntry("autoRun") == "yes" )
+ checkAutoRun(nErrors,nWarnings);
+
+ return Compile::finish(r);
+ }
+
+ bool LaTeX::filterLogfile()
+ {
+ manager()->info()->outputFilter()->setSource(source());
+ QString log = baseDir() + '/' + S() + ".log";
+
+ return manager()->info()->outputFilter()->Run(log);
+ }
+
+ void LaTeX::checkErrors(int &nErrors, int &nWarnings)
+ {
+ int nBadBoxes = 0;
+
+ manager()->info()->outputFilter()->sendProblems();
+ manager()->info()->outputFilter()->getErrorCount(&nErrors, &nWarnings, &nBadBoxes);
+ QString es = i18n("%n error", "%n errors", nErrors);
+ QString ws = i18n("%n warning", "%n warnings", nWarnings);
+ QString bs = i18n("%n badbox", "%n badboxes", nBadBoxes);
+
+ sendMessage(Info, es +", " + ws + ", " + bs);
+
+ //jump to first error
+ if ( nErrors > 0 && (readEntry("jumpToFirstError") == "yes") ) {
+ connect(this, SIGNAL(jumpToFirstError()), manager(), SIGNAL(jumpToFirstError()));
+ emit(jumpToFirstError());
+ }
+ }
+
+ void LaTeX::checkAutoRun(int nErrors, int nWarnings)
+ {
+ KILE_DEBUG() << "check for autorun, m_reRun is " << m_reRun << endl;
+ //check for "rerun LaTeX" warnings
+ bool reRan = false;
+ if ( (m_reRun < 2) && (nErrors == 0) && (nWarnings > 0) )
+ {
+ int sz = manager()->info()->outputInfo()->size();
+ for (int i = 0; i < sz; ++i )
+ {
+ if ( (*manager()->info()->outputInfo())[i].type() == LatexOutputInfo::itmWarning
+ && (*manager()->info()->outputInfo())[i].message().contains("Rerun") )
+ {
+ reRan = true;
+ break;
+ }
+ }
+ }
+
+
+ if ( reRan )
+ m_reRun++;
+ else
+ m_reRun = 0;
+
+ bool bibs = updateBibs();
+ bool index = updateIndex();
+ bool asy = updateAsy();
+
+ if ( reRan )
+ {
+ KILE_DEBUG() << "rerunning LaTeX " << m_reRun << endl;
+ Base *tool = manager()->factory()->create(name());
+ tool->setSource(source());
+ manager()->runNext(tool);
+ }
+
+ if ( bibs || index || asy )
+ {
+ Base *tool = manager()->factory()->create(name());
+ tool->setSource(source());
+ manager()->runNext(tool);
+
+ if ( bibs )
+ {
+ KILE_DEBUG() << "need to run BibTeX" << endl;
+ tool = manager()->factory()->create("BibTeX");
+ tool->setSource(source());
+ manager()->runNext(tool);
+ }
+
+ if ( index )
+ {
+ KILE_DEBUG() << "need to run MakeIndex" << endl;
+ tool = manager()->factory()->create("MakeIndex");
+ tool->setSource(source());
+ manager()->runNext(tool);
+ }
+
+ if ( asy )
+ {
+ KILE_DEBUG() << "need to run asymptote" << endl;
+ tool = manager()->factory()->create("Asymptote");
+ tool->setSource(source());
+ manager()->runNext(tool);
+ }
+
+ }
+ }
+
+
+ /////////////// PreviewLaTeX (dani) ////////////////
+
+ // PreviewLatex makes three steps:
+ // - filterLogfile() : parse logfile and read info into InfoLists
+ // - updateInfoLists(): change entries of temporary file into normal tex file
+ // - checkErrors() : count errors and warnings and emit signals
+ bool PreviewLaTeX::finish(int r)
+ {
+ KILE_DEBUG() << "==bool PreviewLaTeX::finish(" << r << ")=====" << endl;
+
+ int nErrors = 0, nWarnings = 0;
+ if ( filterLogfile() ) {
+ manager()->info()->outputFilter()->updateInfoLists(m_filename,m_selrow,m_docrow);
+ checkErrors(nErrors,nWarnings);
+ }
+
+ return Compile::finish(r);
+ }
+
+ void PreviewLaTeX::setPreviewInfo(const QString &filename, int selrow,int docrow)
+ {
+ m_filename = filename;
+ m_selrow = selrow;
+ m_docrow = docrow;
+ }
+
+ bool ForwardDVI::determineTarget()
+ {
+ if (!View::determineTarget())
+ return false;
+
+ int para = manager()->info()->lineNumber();
+ Kate::Document *doc = manager()->info()->activeTextDocument();
+ QString filepath;
+
+ if (doc)
+ filepath = doc->url().path();
+ else
+ return false;
+
+ QString texfile = manager()->info()->relativePath(baseDir(),filepath);
+ m_urlstr = "file:" + targetDir() + '/' + target() + "#src:" + QString::number(para+1) + ' ' + texfile; // space added, for files starting with numbers
+ addDict("%dir_target", QString::null);
+ addDict("%target", m_urlstr);
+ KILE_DEBUG() << "==KileTool::ForwardDVI::determineTarget()=============\n" << endl;
+ KILE_DEBUG() << "\tusing " << m_urlstr << endl;
+
+ return true;
+ }
+
+ bool ViewBib::determineSource()
+ {
+ KILE_DEBUG() << "==ViewBib::determineSource()=======" << endl;
+ if (!View::determineSource())
+ return false;
+
+ QString path = source(true);
+ QFileInfo info(path);
+
+ //get the bibliographies for this source
+ const QStringList *bibs = manager()->info()->allBibliographies(manager()->info()->docManager()->textInfoFor(path));
+ KILE_DEBUG() << "\tfound " << bibs->count() << " bibs" << endl;
+ if (bibs->count() > 0)
+ {
+ QString bib = bibs->front();
+ if (bibs->count() > 1)
+ {
+ //show dialog
+ bool bib_selected = false;
+ KileListSelector *dlg = new KileListSelector(*bibs, i18n("Select Bibliography"),i18n("Select a bibliography"));
+ if (dlg->exec())
+ {
+ bib = (*bibs)[dlg->currentItem()];
+ bib_selected = true;
+ KILE_DEBUG() << "Bibliography selected : " << bib << endl;
+ }
+ delete dlg;
+
+ if ( ! bib_selected ) {
+ sendMessage(Warning, i18n("No bibliography selected."));
+ return false;
+ }
+ }
+ KILE_DEBUG() << "filename before: " << info.dirPath() << endl;
+ setSource(manager()->info()->checkOtherPaths(info.dirPath(),bib + ".bib",KileInfo::bibinputs));
+ }
+ else if( info.exists() ) //active doc is a bib file
+ {
+ KILE_DEBUG() << "filename before: " << info.dirPath() << endl;
+ setSource(manager()->info()->checkOtherPaths(info.dirPath(),info.fileName(),KileInfo::bibinputs));
+ }
+ else
+ {
+ sendMessage(Error, i18n("No bibliographies found."));
+ return false;
+ }
+ return true;
+ }
+
+ bool ViewHTML::determineTarget()
+ {
+ if (target().isNull())
+ {
+ //setRelativeBaseDir(S());
+ QString dir = readEntry("relDir");
+ QString trg = readEntry("target");
+
+ if ( !dir.isEmpty() )
+ {
+ translate(dir);
+ setRelativeBaseDir(dir);
+ }
+
+ if ( !trg.isEmpty() )
+ {
+ translate(trg);
+ setTarget(trg);
+ }
+
+ //auto-detect the file to view
+ if ( dir.isEmpty() && trg.isEmpty() )
+ {
+ QFileInfo file1 = QFileInfo(baseDir() + '/' + S() + "/index.html");
+ QFileInfo file2 = QFileInfo(baseDir() + '/' + S() + ".html");
+
+ bool read1 = file1.isReadable();
+ bool read2 = file2.isReadable();
+
+ if ( !read1 && !read2 )
+ {
+ sendMessage(Error, i18n("Unable to find %1 or %2; if you are trying to view some other HTML file, go to Settings->Configure Kile->Tools->ViewHTML->Advanced.").arg(file1.absFilePath()).arg(file2.absFilePath()));
+ return false;
+ }
+
+ //both exist, take most recent
+ if ( read1 && read2 )
+ {
+ read1 = file1.lastModified() > file2.lastModified();
+ read2 = !read1;
+ }
+
+ if ( read1 )
+ {
+ dir = S();
+ trg = "index.html";
+
+ translate(dir);
+ setRelativeBaseDir(dir);
+ translate(trg);
+ setTarget(trg);
+ }
+ }
+ }
+
+ return View::determineTarget();
+ }
+}
+
+#include "kilestdtools.moc"
+
diff --git a/src/kile/kilestdtools.h b/src/kile/kilestdtools.h
new file mode 100644
index 0000000..2e89c59
--- /dev/null
+++ b/src/kile/kilestdtools.h
@@ -0,0 +1,129 @@
+/***************************************************************************
+ begin : Thu Nov 27 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILESTDTOOLS_H
+#define KILESTDTOOLS_H
+
+#include "kiledebug.h"
+#include <qstring.h>
+
+#include "kiletool.h"
+
+class KConfig;
+
+namespace KileTool
+{
+ class View;
+ class Compile;
+ class Manager;
+
+ class Factory
+ {
+ public:
+ Factory(Manager *mngr, KConfig *config) : m_manager(mngr), m_config(config) {}
+ ~Factory() {}
+
+ Base* create(const QString & tool, bool prepare = true);
+
+ void writeStdConfig();
+
+ private:
+ Manager *m_manager;
+ KConfig *m_config;
+ };
+
+ class LaTeX : public Compile
+ {
+ Q_OBJECT
+
+ public:
+ LaTeX(const QString & tool, Manager *mngr, bool prepare) : Compile(tool, mngr, prepare) {}
+
+ signals:
+ void jumpToFirstError();
+
+ public slots:
+ bool finish(int);
+
+ protected:
+ bool filterLogfile();
+ void checkErrors(int &nErrors, int &nWarnings);
+ void checkAutoRun(int nErrors, int nWarnings);
+
+ private:
+ bool updateBibs();
+ bool updateIndex();
+ bool updateAsy();
+
+ private:
+ static int m_reRun;
+ };
+
+ class PreviewLaTeX : public LaTeX
+ {
+ Q_OBJECT
+
+ public:
+ PreviewLaTeX(const QString & tool, Manager *mngr, bool prepare) : LaTeX(tool, mngr, prepare) {}
+
+ void setPreviewInfo(const QString &filename, int selrow,int docrow);
+
+ public slots:
+ bool finish(int);
+
+ private:
+ QString m_filename;
+ int m_selrow;
+ int m_docrow;
+
+ };
+
+ class ForwardDVI : public View
+ {
+ public:
+ ForwardDVI(const QString & tool, Manager *mngr, bool prepare = true) : View(tool, mngr, prepare) {}
+
+ protected:
+ bool determineTarget();
+
+ private:
+ QString m_urlstr;
+ };
+
+ class ViewBib : public View
+ {
+ public:
+ ViewBib(const QString & tool, Manager *mngr, bool prepare = true) : View(tool, mngr, prepare) {}
+
+ protected:
+ bool determineSource();
+ };
+
+ class ViewHTML : public View
+ {
+ Q_OBJECT
+
+ public:
+ ViewHTML(const QString & tool, Manager *mngr, bool prepare = true) : View(tool, mngr, prepare) {}
+
+ protected:
+ bool determineTarget();
+
+ signals:
+ void updateStatus(bool, bool);
+ };
+}
+
+#endif
diff --git a/src/kile/kilestdtools.rc b/src/kile/kilestdtools.rc
new file mode 100644
index 0000000..8ed4c52
--- /dev/null
+++ b/src/kile/kilestdtools.rc
@@ -0,0 +1,686 @@
+[Tool/Archive/Tar]
+class=Archive
+command=tar
+options=cvf '%S.tar' %AFL
+from=kilepr
+to=tar
+type=Process
+
+[Tool/Archive/Tar + gzip]
+class=Archive
+command=tar
+options=zcvf '%S.tar.gz' %AFL
+from=kilepr
+to=tar.gz
+type=Process
+
+[Tool/Archive/Tar + bzip2]
+class=Archive
+command=tar
+options=jcvf '%S.tar.bz2' %AFL
+from=kilepr
+to=tar.bz2
+type=Process
+
+[Tool/Archive/Zip]
+class=Archive
+command=zip
+options='%S.zip' %AFL
+from=kilepr
+to=zip
+type=Process
+
+[Tool/BibTeX/Default]
+class=Compile
+command=bibtex
+options='%S'
+from=aux
+to=bbl
+type=Process
+
+[Tool/BibTeX/8bit Version]
+class=Compile
+command=bibtex8
+options='%S'
+from=aux
+to=bbl
+type=Process
+
+[Tool/Convert/eps2png]
+class=Convert
+command=convert
+options=+adjoin -antialias -trim -transparent white -density %res '%S.eps' '%S.png'
+from=eps
+to=png
+type=Process
+
+[Tool/Convert/pdf2png]
+class=Convert
+command=convert
+options=+adjoin -antialias -trim -transparent white -density %res '%S.pdf' '%S.png'
+from=pdf
+to=png
+type=Process
+
+[Tool/DBLaTeX/Convert to DVI]
+class=Compile
+command=dblatex
+options=-tdvi '%S.xml'
+from=xml
+to=dvi
+type=Process
+
+[Tool/DBLaTeX/Convert to PDF]
+class=Compile
+command=dblatex
+from=xml
+to=pdf
+options=-tpdf '%S.xml'
+type=Process
+
+[Tool/DBLaTeX/Convert to LaTeX]
+class=Compile
+command=dblatex
+from=xml
+to=tex
+options=-ttex '%S.xml'
+type=Process
+
+[Tool/DBLaTeX/Convert to Postscript]
+class=Compile
+command=dblatex
+from=xml
+to=ps
+options=-tps '%S.xml'
+type=Process
+
+[Tool/DVItoPDF/Default]
+class=Convert
+command=dvipdfm
+options='%S.dvi'
+from=dvi
+to=pdf
+type=Process
+
+[Tool/DVItoPDF/Modern]
+class=Convert
+command=dvipdfmx
+options='%S.dvi'
+from=dvi
+to=pdf
+type=Process
+
+[Tool/DVItoPDF/Black and White]
+command=dvipdfm
+options=-c '%S.dvi'
+from=dvi
+to=pdf
+type=Process
+
+[Tool/DVItoPDF/Landscape]
+command=dvipdfm
+options=-l '%S.dvi'
+from=dvi
+to=pdf
+type=Process
+
+[Tool/DVItoPNG/Default]
+class=Convert
+command=dvipng
+options=-T tight -D %res -o '%S.png' '%S.dvi'
+from=dvi
+to=png
+type=Process
+
+[Tool/DVItoPS/Default]
+class=Convert
+command=dvips
+options=-o '%S.ps' '%S.dvi'
+from=dvi
+to=ps
+type=Process
+
+[Tool/DVItoPS/dvi2eps]
+class=Convert
+command=dvips
+options=-o '%S.eps' '%S.dvi'
+from=dvi
+to=eps
+type=Process
+
+[Tool/LaTeX/Default]
+class=LaTeX
+command=latex
+options=-interaction=nonstopmode '%source'
+from=
+to=dvi
+type=Process
+checkForRoot=yes
+jumpToFirstError=yes
+autoRun=yes
+
+[Tool/LaTeX/Modern]
+class=LaTeX
+command=latex
+options=-src -interaction=nonstopmode '%source'
+from=
+to=dvi
+type=Process
+checkForRoot=yes
+jumpToFirstError=yes
+autoRun=yes
+
+[Tool/LaTeX to Web/TeX4ht (LaTeX to HTML)]
+class=Compile
+command=mk4ht
+from=tex
+to=html
+options=htlatex '%source'
+type=Process
+
+[Tool/LaTeX to Web/TeX4ht (LaTeX to MathML)]
+class=Compile
+command=mk4ht
+from=tex
+to=xml
+options=xhmlatex '%source'
+type=Process
+
+[Tool/LaTeX to Web/TeX4ht (LaTeX to XML)]
+class=Compile
+command=mk4ht
+from=tex
+to=xml
+options=xhlatex '%source'
+type=Process
+
+[Tool/LaTeX to Web/latex2html]
+class=Compile
+command=latex2html
+options='%source'
+from=tex
+to=html
+type=Process
+
+[Tool/MakeIndex/Default]
+class=Compile
+command=makeindex
+options='%S.idx'
+from=idx
+to=idx
+type=Process
+
+[Tool/MetaPost/Default]
+class=Compile
+command=mpost
+options=-tex=latex -interaction=nonstopmode '%source'
+from=
+to=
+type=Process
+
+[Tool/Asymptote/Default]
+class=Compile
+command=asy
+options='%S'
+from=
+to=
+type=Process
+
+[Tool/PDFLaTeX/Default]
+class=LaTeX
+command=pdflatex
+options=-interaction=nonstopmode '%source'
+from=
+to=pdf
+type=Process
+checkForRoot=yes
+jumpToFirstError=yes
+autoRun=yes
+
+[Tool/PDFLaTeX/Draft]
+class=LaTeX
+command=pdflatex
+options=-draftmode -interaction=nonstopmode '%source'
+from=
+to=pdf
+type=Process
+checkForRoot=yes
+jumpToFirstError=yes
+autoRun=yes
+
+[Tool/PDFLaTeX/Modern]
+class=LaTeX
+command=pdflatex
+options=-src -interaction=nonstopmode '%source'
+from=
+to=pdf
+type=Process
+checkForRoot=yes
+jumpToFirstError=yes
+autoRun=yes
+
+[Tool/PreviewLaTeX/Default]
+autoRun=no
+checkForRoot=no
+class=LaTeXpreview
+command=latex
+from=
+jumpToFirstError=yes
+options=-interaction=nonstopmode '%source'
+to=dvi
+type=Process
+
+[Tool/PreviewPDFLaTeX/Default]
+autoRun=no
+checkForRoot=no
+class=LaTeXpreview
+command=pdflatex
+from=
+jumpToFirstError=yes
+options=-interaction=nonstopmode '%source'
+to=pdf
+type=Process
+
+[Tool/PStoPDF/Default]
+class=Convert
+command=ps2pdf
+options='%S.ps' '%S.pdf'
+from=ps
+to=pdf
+type=Process
+
+[Tool/QuickBuild/LaTeX]
+class=Sequence
+type=Sequence
+sequence=LaTeX
+
+[Tool/QuickBuild/LaTeX+ViewDVI]
+class=Sequence
+type=Sequence
+sequence=LaTeX,ViewDVI
+
+[Tool/QuickBuild/LaTeX+DVItoPS+ViewPS]
+class=Sequence
+type=Sequence
+sequence=LaTeX,DVItoPS,ViewPS
+
+[Tool/QuickBuild/LaTeX+DVItoPDF+ViewPDF]
+class=Sequence
+type=Sequence
+sequence=LaTeX,DVItoPDF,ViewPDF
+
+[Tool/QuickBuild/LaTeX+BibTeX+ViewDVI]
+class=Sequence
+type=Sequence
+sequence=LaTeX,BibTeX,LaTeX,LaTeX,ViewDVI
+
+[Tool/QuickBuild/PDFLaTeX+ViewPDF]
+class=Sequence
+type=Sequence
+sequence=PDFLaTeX,ViewPDF
+
+[Tool/QuickBuild/LaTeX+ForwardDVI]
+class=Sequence
+type=Sequence
+sequence=LaTeX,ForwardDVI
+
+[Tool/QuickBuild/LaTeX+DVItoPS+PStoPDF+ViewPDF]
+class=Sequence
+sequence=LaTeX,DVItoPS,PStoPDF,ViewPDF
+type=Sequence
+
+[Tool/TeX/Default]
+class=Compile
+command=tex
+options=-interaction=nonstopmode '%source'
+from=
+to=dvi
+type=Process
+
+[Tool/TeX/Modern]
+class=Compile
+command=tex
+options=-src -interaction=nonstopmode '%source'
+from=
+to=dvi
+type=Process
+
+[Tool/PDFTeX/Default]
+class=Compile
+command=pdftex
+options=-interaction=nonstopmode '%source'
+from=
+to=pdf
+type=Process
+
+[Tool/PDFTeX/Draft]
+class=Compile
+command=pdftex
+options=-draftmode -interaction=nonstopmode '%source'
+from=
+to=pdf
+type=Process
+
+[Tool/PDFTeX/Modern]
+class=Compile
+command=pdftex
+options=-src -interaction=nonstopmode '%source'
+from=
+to=pdf
+type=Process
+
+[Tool/ViewBib/JabRef]
+type=Process
+class=ViewBib
+command=jabref
+options='%source'
+from=bib
+to=bib
+
+[Tool/ViewBib/Pybliographer]
+type=Process
+class=ViewBib
+command=pybliographic
+options='%source'
+from=bib
+to=bib
+
+[Tool/ViewBib/gbib]
+type=Process
+class=ViewBib
+command=gbib
+options='%source'
+from=bib
+to=bib
+
+[Tool/ViewBib/KBib]
+class=ViewBib
+command=kbib
+options='%source'
+from=bib
+to=bib
+type=Process
+
+[Tool/ViewBib/KBibTex]
+type=Process
+class=ViewBib
+command=kbibtex
+options='%source'
+from=bib
+to=bib
+
+[Tool/ViewBib/KBibTex (embedded)]
+type=Part
+class=ViewBib
+libName=libkbibtexpart
+className=KBibTeXPart
+liboptions='%source'
+state=Viewer
+from=bib
+to=bib
+
+[Tool/ViewHTML/Embedded Viewer]
+type=DocPart
+class=ViewHTML
+state=HTMLpreview
+relDir=
+target=
+from=html
+to=html
+
+[Tool/ViewHTML/Konqueror]
+type=Process
+class=ViewHTML
+state=Editor
+relDir=
+command=konqueror
+options='file:%dir_target/%target'
+target=
+from=html
+to=html
+
+[Tool/ViewHTML/Mozilla]
+type=Process
+class=ViewHTML
+state=Editor
+relDir=
+command=mozilla
+options='file:%dir_target/%target'
+target=
+from=html
+to=html
+
+[Tool/ViewHTML/Firefox]
+type=Process
+class=ViewHTML
+state=Editor
+relDir=
+command=firefox
+options='file:%dir_target/%target'
+target=
+from=html
+to=html
+
+[Tool/ViewDVI/Embedded Viewer]
+class=View
+type=Part
+className=KViewPart
+libName=kviewerpart
+from=dvi
+to=dvi
+state=Viewer
+libOptions=dvi
+
+[Tool/ViewDVI/KDVI]
+class=View
+type=Process
+command=kdvi
+options='%target'
+from=dvi
+to=dvi
+
+[Tool/ViewDVI/KDVI Unique]
+class=View
+type=Process
+command=kdvi
+options=--unique '%target'
+from=dvi
+to=dvi
+
+[Tool/ForwardDVI/Embedded Viewer]
+type=Part
+class=ForwardDVI
+className=KViewPart
+libName=kviewerpart
+from=dvi
+to=dvi
+state=Viewer
+libOptions=dvi
+
+[Tool/ForwardDVI/KDVI]
+class=ForwardDVI
+type=Process
+command=kdvi
+options=--unique '%target'
+from=dvi
+to=dvi
+
+[Tool/ViewPDF/Embedded Viewer]
+class=View
+className=KGVPart
+libName=libkghostviewpart
+state=Viewer
+from=pdf
+to=pdf
+type=Part
+
+[Tool/ViewPDF/KGhostView]
+class=View
+command=kghostview
+options='%target'
+state=Viewer
+from=pdf
+to=pdf
+type=Process
+
+[Tool/ViewPDF/KPDF]
+class=View
+command=kpdf
+options='%target'
+state=Viewer
+from=pdf
+to=pdf
+type=Process
+
+[Tool/ViewPDF/Embedded Viewer]
+class=View
+className=KPDF::Part
+libName=libkpdfpart
+state=Viewer
+from=pdf
+to=pdf
+type=Part
+
+[Tool/ViewPDF/Acroread]
+class=View
+command=acroread
+options='%target'
+state=Viewer
+from=pdf
+to=pdf
+type=Process
+
+[Tool/ViewPS/Embedded Viewer]
+class=View
+className=KGVPart
+libName=libkghostviewpart
+state=Viewer
+from=ps
+to=ps
+type=Part
+
+[Tool/ViewPS/KGhostView]
+class=View
+command=kghostview
+options='%target'
+state=Viewer
+from=ps
+to=ps
+type=Process
+
+[Tool/ViewPS/GV]
+class=View
+command=gv
+options='%target'
+state=Viewer
+from=ps
+to=ps
+type=Process
+
+[Tool/Lilypond/PDF]
+class=Compile
+command=lilypond
+options=--pdf '%source'
+from=ly
+to=pdf
+type=Process
+
+[Tool/Lilypond/DVI]
+class=Compile
+command=lilypond
+options=--dvi '%source'
+from=ly
+to=dvi
+type=Process
+
+[Tool/Lilypond/TeX]
+class=Compile
+command=lilypond
+options=--tex '%source'
+from=ly
+to=tex
+type=Process
+
+[Tool/Lilypond/PS]
+class=Compile
+command=lilypond
+options=--ps '%source'
+from=ly
+to=ps
+type=Process
+
+[Tool/Lilypond/PNG]
+class=Compile
+command=lilypond
+options=--png '%source'
+from=ly
+to=png
+type=Process
+
+[Tools]
+Archive=Tar + gzip
+Asymptote=Default
+BibTeX=Default
+Convert=pdf2png
+DBLaTeX=LaTeX
+DVItoPDF=Default
+DVItoPNG=Default
+DVItoPS=Default
+LaTeX=Default
+LaTeX to Web=latex2html
+MakeIndex=Default
+MetaPost=Default
+PDFLaTeX=Default
+PreviewLaTeX=Default
+PreviewPDFLaTeX=Default
+PStoPDF=Default
+QuickBuild=LaTeX+ViewDVI
+TeX=Default
+PDFTeX=Default
+ViewBib=KBibTex
+ViewHTML=Konqueror
+ViewDVI=KDVI
+ForwardDVI=KDVI
+ViewPDF=KPDF
+ViewPS=KGhostView
+Lilypond=PDF
+
+[ToolsGUI]
+Lilypond=Compile,lilypond
+Archive=Archive,package
+BibTeX=Compile,bibtex
+Convert=Convert,convert
+DVItoPDF=Convert,dvipdf
+DVItoPNG=Convert,dvipng
+DVItoPS=Convert,dvips
+LaTeX=Compile,latex
+LaTeX to Web=Compile,l2h
+DBLaTeX=Compile,dblatex
+MakeIndex=Compile,makeidx
+MetaPost=Compile,mpost
+PDFLaTeX=Compile,pdflatex
+PreviewLaTeX=none,none
+PreviewPDFLaTeX=none,none
+PStoPDF=Convert,ps2pdf
+QuickBuild=Quick,quick
+TeX=Compile,texcompiler
+PDFTeX=Compile,pdftex
+ViewBib=View,viewbib
+ViewHTML=View,viewhtml
+ViewDVI=View,viewdvi
+ForwardDVI=View,dvisearch
+ViewPDF=View,viewpdf
+ViewPS=View,viewps
+
+[Shortcuts]
+tool_QuickBuild=Alt+1
+tool_LaTeX=Alt+2
+tool_ViewDVI=Alt+3
+tool_DVItoPS=Alt+4
+tool_ViewPS=Alt+5
+tool_PDFLaTeX=Alt+6
+tool_ViewPDF=Alt+7
+tool_PStoPDF=Alt+8
+tool_DVItoPDF=Alt+9
+tool_BibTeX=Alt+-
+tool_MakeIndex=Alt+=
diff --git a/src/kile/kilestructurewidget.cpp b/src/kile/kilestructurewidget.cpp
new file mode 100644
index 0000000..3735f23
--- /dev/null
+++ b/src/kile/kilestructurewidget.cpp
@@ -0,0 +1,1014 @@
+/***************************************************************************
+ begin : Sun Dec 28 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ 2005-2007 by Holger Danielsson
+ email : Jeroen.Wijnhout@kdemail.net
+ holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// 2005-11-02: dani
+// - cleaning up source (local variables etc.)
+// - added different QToolTips for each item
+// - add more types of KilelistViewItems
+// - KileStruct::Sect and KileStruct::BeginFloat will remember assigned labels,
+// which are displayed as QToolTips, if these labels are defined in the
+// same or the next line
+// - Caption for type KileStruct::BeginFloat are displayed in the title
+// of this item
+// - \includegraphics and float environment items are displayed
+// - if an item has a companion label, you can use the context menu (right mouse)
+// to insert this label as reference, as a page reference or only the keyword
+// into the text or copy it to the clipboard.
+// - graphics files have also a context menu to open them with a special program
+
+// 2005-12-08: dani
+// - make some items like labels, bibitems, graphics and float environments
+// configurable for the user
+
+// 2005-12-16: dani
+// - add listview item for undefined references
+
+// 2007-02-15: dani
+// - class KileListViewItem gets two new members to
+// save the real cursor position of the command
+
+// 2007-03-12 dani
+// - use KileDocument::Extensions
+
+// 2007-03-17 dani
+// - remember how document structure is collapsed, when structure view is refreshed
+
+// 2007-03-24: dani
+// - preliminary minimal support for Beamer class
+// - \begin{frame}...\end{frame} and \frame{...} are shown in the structure view
+// - if a \frametitle command follows as next LaTeX command, its parameter
+// is taken to replace the standard title of this entry in the structure view
+// - \begin{block}...\end{block} is taken as child of a frame
+
+// 2007-04-06 dani
+// - add TODO/FIXME section to structure view
+
+#include "kilestructurewidget.h"
+
+#include <qfileinfo.h>
+#include <qheader.h>
+#include <qregexp.h>
+#include <qclipboard.h>
+
+#include <kapplication.h>
+#include "kiledebug.h"
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kurl.h>
+#include <krun.h>
+#include <kmimetype.h>
+#include <ktexteditor/markinterface.h>
+
+#include "kileinfo.h"
+#include "kiledocmanager.h"
+#include "kiledocumentinfo.h"
+#include "kileconfig.h"
+
+////////////////////// KileListViewItem with all info //////////////////////
+
+KileListViewItem::KileListViewItem(QListViewItem * parent, QListViewItem * after, const QString &title, const KURL &url, uint line, uint column, int type, int level, uint startline, uint startcol) :
+ KListViewItem(parent,after),
+ m_title(title), m_url(url), m_line(line), m_column(column), m_type(type), m_level(level),
+ m_startline(startline), m_startcol(startcol)
+{
+ setItemEntry();
+}
+
+KileListViewItem::KileListViewItem(QListView * parent, const QString & label) :
+ KListViewItem(parent,label),
+ m_title(label), m_url(KURL()), m_line(0), m_column(0), m_type(KileStruct::None), m_level(0)
+{}
+
+KileListViewItem::KileListViewItem(QListViewItem * parent, const QString & label) :
+ KListViewItem(parent,label),
+ m_title(label), m_url(KURL()), m_line(0), m_column(0), m_type(KileStruct::None), m_level(0)
+{}
+
+void KileListViewItem::setTitle(const QString &title)
+{
+ m_title = title;
+ setItemEntry();
+}
+
+void KileListViewItem::setItemEntry()
+{
+ setText(0, m_title + " (" + i18n("line") + ' ' + QString::number(m_line) + ')');
+}
+
+////////////////////// introduce a new ToolTip //////////////////////
+
+KileListViewToolTip::KileListViewToolTip(KListView *listview) : QToolTip(listview->viewport()), m_listview(listview)
+{}
+
+void KileListViewToolTip::maybeTip(const QPoint &p)
+{
+ if ( ! m_listview )
+ return;
+
+ const KileListViewItem *item = (KileListViewItem *)m_listview->itemAt(p);
+// if ( !item || item->label().isNull() )
+ if ( !item )
+ return;
+
+ const QRect rect = m_listview->itemRect(item);
+ if ( ! rect.isValid() )
+ return;
+
+ if ( ! item->label().isNull() )
+ {
+ tip(rect,i18n("Label: ") + item->label());
+ }
+ else if ( item->line()==0 && item->column()==0 && item->parent()==0L ) // only root
+ {
+ tip(rect,i18n("Click left to jump to the line. A double click will open\n a text file or a graphics file. When a label is assigned\nto this item, it will be shown when the mouse is over\nthis item. Items for a graphics file or an assigned label\nalso offer a context menu (right mouse button)."));
+ }
+}
+
+
+namespace KileWidget
+{
+ ////////////////////// StructureList listview //////////////////////
+
+ StructureList::StructureList(Structure *stack, KileDocument::Info *docinfo) :
+ KListView(stack),
+ m_stack(stack), m_docinfo(docinfo)
+ {
+ show();
+ header()->hide();
+ addColumn(i18n("Structure"),-1);
+ setSorting(-1,true);
+ setAllColumnsShowFocus(true);
+ setFullWidth(true);
+ setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
+
+ QToolTip::remove(this);
+ new KileListViewToolTip(this);
+
+ //connect(this, SIGNAL(clicked(QListViewItem *)), m_stack, SLOT(slotClicked(QListViewItem *)));
+ connect(this, SIGNAL(doubleClicked(QListViewItem *)), m_stack, SLOT(slotDoubleClicked(QListViewItem *)));
+ connect(this, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint & )), m_stack, SLOT(slotPopup(KListView *, QListViewItem * , const QPoint & )));
+
+ connect(this, SIGNAL(executed(QListViewItem*)), m_stack, SLOT(slotClicked(QListViewItem*)));
+ connect(m_stack, SIGNAL(configChanged()), this, SLOT(slotConfigChanged()));
+
+ init();
+ }
+
+ StructureList::~StructureList() {}
+
+ void StructureList::init()
+ {
+ QString title = (m_docinfo == 0L ) ? i18n("No \"structure data\" to display.") : m_docinfo->url().fileName();
+ m_root = new KileListViewItem(this, title);
+ if ( m_docinfo != 0L )
+ {
+ m_root->setURL(m_docinfo->url());
+ m_root->setOpen(true);
+ m_root->setPixmap(0, SmallIcon("contents"));
+ connect(m_docinfo, SIGNAL(foundItem(const QString&, uint, uint, int, int, uint, uint, const QString &, const QString &)),
+ this, SLOT(addItem(const QString&, uint, uint, int, int, uint, uint, const QString &, const QString &)));
+// connect(m_docinfo, SIGNAL(doneUpdating()), this, SLOT(insertInMasterList()));
+ }
+
+ m_parent[0]=m_parent[1]=m_parent[2]=m_parent[3]=m_parent[4]=m_parent[5]=m_parent[6]=m_root;
+ m_lastType = KileStruct::None;
+ m_lastSectioning = 0L;
+ m_lastFloat = 0L;
+ m_lastFrame = 0L;
+ m_lastFrameEnv = 0L;
+ m_stop = false;
+
+ m_folders.clear();
+ m_references.clear();
+
+ if ( m_docinfo )
+ {
+ m_openStructureLabels = m_docinfo->openStructureLabels();
+ m_openStructureReferences = m_docinfo->openStructureReferences();
+ m_openStructureBibitems = m_docinfo->openStructureBibitems();
+ m_openStructureTodo = m_docinfo->openStructureTodo();
+ m_showStructureLabels = m_docinfo->showStructureLabels();
+ }
+ else
+ {
+ m_openStructureLabels = false;
+ m_openStructureReferences = false;
+ m_openStructureBibitems = false;
+ m_openStructureTodo = false;
+ m_showStructureLabels = false;
+ }
+ }
+
+ void StructureList::updateRoot()
+ {
+ m_root->setURL( m_docinfo->url() );
+ m_root->setText(0, m_docinfo->url().fileName() );
+ }
+
+ void StructureList::cleanUp(bool preserveState/* = true */)
+ {
+ KILE_DEBUG() << "==void StructureList::cleanUp()========" << endl;
+ if(preserveState)
+ saveState();
+ clear();
+ if(m_docinfo)
+ disconnect(m_docinfo, 0, this, 0);
+ init();
+ }
+
+ void StructureList::slotConfigChanged(){
+ QWidget *current = m_stack->visibleWidget();
+ if(!current)
+ return;
+ cleanUp(false);
+ m_stack->update(m_docinfo,true,false);
+ m_stack->raiseWidget(current);
+ }
+
+ void StructureList::saveState()
+ {
+ KILE_DEBUG() << "===void StructureList::saveState()" << endl;
+ m_openByTitle.clear();
+ m_openByLine.clear();
+ m_openByFolders.clear();
+
+ QListViewItemIterator it(this);
+ KileListViewItem *item = 0L;
+ while ( it.current() )
+ {
+ item = (KileListViewItem*)it.current();
+ if ( item->firstChild() )
+ {
+ //we don't accept duplicate entries in the map, remove this item alltogether
+ //and rely on the openByLine map instead
+ if ( m_openByTitle.contains ( item->title() ) )
+ m_openByTitle.remove ( item->title() );
+ else
+ m_openByTitle [ item->title() ] = item->isOpen();
+
+ m_openByLine [ item->line() ] = item->isOpen();
+ }
+ ++it;
+ }
+
+ if ( m_folders.contains("labels") )
+ m_openByFolders["labels"] = m_folders["labels"]->isOpen();
+ if ( m_folders.contains("refs") )
+ m_openByFolders["refs"] = m_folders["refs"]->isOpen();
+ if ( m_folders.contains("bibs") )
+ m_openByFolders["bibs"] = m_folders["bibs"]->isOpen();
+ if ( m_folders.contains("todo") )
+ m_openByFolders["todo"] = m_folders["todo"]->isOpen();
+ if ( m_folders.contains("fixme") )
+ m_openByFolders["fixme"] = m_folders["fixme"]->isOpen();
+ }
+
+ bool StructureList::shouldBeOpen(KileListViewItem *item, const QString & folder, int level)
+ {
+ if ( item->parent() == 0L )
+ return true;
+ if ( folder == "labels" )
+ {
+ if ( m_openByFolders.contains("labels") )
+ return m_openByFolders["labels"];
+ else
+ return m_openStructureLabels;
+ }
+ else if ( folder == "refs" )
+ {
+ if ( m_openByFolders.contains("refs") )
+ return m_openByFolders["refs"];
+ else
+ return m_openStructureReferences;
+ }
+ else if ( folder == "bibs" )
+ {
+ if ( m_openByFolders.contains("bibs") )
+ return m_openByFolders["bibs"];
+ else
+ return m_openStructureBibitems;
+ }
+ else if ( folder=="todo" || folder=="fixme" )
+ {
+ if ( m_openByFolders.contains(folder) )
+ return m_openByFolders[folder];
+ else
+ return m_openStructureTodo;
+ }
+
+ if ( m_openByTitle.contains(item->title()) )
+ return m_openByTitle [ item->title() ];
+ else if ( m_openByLine.contains(item->line()) )
+ return m_openByLine [ item->line() ]; //TODO check surrounding lines as well
+ else
+ return ((folder == "root") && level <= m_stack->level());
+ }
+
+ KileListViewItem* StructureList::createFolder(const QString &folder)
+ {
+ KileListViewItem *fldr= new KileListViewItem(m_root, folder);
+ fldr->setOpen(false);
+ if ( folder == "labels" )
+ {
+ fldr->setText(0, i18n("Labels"));
+ fldr->setPixmap(0, SmallIcon("label"));
+ }
+ else if ( folder == "bibs" )
+ {
+ fldr->setText(0, i18n("BibTeX References"));
+ fldr->setPixmap(0, SmallIcon("viewbib"));
+ }
+ else if ( folder == "refs" )
+ {
+ fldr->setText(0, i18n("Undefined References"));
+ fldr->setPixmap(0, SmallIcon("stop"));
+ }
+ else if ( folder == "todo" )
+ {
+ fldr->setText(0, i18n("TODO"));
+ fldr->setPixmap(0, SmallIcon("bookmark"));
+ }
+ else if ( folder == "fixme" )
+ {
+ fldr->setText(0, i18n("FIXME"));
+ fldr->setPixmap(0, SmallIcon("bookmark"));
+ }
+
+ m_folders[ folder ] = fldr;
+
+ return m_folders[folder];
+ }
+
+ KileListViewItem* StructureList::folder(const QString &folder)
+ {
+ KileListViewItem *item = m_folders[folder];
+ if ( item == 0L ) item = createFolder(folder);
+ return item;
+ }
+
+ void StructureList::activate()
+ {
+ m_stack->raiseWidget(this);
+ }
+
+ KileListViewItem *StructureList::parentFor(int lev, const QString & fldr)
+ {
+ KileListViewItem *par = 0L;
+
+ if ( fldr == "root" )
+ {
+ switch (lev)
+ {
+ case KileStruct::Object :
+ case KileStruct::File :
+ par = ( m_lastSectioning == 0L ) ? m_root : m_lastSectioning;
+ break;
+
+ case 0 :
+ case 1 :
+ par = m_root;
+ break;
+
+ default:
+ par = m_parent[lev - 2];
+ break;
+ }
+ }
+ else
+ {
+ par = folder(fldr);
+ }
+
+ return par;
+ }
+
+////////////////////// add a new item to the listview //////////////////////
+
+ /* some items have a special action:
+ - KileStruct::Sect:
+ The new item is saved in m_lastSectioning, so that all following entries
+ can be inserted as children. \part will drop back to level 0 of the Listview,
+ all other sectioning commands will be children of the last sectioning item.
+ If a \label command follows in the same or the next line, it is assigned
+ to this item.
+ - KileStruct::BeginFloat:
+ The new item is saved in m_lastFloat. If a \caption command follows before
+ the floating environment is closed, it is inserted into the title of this item.
+ If a \label command follows, it is assigned to this float item.
+ - KileStruct::EndFloat
+ Reset m_lastFloat to 0L to close this environment. No more \caption or \label
+ commands are assigned to this float after this.
+ - KileStruct::Caption
+ If a float environment is opened, the caption is assigned to the float item.
+ A caption item has hidden attribute, so that no other action is performed and
+ function addItem() will return immediately.
+ - KileStruct::Label
+ If we are inside a float, this label is assigned to this environment. If the last
+ type was a sectioning command on the current line or the line before, the label is
+ assigned to this sectioning item. Assigning means that a popup menu will open,
+ when the mouse is over this item.
+ - KileStruct::BeamerBeginFrame
+ The new item is saved in m_lastFrameEnv. If a \frametitle command follows before
+ the frame environment is closed, it is inserted into the title of this item.
+ If a \label command follows, it is assigned to this float item.
+ - KileStruct::BeamerEndFrame
+ Reset m_lastFloatEnv to 0L to close this environment. No more \frametitle
+ or \label commands are assigned to this frame after this.
+ - KileStruct::BeamerBeginBlock
+ Inside a beamer frame this environment is taken as child of this frame
+ - KileStruct::BeamerFrame
+ The new item is saved in m_lastFrame. If a \frametitle command follows
+ immediately as next command, it is inserted into the title of this item.
+ */
+
+ void StructureList::addItem(const QString &title, uint line, uint column, int type, int lev,
+ uint startline, uint startcol,
+ const QString & pix, const QString &fldr /* = "root" */)
+ {
+// KILE_DEBUG() << "\t\taddItem: " << title << ", with type " << type << endl;
+ if ( m_stop ) return;
+
+ // some types need a special action
+ if ( type == KileStruct::Reference )
+ {
+ m_references.prepend( KileReferenceData(title,line,column) );
+ }
+ else if ( type==KileStruct::Caption && m_lastFloat )
+ {
+ QString floattitle = m_lastFloat->title();
+ if ( floattitle=="figure" || floattitle=="table" )
+ m_lastFloat->setTitle(floattitle+": "+title);
+ }
+ else if ( type == KileStruct::EndFloat )
+ {
+ m_lastFloat = 0L;
+ }
+ else if ( type==KileStruct::BeamerFrametitle )
+ {
+ if ( m_lastFrameEnv )
+ m_lastFrameEnv->setTitle(title);
+ else if ( m_lastFrame )
+ m_lastFrame->setTitle(title);
+ }
+ else if ( type == KileStruct::BeamerEndFrame )
+ {
+ m_lastFrameEnv = 0L;
+ }
+ m_lastFrame = 0L;
+
+ // that's all for hidden types: we must immediately return
+ if ( lev == KileStruct::Hidden )
+ {
+ //KILE_DEBUG() << "\t\thidden item: not created" << endl;
+ return;
+ }
+
+ //KILE_DEBUG() << "\t\tcreate new item" << endl;
+ // check if we have to update a label before loosing this item
+ if ( type==KileStruct::Label )
+ {
+ if ( m_lastFloat )
+ {
+ m_lastFloat->setLabel(title);
+ }
+ else if ( m_lastType==KileStruct::Sect )
+ {
+ // check if this is a follow up label for the last sectioning item
+ if ( m_lastSectioning && (m_lastLine==line-1 || m_lastLine==line) )
+ m_lastSectioning->setLabel(title);
+ }
+ else if(m_lastType == KileStruct::BeamerBeginFrame && m_lastFrameEnv) {
+ m_lastFrameEnv->setLabel(title);
+ }
+
+ if(!m_showStructureLabels) // if we don't want to have it displayed return here
+ return;
+ }
+
+ // remember current type and line for the next call of addItem()
+ m_lastType = type;
+ m_lastLine = line;
+
+ //find the parent for the new element
+ KileListViewItem *parentItem = ( type==KileStruct::BeamerBeginBlock && m_lastFrameEnv ) ? m_lastFrameEnv : parentFor(lev, fldr);
+ if ( parentItem == 0L )
+ {
+ KMessageBox::error(0,i18n("Can't create ListviewItem: no parent found."));
+ return;
+ }
+
+ //find the last element at this level
+ KileListViewItem *lastChild = 0L;
+ KileListViewItem *nextChild = (KileListViewItem *)parentItem->firstChild();
+ while ( nextChild )
+ {
+ lastChild = nextChild;
+ nextChild = (KileListViewItem *)nextChild->nextSibling();
+ }
+
+ // create a new item
+ KileListViewItem *newChild = new KileListViewItem(parentItem, lastChild, title, m_docinfo->url(), line, column, type, lev, startline, startcol);
+ if ( ! pix.isNull() )
+ newChild->setPixmap(0,SmallIcon(pix));
+ //m_stop = true;
+
+ //if the level is not greater than the defaultLevel
+ //open the parentItem to make this item visible
+ parentItem->setOpen( shouldBeOpen(parentItem,fldr,lev) );
+
+ //update the m_parent levels, such that section etc. get inserted at the correct level
+ //m_current = newChild;
+ if ( lev > 0)
+ {
+ m_parent[lev-1] = newChild;
+ for (int l = lev; l < 7; ++l)
+ m_parent[l] = newChild;
+ }
+ else if ( lev == 0 )
+ {
+ m_lastSectioning = 0L;
+ for ( int l = 0; l < 7; ++l ) m_parent[l] = m_root;
+ }
+
+ // check if we have to remember the new item for setting a label or caption
+ if ( type == KileStruct::Sect )
+ m_lastSectioning = newChild;
+ else if ( type == KileStruct::BeginFloat )
+ m_lastFloat = newChild;
+ else if ( type == KileStruct::BeamerBeginFrame )
+ m_lastFrameEnv = newChild;
+ else if ( type == KileStruct::BeamerFrame )
+ m_lastFrame = newChild;
+ }
+
+ void StructureList::showReferences(KileInfo *ki)
+ {
+ // remove old listview item for references, if it exists
+ if ( m_folders.contains("refs") )
+ {
+ KileListViewItem *refitem = m_folders["refs"];
+ m_root->takeItem(refitem);
+ delete refitem;
+
+ m_folders.remove("refs");
+ }
+
+ //KILE_DEBUG() << "==void StructureList::showReferences()========" << endl;
+ //KILE_DEBUG() << "\tfound " << m_references.count() << " references" << endl;
+ if ( m_references.count() == 0 )
+ return;
+
+ // read list with all labels
+ const QStringList *list = ki->allLabels();
+ //KILE_DEBUG() << "\tfound " << list->count() << " labels" << endl;
+ QMap<QString,bool> labelmap;
+ for ( QStringList::ConstIterator itmap=list->begin(); itmap!=list->end(); ++itmap )
+ {
+ labelmap[(*itmap)] = true;
+ }
+
+ // now check if there are unsolved references
+ QValueListConstIterator<KileReferenceData> it;
+ for ( it=m_references.begin(); it!=m_references.end(); ++it )
+ {
+ if ( ! labelmap.contains((*it).name()) )
+ {
+ KileListViewItem *refitem = folder("refs");
+ refitem->setOpen( shouldBeOpen(refitem,"refs",0) );
+ new KileListViewItem(refitem,0L,(*it).name(),m_docinfo->url(),(*it).line(),(*it).column(),KileStruct::Reference,KileStruct::NotSpecified, 0,0 );
+ }
+ }
+ }
+
+ ////////////////////// Structure: QWidgetStack //////////////////////
+
+ Structure::Structure(KileInfo *ki, QWidget * parent, const char * name) :
+ QWidgetStack(parent,name),
+ m_ki(ki),
+ m_docinfo(0L)
+ {
+ KILE_DEBUG() << "==KileWidget::Structure::Structure()===========" << endl;
+ setLineWidth(0);
+ setMidLineWidth(0);
+ setMargin(0);
+ setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
+
+ m_default = new StructureList(this, 0L);
+ m_default->activate();
+
+ m_popup = new KPopupMenu(this, "structureview_popup");
+ }
+
+ Structure::~Structure()
+ {
+ }
+
+ int Structure::level()
+ {
+ return KileConfig::defaultLevel();
+ }
+
+ void Structure::addDocumentInfo(KileDocument::Info *docinfo)
+ {
+ StructureList *view = new StructureList(this, docinfo);
+ addWidget(view);
+ m_map.insert(docinfo, view, true);
+ }
+
+ void Structure::slotClicked(QListViewItem * itm)
+ {
+ KILE_DEBUG() << "\tStructure::slotClicked" << endl;
+
+ KileListViewItem *item = (KileListViewItem *)itm;
+ //return if user didn't click on an item
+ if (! item) return;
+
+ if (! (item->type() & KileStruct::None ))
+ emit(setCursor(item->url(), item->line()-1, item->column()));
+ else if ( item->parent() == 0L ) //root item
+ emit(setCursor(item->url(), 0, 0));
+ }
+
+ void Structure::slotDoubleClicked(QListViewItem * itm)
+ {
+ KILE_DEBUG() << "\tStructure::slotDoubleClicked" << endl;
+ KileListViewItem *item = (KileListViewItem*)(itm);
+ static QRegExp::QRegExp suffix("\\.[\\d\\w]*$");
+
+ if (!item)
+ return;
+
+ KILE_DEBUG() <<"item->url() is " << item->url() << ", item->title() is " << item->title() << endl;
+
+ if ( item->type() & (KileStruct::Input | KileStruct::Bibliography | KileStruct::Graphics) )
+ {
+ QString fname = item->title();
+
+ if(fname.find(suffix) != -1) // check if we have a suffix, if not add standard suffixes
+ {
+ KILE_DEBUG() << "Suffix found: " << suffix.cap(0) << endl;
+ }
+ else
+ {
+ // filename in structureview entry has no extension: this shouldn't happen anymore,
+ // because all have got one in function updateStruct(). But who knows?
+ if ( item->type() == KileStruct::Input )
+ fname += m_ki->extensions()->latexDocumentDefault();
+ else if ( item->type() == KileStruct::Bibliography )
+ fname += m_ki->extensions()->bibtexDefault();
+ else
+ {
+ // FIXME get graphics suffix from an project config option
+ }
+ }
+
+ if(fname.left(1) != "/") // no absolute path
+ {
+ QString fn = m_ki->getCompileName();
+ fname= QFileInfo(fn).dirPath() + '/' + fname;
+ }
+
+ QFileInfo fi(fname);
+ KURL url;
+ url.setPath(fname);
+
+ if (fi.isReadable())
+ {
+ if ( item->type() == KileStruct::Graphics )
+ {
+ KMimeType::Ptr pMime = KMimeType::findByURL(url);
+ KRun::runURL(url,pMime->name());
+ }
+ else
+ emit(fileOpen(url, QString::null));
+ }
+ else if( item->type() == KileStruct::Bibliography ){
+ fname = m_ki->checkOtherPaths(fi.dirPath(),fi.fileName(),KileInfo::bibinputs);
+ fi.setFile(fname);
+ url.setPath(fname);
+ if(fi.isReadable()){
+ emit(fileOpen(url, QString::null));
+ }
+ }
+ else if( item->type() == KileStruct::Input ){
+ fname = m_ki->checkOtherPaths(fi.dirPath(),fi.fileName(),KileInfo::texinputs);
+ fi.setFile(fname);
+ url.setPath(fname);
+ if(fi.isReadable()){
+ emit(fileOpen(url, QString::null));
+ }
+ }
+ else{
+ if ( KMessageBox::warningYesNo(this, i18n("Cannot find the included file. The file does not exist, is not readable or Kile is unable to determine the correct path to it. The filename causing this error was: %1.\nDo you want to create this file?").arg(fname), i18n("Cannot Find File"))
+ == KMessageBox::Yes)
+ {
+ emit(fileNew(url));
+ }
+ }
+ }
+ }
+
+ // all popup items get different id's, so that we can see, what item is activated
+ // - label: 1 - 6
+ // - sectioning: 10 - 16
+ // - graphics: 100ff
+
+ void Structure::slotPopup(KListView *, QListViewItem *itm, const QPoint &point)
+ {
+ KILE_DEBUG() << "\tStructure::slotPopup" << endl;
+
+ m_popupItem = (KileListViewItem *)(itm);
+ if ( ! m_popupItem )
+ return;
+
+ m_popup->clear();
+ m_popup->disconnect();
+
+ bool hasLabel = ! m_popupItem->label().isEmpty();
+ if ( m_popupItem->type() == KileStruct::Sect )
+ {
+ if ( hasLabel )
+ m_popup->insertTitle(i18n("Sectioning"));
+ m_popup->insertItem(i18n("Cu&t"),SectioningCut);
+ m_popup->insertItem(i18n("&Copy"),SectioningCopy);
+ m_popup->insertItem(i18n("&Paste below"),SectioningPaste);
+ m_popup->insertSeparator();
+ m_popup->insertItem(i18n("&Select"),SectioningSelect);
+ m_popup->insertItem(i18n("&Delete"),SectioningDelete);
+ m_popup->insertSeparator();
+ m_popup->insertItem(i18n("C&omment"),SectioningComment);
+ m_popup->insertSeparator();
+ m_popup->insertItem(i18n("Run QuickPreview"), SectioningPreview);
+ }
+ else if ( m_popupItem->type() == KileStruct::Graphics )
+ {
+ m_popupInfo = m_popupItem->title();
+
+ if(m_popupInfo.left(1) != "/") // no absolute path
+ {
+ QString fn = m_ki->getCompileName();
+ m_popupInfo = QFileInfo(fn).dirPath() + '/' + m_popupInfo;
+ }
+
+ QFileInfo fi(m_popupInfo);
+ if ( fi.isReadable() )
+ {
+ KURL url;
+ url.setPath(m_popupInfo);
+
+ m_offerList = KTrader::self()->query(KMimeType::findByURL(url)->name(), "Type == 'Application'");
+ for (uint i=0; i < m_offerList.count(); ++i)
+ {
+ m_popup->insertItem(SmallIcon(m_offerList[i]->icon()), m_offerList[i]->name(), i+SectioningGraphicsOfferlist);
+ }
+ m_popup->insertSeparator();
+ m_popup->insertItem(i18n("Other..."), SectioningGraphicsOther);
+ }
+ }
+
+ if ( hasLabel)
+ {
+ m_popup->insertTitle(i18n("Insert Label"));
+ m_popup->insertItem(i18n("As &reference"),1);
+ m_popup->insertItem(i18n("As &page reference"),2);
+ m_popup->insertItem(i18n("Only the &label"),3);
+ m_popup->insertSeparator();
+ m_popup->insertTitle(i18n("Copy Label to Clipboard"));
+ m_popup->insertItem(i18n("As reference"),4);
+ m_popup->insertItem(i18n("As page reference"),5);
+ m_popup->insertItem(i18n("Only the label"),6);
+ }
+
+ if ( m_popup->count() > 0 )
+ {
+ connect(m_popup,SIGNAL(activated(int)),this,SLOT(slotPopupActivated(int)));
+ m_popup->exec(point);
+ }
+ }
+
+ void Structure::slotPopupActivated(int id)
+ {
+ if ( id>=1 && id<=6 )
+ slotPopupLabel(id);
+ else if ( id>=SectioningCut && id<=SectioningPreview )
+ slotPopupSectioning(id);
+ else if ( id>=SectioningGraphicsOther && id<=SectioningGraphicsOfferlist+(int)m_offerList.count() )
+ slotPopupGraphics(id);
+ }
+
+ // id's 1..6 (already checked)
+ void Structure::slotPopupLabel(int id)
+ {
+ KILE_DEBUG() << "\tStructure::slotPopupLabel (" << id << ")"<< endl;
+
+ QString s = m_popupItem->label();
+ if ( id==1 || id==4 )
+ s = "\\ref{" + s + '}';
+ else if ( id==2 || id==5 )
+ s = "\\pageref{" + s + '}';
+
+ if ( id <= 3 )
+ emit( sendText(s) );
+ else
+ QApplication::clipboard()->setText(s);
+ }
+
+ // id's 10..16 (already checked)
+ void Structure::slotPopupSectioning(int id)
+ {
+ KILE_DEBUG() << "\tStructure::slotPopupSectioning (" << id << ")"<< endl;
+ if ( m_popupItem->level()>=1 && m_popupItem->level()<=7 )
+ emit( sectioningPopup(m_popupItem,id) );
+ }
+
+ // id's 100ff (already checked)
+ void Structure::slotPopupGraphics(int id)
+ {
+ KILE_DEBUG() << "\tStructure::slotPopupGraphics (" << id << ")"<< endl;
+
+ KURL url;
+ url.setPath(m_popupInfo);
+
+ if ( id == SectioningGraphicsOther )
+ KRun::displayOpenWithDialog(url);
+ else
+ KRun::run(*m_offerList[id-SectioningGraphicsOfferlist],url);
+ }
+
+ StructureList* Structure::viewFor(KileDocument::Info *info)
+ {
+ if ( info == 0L ) return 0L;
+
+ if ( ! viewExistsFor(info) )
+ m_map.insert(info, new StructureList(this, info), true);
+
+ return m_map[info];
+ }
+
+ bool Structure::viewExistsFor(KileDocument::Info *info)
+ {
+ if ( info == 0L ) return false;
+ else
+ return m_map.contains(info);
+ }
+
+ void Structure::closeDocumentInfo(KileDocument::Info *docinfo)
+ {
+ m_docinfo = 0L;
+ if ( m_map.contains(docinfo) )
+ {
+ StructureList *data = m_map[docinfo];
+ m_map.remove(docinfo);
+ delete data;
+ }
+
+ if ( m_map.isEmpty() ) m_default->activate();
+ }
+
+ void Structure::clear()
+ {
+ QMapIterator<KileDocument::Info *, StructureList *> it;
+ QMapIterator<KileDocument::Info *, StructureList *> itend(m_map.end());
+ for ( it = m_map.begin(); it != itend; ++it)
+ if ( it.data() != 0L ) delete it.data();
+
+ m_map.clear();
+ m_docinfo = 0L;
+
+ m_default->activate();
+ }
+
+ void Structure::updateUrl(KileDocument::Info *docinfo)
+ {
+ StructureList *view = viewFor(docinfo);
+ if ( view )
+ view->updateRoot();
+ }
+
+ void Structure::update(KileDocument::Info *docinfo)
+ {
+ update(docinfo, true);
+ }
+
+ void Structure::update(KileDocument::Info *docinfo, bool parse, bool activate /* =true */)
+ {
+ KILE_DEBUG() << "==KileWidget::Structure::update(" << docinfo << ")=============" << endl;
+
+ if ( docinfo == 0L )
+ {
+ m_default->activate();
+ return;
+ }
+
+ m_docinfo = docinfo;
+
+ bool needParsing = parse || ( ! viewExistsFor(m_docinfo) );
+
+ //find structview-item for this docinfo
+ StructureList *view = viewFor(m_docinfo);
+
+ if ( needParsing ) //need to reparse the doc
+ {
+ int xtop = view->contentsX();
+ int ytop = view->contentsY();
+ //KILE_DEBUG() << "\tStructure::update parsing doc" << endl;
+ view->cleanUp();
+ m_docinfo->updateStruct();
+ view->showReferences(m_ki);
+ view->setContentsPos(xtop,ytop);
+ }
+
+ if(activate)
+ {
+ KILE_DEBUG() << "===Structure::update() activating view" << endl;
+ view->activate();
+ }
+ }
+
+ void Structure::clean(KileDocument::Info *docinfo)
+ {
+ KILE_DEBUG() << "==void Structure::clean()========" << endl;
+ StructureList *view = viewFor(docinfo);
+ if (view) view->cleanUp();
+ }
+
+ void Structure::updateReferences(KileDocument::Info *docinfo)
+ {
+ KILE_DEBUG() << "==void StructureList::updateReferences()========" << endl;
+ StructureList *view = viewFor(docinfo);
+ if (view)
+ {
+ view->showReferences(m_ki);
+ }
+ }
+
+ ////////////////////// Structure: find sectioning //////////////////////
+
+ bool Structure::findSectioning(KileListViewItem *refItem, Kate::Document *doc, uint row, uint col, bool backwards, bool checkLevel, uint &sectRow, uint &sectCol)
+ {
+ KileDocument::TextInfo *docinfo = m_ki->docManager()->textInfoFor(doc);
+
+ if ( ! docinfo ){
+ return false;
+ }
+
+ if( checkLevel && !refItem ){ // only allow a refItem == NULL if checkLevel is false
+ return false;
+ }
+
+ bool found = false;
+ uint foundRow,foundCol;
+ StructureList *structurelist = viewFor(docinfo);
+ QListViewItemIterator it( structurelist );
+ while ( it.current() )
+ {
+ KileListViewItem *item = (KileListViewItem *)(it.current());
+ if (item->type() == KileStruct::Sect && (!checkLevel || item->level() <= refItem->level()))
+ {
+ foundRow = item->startline() - 1;
+ foundCol = item->startcol() - 1;
+ if ( backwards )
+ {
+ if ( foundRow<row || (foundRow==row &&foundCol<col) )
+ {
+ sectRow = foundRow;
+ sectCol = foundCol;
+ found = true;
+ }
+ else
+ {
+ return found;
+ }
+
+ }
+ else if ( !backwards && (foundRow>row || (foundRow==row &&foundCol>col)) )
+ {
+ sectRow = foundRow;
+ sectCol = foundCol;
+ return true;
+ }
+ }
+ ++it;
+ }
+
+ return found;
+ }
+
+}
+
+#include "kilestructurewidget.moc"
diff --git a/src/kile/kilestructurewidget.h b/src/kile/kilestructurewidget.h
new file mode 100644
index 0000000..6e596c3
--- /dev/null
+++ b/src/kile/kilestructurewidget.h
@@ -0,0 +1,244 @@
+/***************************************************************************
+ begin : Sun Dec 28 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ 2005-2007 by Holger Danielsson
+ email : Jeroen.Wijnhout@kdemail.net
+ : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEWIDGET_STRUCTURE_H
+#define KILEWIDGET_STRUCTURE_H
+
+ /**
+ * @author Jeroen Wijnhout, Holger Danielsson
+ **/
+
+#include <qwidgetstack.h>
+#include <qvbox.h>
+#include <qtooltip.h>
+
+#include <klistview.h>
+#include <kpopupmenu.h>
+#include <ktrader.h>
+
+#include "kiledocumentinfo.h"
+
+//2007-02-15: dani
+// - class KileListViewItem not only saves the cursor position of the parameter,
+// but also the real cursor position of the command
+
+class QString;
+class KURL;
+class KileInfo;
+class QListViewItem;
+
+/**
+ * ListView items that can hold some additional information appropriate for the Structure View. The
+ * additional information is: line number, title string.
+ **/
+
+class KileListViewItem : public KListViewItem
+{
+public:
+ KileListViewItem(QListViewItem * parent, QListViewItem * after, const QString &title, const KURL &url, uint line, uint m_column, int type, int level, uint startline, uint startcol);
+ KileListViewItem(QListView * parent, const QString & label);
+ KileListViewItem(QListViewItem * parent, const QString & label);
+
+ /** @returns the title of this element (for a label it return the label), without the (line ...) part **/
+ const QString& title() const { return m_title; }
+ /** @returns the line number of the structure element. **/
+ const uint line() const { return m_line; }
+ /** @returns the column number of the structure element, right after the { **/
+ const uint column() const { return m_column; }
+ /** @returns the type of element, see @ref KileStruct **/
+ const int type() const { return m_type; }
+ const uint startline() const { return m_startline; }
+ const uint startcol() const { return m_startcol; }
+ /**@returns the file in which this item was found*/
+ const KURL & url() const { return m_url; }
+ void setURL(const KURL & url) { m_url = url; }
+
+ const int level() const { return m_level; }
+ const QString &label() const { return m_label; }
+
+ void setTitle(const QString &title);
+ void setLabel(const QString &label) { m_label = label; }
+
+private:
+ QString m_title;
+ KURL m_url;
+ uint m_line;
+ uint m_column;
+ int m_type, m_level;
+ uint m_startline;
+ uint m_startcol;
+ QString m_label;
+
+ void setItemEntry();
+};
+
+class KileListViewToolTip : public QToolTip
+{
+public:
+ KileListViewToolTip(KListView *listview);
+protected:
+ void maybeTip(const QPoint &p);
+private:
+ KListView *m_listview;
+};
+
+class KileReferenceData
+{
+public:
+ KileReferenceData() {}
+ KileReferenceData(const QString &name,uint line,uint column) : m_name(name), m_line(line), m_column(column) {}
+ ~KileReferenceData() {}
+
+ const QString &name() const { return m_name; }
+ const uint line() const { return m_line; }
+ const uint column() const { return m_column; }
+
+private:
+ QString m_name;
+ uint m_line;
+ uint m_column;
+};
+
+namespace KileWidget
+{
+ class Structure; //forward declaration
+
+ class StructureList : public KListView
+ {
+ Q_OBJECT
+
+ public:
+ StructureList(Structure *stack, KileDocument::Info *docinfo);
+ ~StructureList();
+
+ void activate();
+ void cleanUp(bool preserveState = true);
+ void showReferences(KileInfo *ki);
+
+ KURL url() const { return m_docinfo->url(); }
+ void updateRoot();
+
+ public slots:
+ void addItem(const QString &title, uint line, uint column, int type, int level, uint startline, uint startcol,
+ const QString & pix, const QString &folder = "root" );
+ void slotConfigChanged();
+
+ private:
+ KileListViewItem *parentFor(int lev, const QString & fldr);
+
+ void init();
+ KileListViewItem* createFolder(const QString &folder);
+ KileListViewItem* folder(const QString &folder);
+
+ void saveState();
+ bool shouldBeOpen(KileListViewItem *item, const QString & folder, int level);
+
+ private:
+ Structure *m_stack;
+ KileDocument::Info *m_docinfo;
+ QMap<QString, KileListViewItem *> m_folders;
+ QMap<QString, bool> m_openByTitle;
+ QMap<uint, bool> m_openByLine;
+ QMap<QString, bool> m_openByFolders;
+ KileListViewItem *m_parent[7], *m_root;
+ QValueList<KileReferenceData> m_references;
+ bool m_openStructureLabels;
+ bool m_openStructureReferences;
+ bool m_openStructureBibitems;
+ bool m_openStructureTodo;
+ bool m_showStructureLabels;
+
+ int m_lastType;
+ uint m_lastLine;
+ KileListViewItem *m_lastSectioning;
+ KileListViewItem *m_lastFloat;
+ KileListViewItem *m_lastFrame;
+ KileListViewItem *m_lastFrameEnv;
+
+ bool m_stop;
+ };
+
+ class Structure : public QWidgetStack
+ {
+ Q_OBJECT
+
+ public:
+ Structure(KileInfo *, QWidget * parent, const char * name = 0);
+ ~Structure();
+
+ int level();
+ KileInfo *info() { return m_ki; }
+
+ bool findSectioning(KileListViewItem *item, Kate::Document *doc, uint row, uint col, bool backwards, bool checkLevel, uint &sectRow, uint &sectCol);
+ void updateUrl(KileDocument::Info *docinfo);
+
+ enum { SectioningCut=10, SectioningCopy=11, SectioningPaste=12,
+ SectioningSelect=13, SectioningDelete=14,
+ SectioningComment=15,
+ SectioningPreview=16,
+ SectioningGraphicsOther=100, SectioningGraphicsOfferlist=101
+ };
+
+ public slots:
+ void slotClicked(QListViewItem *);
+ void slotDoubleClicked(QListViewItem *);
+ void slotPopup(KListView *, QListViewItem *itm, const QPoint &point);
+ void slotPopupActivated(int id);
+
+ void addDocumentInfo(KileDocument::Info *);
+ void closeDocumentInfo(KileDocument::Info *);
+ void update(KileDocument::Info*);
+ void update(KileDocument::Info *, bool, bool activate =true);
+ void clean(KileDocument::Info *);
+ void updateReferences(KileDocument::Info *);
+
+ /**
+ * Clears the structure widget and empties the map between KileDocument::Info objects and their structure trees (QListViewItem).
+ **/
+ void clear();
+
+ signals:
+ void sendText(const QString &);
+ void setCursor(const KURL &, int, int);
+ void fileOpen(const KURL &, const QString &);
+ void fileNew(const KURL &);
+ void configChanged();
+ void sectioningPopup(KileListViewItem *item, int id);
+
+ private:
+ StructureList* viewFor(KileDocument::Info *info);
+ bool viewExistsFor(KileDocument::Info *info);
+
+ void slotPopupLabel(int id);
+ void slotPopupSectioning(int id);
+ void slotPopupGraphics(int id);
+
+ private:
+ KileInfo *m_ki;
+ KileDocument::Info *m_docinfo;
+ QMap<KileDocument::Info *, StructureList *> m_map;
+ StructureList *m_default;
+
+ KPopupMenu *m_popup;
+ KileListViewItem *m_popupItem;
+ QString m_popupInfo;
+
+ KTrader::OfferList m_offerList;
+ };
+}
+
+#endif
diff --git a/src/kile/kiletool.cpp b/src/kile/kiletool.cpp
new file mode 100644
index 0000000..ab5faca
--- /dev/null
+++ b/src/kile/kiletool.cpp
@@ -0,0 +1,677 @@
+/***************************************************************************
+ begin : mon 3-11 20:40:00 CEST 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kiletool.h"
+
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qmetaobject.h>
+#include <qregexp.h>
+#include <qtimer.h>
+
+#include <klocale.h>
+#include <kconfig.h>
+#include <kurl.h>
+
+#include "kileconfig.h"
+#include "kileuntitled.h"
+#include "kiletool_enums.h"
+#include "kilestdtools.h" //for the factory
+#include "kiletoolmanager.h"
+#include "kiledocmanager.h"
+#include "kileinfo.h"
+#include "kiledocumentinfo.h"
+#include "kileproject.h"
+
+namespace KileTool
+{
+ Base::Base(const QString &name, Manager * manager, bool prepare /* = true */) :
+ m_manager(manager),
+ m_name(name),
+ m_from(QString::null),
+ m_to(QString::null),
+ m_target(QString::null),
+ m_basedir(QString::null),
+ m_relativedir(QString::null),
+ m_targetdir(QString::null),
+ m_source(QString::null),
+ m_S(QString::null),
+ m_options(QString::null),
+ m_resolution(QString::null),
+ m_launcher(0L),
+ m_quickie(false),
+ m_bPrepareToRun(prepare)
+ {
+ m_manager->initTool(this);
+
+ m_flags = NeedTargetDirExec | NeedTargetDirWrite | NeedActiveDoc | NeedMasterDoc | NoUntitledDoc | NeedSourceExists | NeedSourceRead;
+
+ setMsg(NeedTargetDirExec, i18n("Could not change to the folder %1."));
+ setMsg(NeedTargetDirWrite, i18n("The folder %1 is not writable, therefore %2 will not be able to save its results."));
+ setMsg(NeedTargetExists, i18n("The file %1/%2 does not exist. If you're surprised, check the file permissions."));
+ setMsg(NeedTargetRead, i18n("The file %1/%2 is not readable. If you're surprised, check the file permissions."));
+ setMsg(NeedActiveDoc, i18n("Could not determine on which file to run %1, because there is no active document."));
+ setMsg(NeedMasterDoc, i18n("Could not determine the master file for this document."));
+ setMsg(NoUntitledDoc, i18n("Please save the untitled document first."));
+ setMsg(NeedSourceExists, i18n("Sorry, the file %1 does not exist."));
+ setMsg(NeedSourceRead, i18n("Sorry, the file %1 is not readable."));
+
+ m_bPrepared = false;
+ }
+
+ Base::~Base()
+ {
+ KILE_DEBUG() << "DELETING TOOL: " << name() << endl;
+ delete m_launcher;
+ }
+
+ const QString Base::source(bool absolute /* = true */) const
+ {
+ if (m_source.isNull())
+ return QString::null;
+
+ QString src = m_source;
+ if (absolute)
+ src = m_basedir + '/' + src;
+
+ return src;
+ }
+
+ void Base::setMsg(long n, const QString & msg)
+ {
+ m_messages[n] = msg;
+ }
+
+ void Base::translate(QString &str)
+ {
+ QDictIterator<QString> it(*paramDict());
+ for( it.toFirst() ; it.current(); ++it )
+ {
+// KILE_DEBUG() << "translate " << str << " /// key=" << it.currentKey() << " value=" << *(it.current()) << endl;
+ str.replace(it.currentKey(), *( it.current() ) );
+ }
+ }
+
+ void Base::prepareToRun(const QString &cfg)
+ {
+ KILE_DEBUG() << "==Base::prepareToRun()=======" << endl;
+
+ m_bPrepared = true;
+ m_nPreparationResult = Running;
+
+ //configure me
+ if (!configure(cfg))
+ {
+ m_nPreparationResult = ConfigureFailed;
+ m_bPrepared = false;
+ return;
+ }
+
+ //install a launcher
+ if (!installLauncher())
+ {
+ m_nPreparationResult = NoLauncherInstalled;
+ m_bPrepared = false;
+ return;
+ }
+
+ if (!determineSource())
+ {
+ m_nPreparationResult = NoValidSource;
+ m_bPrepared = false;
+ return;
+ }
+
+ if (!determineTarget())
+ {
+ m_nPreparationResult = NoValidTarget;
+ m_bPrepared = false;
+ return;
+ }
+
+ if ( m_launcher == 0 )
+ {
+ m_nPreparationResult = NoLauncherInstalled;
+ m_bPrepared = false;
+ return;
+ }
+
+ m_launcher->setWorkingDirectory(workingDir());
+
+ //fill in the dictionary
+ addDict("%options", m_options);
+
+ m_resolution = KileConfig::dvipngResolution() ;
+ addDict("%res",m_resolution);
+ }
+
+ int Base::run()
+ {
+ KILE_DEBUG() << "==KileTool::Base::run()=================" << endl;
+
+ if ( m_nPreparationResult != 0 )
+ return m_nPreparationResult;
+
+ if (!checkSource())
+ return NoValidSource;
+
+ if (!checkTarget())
+ return TargetHasWrongPermissions;
+
+ if (!checkPrereqs())
+ return NoValidPrereqs;
+
+ //everything ok so far
+ emit(requestSaveAll(false, true));
+ emit(start(this));
+
+ if (!m_launcher->launch())
+ {
+ KILE_DEBUG() << "\tlaunching failed" << endl;
+ if (!m_launcher->selfCheck())
+ return SelfCheckFailed;
+ else
+ return CouldNotLaunch;
+ }
+
+ KILE_DEBUG() << "\trunning..." << endl;
+
+ return Running;
+
+ }
+
+ bool Base::determineSource()
+ {
+ QString src = source();
+
+ //the basedir is determined from the current compile target
+ //determined by getCompileName()
+ if (src.isNull()) src = m_ki->getCompileName();
+
+ setSource(src);
+
+ return true;
+ }
+
+ bool Base::checkSource()
+ {
+ //FIXME deal with tools that do not need a source or target (yes they exist)
+ //Is there an active document? Only check if the source file is not explicitly set.
+ if ( (m_source.isNull()) && (m_manager->info()->activeTextDocument() == 0L) )
+ {
+ sendMessage(Error, msg(NeedActiveDoc).arg(name()));
+ return false;
+ }
+
+ if ( (m_source.isNull()) && (m_manager->info()->activeTextDocument() != 0L) )
+ {
+ //couldn't find a source file, huh?
+ //we know there is an active document, the only reason is could have failed is because
+ //we couldn't find a LaTeX root document
+ sendMessage(Error, msg(NeedMasterDoc));
+ return false;
+ }
+
+ if ( KileUntitled::isUntitled(m_source) && (flags() & NoUntitledDoc) )
+ {
+ sendMessage(Error, msg(NoUntitledDoc));
+ emit(requestSaveAll());
+ return false;
+ }
+
+ QFileInfo fi(source());
+ if ( (flags() & NeedSourceExists) && !fi.exists() )
+ {
+ sendMessage(Error, msg(NeedSourceExists).arg(fi.absFilePath()));
+ return false;
+ }
+
+ if ( (flags() & NeedSourceRead) && !fi.isReadable() )
+ {
+ sendMessage(Error, msg(NeedSourceRead).arg(fi.absFilePath()));
+ return false;
+ }
+
+ return true;
+ }
+
+ void Base::setSource(const QString &source)
+ {
+ m_from = readEntry("from");
+
+ QFileInfo info(source);
+
+ if (!m_from.isNull())
+ {
+ QString src = source;
+ if ( (m_from.length() > 0) && (info.extension(false).length() > 0) )
+ src.replace(QRegExp(info.extension(false) + '$'), m_from);
+ info.setFile(src);
+ }
+
+ m_basedir = info.dirPath(true);
+ m_source = info.fileName();
+ m_S = info.baseName(true);
+
+ addDict("%dir_base", m_basedir);
+ addDict("%source", m_source);
+ addDict("%S",m_S);
+
+ KILE_DEBUG() << "===KileTool::Base::setSource()==============" << endl;
+ KILE_DEBUG() << "using " << source << endl;
+ KILE_DEBUG() << "source="<<m_source<<endl;
+ KILE_DEBUG() << "S=" << m_S << endl;
+ KILE_DEBUG() << "basedir=" << m_basedir << endl;
+ }
+
+ bool Base::determineTarget()
+ {
+ QFileInfo info(source());
+
+ m_to = readEntry("to");
+
+ //if the target is not set previously, use the source filename
+ if (m_target.isNull())
+ {
+ //test for explicit override
+ if ( !readEntry("target").isEmpty() )
+ {
+ KILE_DEBUG() << "USING target SETTING" << endl;
+ m_target = readEntry("target");
+ }
+ else if ( to().length() > 0)
+ m_target = S() + '.' + to();
+ else
+ m_target = source(false);
+ }
+
+ if ( m_relativedir.isNull() && (!readEntry("relDir").isEmpty()) )
+ {
+ m_relativedir = readEntry("relDir");
+ }
+
+ KURL url = KURL::fromPathOrURL(m_basedir);
+ url.addPath(m_relativedir);
+ url.cleanPath();
+ m_targetdir = url.path();
+
+ setTarget(m_target);
+ setTargetDir(m_targetdir);
+
+ KILE_DEBUG() << "==KileTool::Base::determineTarget()=========" << endl;
+ KILE_DEBUG() << "\tm_targetdir=" << m_targetdir << endl;
+ KILE_DEBUG() << "\tm_target=" << m_target << endl;
+
+ return true;
+ }
+
+ bool Base::checkTarget()
+ {
+ //check if the target directory is accessible
+ QFileInfo info(m_targetdir);
+
+ if ( (flags() & NeedTargetDirExec ) && (! info.isExecutable()) )
+ {
+ sendMessage(Error, msg(NeedTargetDirExec).arg(m_targetdir));
+ return false;
+ }
+
+ if ((flags() & NeedTargetDirWrite) && (! info.isWritable()) )
+ {
+ sendMessage(Error, msg(NeedTargetDirWrite).arg(m_targetdir).arg(m_name));
+ return false;
+ }
+
+ info.setFile(m_targetdir + '/' + m_target);
+
+ if ( (flags() & NeedTargetExists) && ( ! info.exists() ))
+ {
+ sendMessage(Error, msg(NeedTargetExists).arg(m_targetdir).arg(m_target));
+ return false;
+ }
+
+ if ( (flags() & NeedTargetRead) && ( ! info.isReadable() ))
+ {
+ sendMessage(Error, msg(NeedTargetRead).arg(m_targetdir).arg(m_target));
+ return false;
+ }
+
+ return true;
+ }
+
+ void Base::setTarget(const QString &target)
+ {
+ m_target = target;
+ addDict("%target", m_target);
+ }
+
+ void Base::setTargetDir(const QString &target)
+ {
+ m_targetdir = target;
+ addDict("%dir_target", m_targetdir);
+ }
+
+ void Base::setTargetPath(const QString &target)
+ {
+ QFileInfo fi(target);
+ setTarget(fi.fileName());
+ setTargetDir(fi.dirPath(true));
+ }
+
+ bool Base::checkPrereqs()
+ {
+ return true;
+ }
+
+ bool Base::configure(const QString &cfg)
+ {
+ return m_manager->configure(this, cfg);
+ }
+
+ void Base::stop()
+ {
+ if (m_launcher)
+ m_launcher->kill();
+
+ //emit(done(this, Aborted));
+ }
+
+ bool Base::finish(int result)
+ {
+ KILE_DEBUG() << "==KileTool::Base::finish()==============" << endl;
+ if (sender())
+ {
+ KILE_DEBUG() << "\tcalled by " << sender()->name() << " " << sender()->className() << endl;
+ }
+
+ if ( result == Aborted )
+ sendMessage(Error, "Aborted");
+
+ if ( result == Success )
+ sendMessage(Info,"Done!");
+
+ KILE_DEBUG() << "\temitting done(Base*, int) " << name() << endl;
+ emit(done(this, result));
+
+ //we will only get here if the done() signal is not connected to the manager (who will destroy this object)
+ if (result == Success)
+ return true;
+ else
+ return false;
+ }
+
+ void Base::installLauncher(Launcher *lr)
+ {
+ if(m_launcher != lr)
+ delete m_launcher;
+
+ m_launcher = lr;
+ //lr->setParamDict(paramDict());
+ lr->setTool(this);
+
+ connect(lr, SIGNAL(message(int, const QString &)), this, SLOT(sendMessage(int, const QString &)));
+ connect(lr, SIGNAL(output(const QString &)), this, SLOT(filterOutput(const QString &)));
+ connect(lr, SIGNAL(done(int)), this, SLOT(finish(int)));
+ }
+
+ bool Base::installLauncher()
+ {
+ if (m_launcher)
+ return true;
+
+ QString type = readEntry("type");
+ KILE_DEBUG() << "installing launcher of type " << type << endl;
+ Launcher *lr = 0;
+
+ if ( type == "Process" )
+ {
+ lr = new ProcessLauncher();
+ }
+ else if ( type == "Konsole" )
+ {
+ lr = new KonsoleLauncher();
+ }
+ else if ( type == "Part" )
+ {
+ lr = new PartLauncher();
+ }
+ else if ( type == "DocPart" )
+ {
+ lr = new DocPartLauncher();
+ }
+
+ if (lr)
+ {
+ installLauncher(lr);
+ return true;
+ }
+ else
+ {
+ m_launcher = 0;
+ return false;
+ }
+ }
+
+ void Base::sendMessage(int type, const QString &msg)
+ {
+ emit(message(type, msg, name()));
+ }
+
+ void Base::filterOutput(const QString & str)
+ {
+ //here you have the change to filter the output and do some error extraction for example
+ //this should be done by a OutputFilter class
+
+ //idea: store the buffer until a complete line (or more) has been received then parse these lines
+ //just send the buf immediately to the output widget, the results of the parsing are displayed in
+ //the log widget anyway.
+ emit(output(str));
+ }
+
+ bool Base::addDict(const QString & key, const QString & value)
+ {
+ bool e = (paramDict()->find(key) == 0);
+ paramDict()->replace(key, &value);
+ return e;
+ }
+
+ bool Base::needsUpdate(const QString &target, const QString &source)
+ {
+ KILE_DEBUG() << "==Base::needsUpdate(" << target << "," << source << endl;
+ QFileInfo targetinfo(target);
+ QFileInfo sourceinfo(source);
+ QDateTime currDateTime = QDateTime::currentDateTime();
+
+ if ( !(sourceinfo.exists() && sourceinfo.isReadable()) )
+ {
+ KILE_DEBUG() << "\treturning false: source doesn't exist" << endl;
+ return false;
+ }
+
+ if ( ! targetinfo.exists() )
+ {
+ KILE_DEBUG() << "\treturning true: target doesn't exist" << endl;
+ return true;
+ }
+
+ KILE_DEBUG() << "\ttarget: " << targetinfo.lastModified().toString() << endl;
+ KILE_DEBUG() << "\tsource: " << sourceinfo.lastModified().toString() << endl;
+
+ if( targetinfo.lastModified() > currDateTime ){
+
+ KILE_DEBUG() << "targetinfo.lastModifiedTime() is in the future" << endl;
+ return false;
+ }
+ else if( sourceinfo.lastModified() > currDateTime ){
+
+ KILE_DEBUG() << "sourceinfo.lastModifiedTime() is in the future" << endl;
+ return false;
+ }
+
+ KILE_DEBUG() << "\treturning " << (targetinfo.lastModified() < sourceinfo.lastModified()) << endl;
+ return targetinfo.lastModified() < sourceinfo.lastModified();
+ }
+
+ Compile::Compile(const QString &name, Manager * manager, bool prepare /*= true*/)
+ : Base(name, manager, prepare)
+ {
+ setFlags( flags() | NeedTargetDirExec | NeedTargetDirWrite);
+ }
+
+ Compile::~Compile()
+ {}
+
+ bool Compile::checkSource()
+ {
+ if ( !Base::checkSource() ) return false;
+
+ bool isRoot = true;
+ KileDocument::TextInfo *docinfo = manager()->info()->docManager()->textInfoFor(source());
+ if (docinfo) isRoot = (readEntry("checkForRoot") == "yes") ? docinfo->isLaTeXRoot() : true;
+
+ if (!isRoot)
+ {
+ return manager()->queryContinue(i18n("The document %1 is not a LaTeX root document; continue anyway?").arg(source()), i18n("Continue?"));
+ }
+
+ return true;
+ }
+
+ View::View(const QString &name, Manager * manager, bool prepare /*= true*/)
+ : Base(name, manager, prepare)
+ {
+ setFlags( NeedTargetDirExec | NeedTargetExists | NeedTargetRead);
+
+ KILE_DEBUG() << "View: flag " << (flags() & NeedTargetExists) << endl;
+ setMsg(NeedTargetExists, i18n("The file %2/%3 does not exist; did you compile the source file?"));
+ }
+
+ View::~View()
+ {
+ }
+
+
+ Archive::Archive(const QString &name, Manager * manager, bool prepare /* = true*/)
+ : Base(name, manager,prepare)
+ {
+ setFlags( NeedTargetDirExec | NeedTargetDirWrite );
+ }
+
+ Archive::~Archive()
+ {}
+
+ bool Archive::checkPrereqs()
+ {
+ if(m_project == 0L)
+ {
+ sendMessage(Error,i18n("The current document is not associated to a project. Please activate a document that is associated to the project you want to archive, then choose Archive again."));
+ return false;
+ }
+ else if(m_fileList.isEmpty())
+ {
+ sendMessage(Error,i18n("No files have been chosen for archiving."));
+ return false;
+ }
+ else
+ return true;
+ }
+
+ void Archive::setSource(const QString &source)
+ {
+ KURL url = KURL::fromPathOrURL(source);
+ m_project = manager()->info()->docManager()->projectFor(url);
+ if ( !m_project )
+ m_project = manager()->info()->docManager()->activeProject();
+ if ( !m_project )
+ m_project = manager()->info()->docManager()->selectProject(i18n("Archive Project"));
+ if ( !m_project )
+ {
+ Base::setSource(source);
+ return;
+ }
+ manager()->info()->docManager()->projectSave(m_project);
+ Base::setSource(m_project->url().path());
+ m_fileList = m_project->archiveFileList();
+
+ addDict("%AFL", m_fileList);
+
+ KILE_DEBUG() << "===KileTool::Archive::setSource("<< source << ")==============" << endl;
+ KILE_DEBUG() << "m_fileList="<<m_fileList<<endl;
+ }
+
+ Convert::Convert(const QString &name, Manager * manager, bool prepare /*= true*/)
+ : Base(name, manager,prepare)
+ {
+ setFlags( flags() | NeedTargetDirExec | NeedTargetDirWrite );
+ }
+
+ Convert::~Convert()
+ {
+ }
+
+ bool Convert::determineSource()
+ {
+ bool br = Base::determineSource();
+ setSource(baseDir() + '/' + S() + '.' + from());
+ return br;
+ }
+
+ Sequence::Sequence(const QString &name, Manager * manager, bool prepare /*= true*/) :
+ Base(name, manager, prepare)
+ {
+ }
+
+ int Sequence::run()
+ {
+ KILE_DEBUG() << "==KileTool::Sequence::run()==================" << endl;
+
+ configure();
+ determineSource();
+ if (!checkSource()) return NoValidSource;
+
+ QStringList tools = QStringList::split(',',readEntry("sequence"));
+ QString tl, cfg;
+ Base *tool;
+ for (uint i=0; i < tools.count(); ++i)
+ {
+ tools[i] = tools[i].stripWhiteSpace();
+ extract(tools[i], tl, cfg);
+
+ tool = manager()->factory()->create(tl, false); //create tool with delayed preparation
+ if (tool)
+ {
+ KILE_DEBUG() << "===tool created with name " << tool->name() << endl;
+ if ( ! (manager()->info()->watchFile() && tool->isViewer() ) )
+ {
+ KILE_DEBUG() << "\tqueueing " << tl << "(" << cfg << ") with " << source() << endl;
+ tool->setSource(source());
+ manager()->run(tool, cfg);
+ }
+ }
+ else
+ {
+ sendMessage(Error, i18n("Unknown tool %1.").arg(tools[i]));
+ emit(done(this, Failed));
+ return ConfigureFailed;
+ }
+ }
+
+ emit(done(this,Silent));
+
+ return Success;
+ }
+}
+
+#include "kiletool.moc"
diff --git a/src/kile/kiletool.h b/src/kile/kiletool.h
new file mode 100644
index 0000000..8f516c3
--- /dev/null
+++ b/src/kile/kiletool.h
@@ -0,0 +1,323 @@
+/***************************************************************************
+ begin : mon 3-11 20:40:00 CEST 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILETOOL_H
+#define KILETOOL_H
+
+#include "kilelauncher.h"
+
+#include <qobject.h>
+#include <qmap.h>
+#include <qstring.h>
+#include <qdict.h>
+#include <qstringlist.h>
+
+class KConfig;
+class KileInfo;
+class KShellProcess;
+class KileProject;
+
+namespace KileTool
+{
+ typedef QMap<QString,QString> Config;
+
+ class Manager;
+
+ /**
+ * A class that defines a general tool (latex, dvips etc.) to be launched from
+ * within Kile.
+ *
+ * @author Jeroen Wijnhout
+ **/
+
+ class Base : public QObject
+ {
+ Q_OBJECT
+
+ public:
+ Base(const QString &name, Manager *manager, bool prepare = true);
+ ~Base();
+
+ /**
+ * Sets the KileInfo object, this is already taken care of by the Manager.
+ **/
+ void setInfo(KileInfo *ki) { m_ki = ki; }
+
+ /**
+ * Sets the KConfig object, this is already taken care of by the Manager.
+ **/
+ void setConfig(KConfig *config) { m_config = config; }
+
+ /**
+ * @returns the Manager object for this tool.
+ **/
+ Manager* manager() const { return m_manager; }
+
+ /**
+ * @returns a short descriptive name for this tool.
+ **/
+ const QString& name() const { return m_name; }
+
+ /**
+ * Allows you to set the source file explicitly (absolute path).
+ **/
+ virtual void setSource(const QString & source);
+
+ /**
+ * @returns the source file that is used to run the tool on.
+ **/
+ const QString source(bool absolute = true) const;
+
+ const QString S() const { return m_S; }
+ const QString baseDir() const { return m_basedir; }
+ const QString relativeDir() const { return m_relativedir; }
+ const QString targetDir() const { return m_targetdir; }
+ const QString from() const { return m_from; }
+ const QString to() const { return m_to; }
+ const QString target() const { return m_target; }
+ const QString options() const { return m_options; }
+
+ void setOptions(const QString &opt) { m_options = opt; }
+
+ virtual bool isViewer() { return false; }
+
+ void setQuickie() { m_quickie = true; }
+ bool isQuickie() { return m_quickie; }
+
+ /**
+ * Allows you to set the target file explicitly (filename only).
+ **/
+ virtual void setTarget(const QString & target);
+ virtual void setTargetDir(const QString & target);
+ virtual void setTargetPath(const QString & target);
+
+ /**
+ * Sets the target directory relative to the source directory.
+ **/
+ void setRelativeBaseDir(const QString & dir) { m_relativedir = dir; }
+
+ /**
+ * Installs a launcher object that will be responsible for actually starting the tool. The
+ * tool can be a command-line tool or a kpart, the KileTool class doesn't need to know
+ * about the specifics of the launcher.
+ **/
+ void installLauncher(Launcher *lr );
+
+ /**
+ * Installs a launcher as indicated by the tool type. This creates a launcher object.
+ **/
+ bool installLauncher();
+
+ /**
+ * @returns a pointer to the launcher object, returns 0 if no launcher is installed.
+ **/
+ Launcher *launcher() { return m_launcher; }
+
+ /**
+ * @returns the working dir for this tool.
+ **/
+ const QString &workingDir() const { return m_basedir; }
+
+ /**
+ * @returns the dictionary that translates the following keys
+ * %dir_base : the directory of the root file
+ * %dir_target : same as %dir_base, except when the relativeDir has been set explicitly, then %dir_target= %dir_base/relativedir
+ * %source : the source file (no path)
+ * %S : the source filename without an extension (no path)
+ **/
+ QDict<QString>* paramDict() { return &m_dictParams; }
+
+ bool addDict(const QString & key, const QString & value);
+
+ void translate(QString &str);
+
+ void setFlags(uint flags) { m_flags = flags; }
+ uint flags() { return m_flags; }
+
+ void setMsg(long n, const QString & msg);
+ QString msg(long n) const { return m_messages[n]; }
+
+ protected:
+ bool needsUpdate(const QString &target, const QString &source);
+
+ public slots:
+ void sendMessage(int, const QString &);
+ virtual void filterOutput(const QString &);
+
+ signals:
+ void message(int, const QString &, const QString &);
+ void output(const QString &);
+
+ void start(Base*);
+ void done(Base*, int);
+
+ void requestSaveAll(bool amAutoSaving = false, bool disUntitled= false);
+
+ public:
+ void setEntryMap(Config map) { m_entryMap = map; }
+ const QString readEntry(const QString & key) { return m_entryMap[key]; }
+
+ public:
+ virtual void prepareToRun(const QString &cfg = QString::null);
+ bool isPrepared() { return m_bPrepared; }
+ bool needsToBePrepared() { return m_bPrepareToRun; }
+
+ protected:
+ /**
+ * Checks if the prerequisites are in order.
+ * @returns true if everything is ok, false otherwise.
+ **/
+ virtual bool checkPrereqs();
+
+ /**
+ * Determines on which file to run the tool.
+ **/
+ virtual bool determineSource();
+
+ /**
+ * Determines the target of the tool (i.e. a DVI for latex, PS for dvips) and
+ * checks if the target file can be written to the specified location.
+ **/
+ virtual bool determineTarget();
+
+ /**
+ * Check if the target dir and file have the correct permissions (according to the flags set).
+ **/
+ virtual bool checkTarget();
+
+ virtual bool checkSource();
+
+ public:
+ /**
+ * Configures the tool object.
+ **/
+ virtual bool configure(const QString & cfg = QString::null);
+
+ public slots:
+ /**
+ * Starts the tool. First it performs basic checks (checkPrereqs()),
+ * if all is well it launches the tool (launch()). After the process has
+ * exited it calls finish().
+ * @return the exit code of the tool (if available)
+ **/
+ virtual int run();
+
+ /**
+ * Terminates the running process.
+ **/
+ virtual void stop();
+
+ /**
+ * Clean up after the process/lib has finished.
+ **/
+ virtual bool finish(int);
+
+ private:
+ Manager *m_manager;
+ KileInfo *m_ki;
+ KConfig *m_config;
+
+ QString m_name, m_from, m_to;
+ QString m_target, m_basedir, m_relativedir, m_targetdir, m_source, m_S, m_options;
+ QString m_resolution;
+
+ QString m_message;
+
+ bool m_buildPrereqs;
+
+ protected:
+ Launcher *m_launcher;
+ bool m_quickie;
+
+ private:
+ QDict<QString> m_dictParams;
+ Config m_entryMap;
+
+ uint m_flags;
+ int m_nPreparationResult;
+ bool m_bPrepared;
+ bool m_bPrepareToRun;
+
+ //messages
+ QMap<long,QString> m_messages;
+ };
+
+ /**
+ * A class that represents a compile tool (such as latex, pdflatex).
+ **/
+ class Compile : public Base
+ {
+ public:
+ Compile(const QString &name, Manager * manager, bool prepare = true);
+ ~Compile();
+
+ protected:
+ bool checkSource();
+ };
+
+ /**
+ * A class that represents a view tool (such as KDVI, gv, etc.).
+ **/
+ class View : public Base
+ {
+ public:
+ View(const QString &name, Manager * manager, bool prepare = true);
+ ~View();
+
+ bool isViewer() { return true; }
+ };
+
+ /**
+ * A class that represents a conversion tool (such as dvips).
+ **/
+ class Convert : public Base
+ {
+ public:
+ Convert(const QString &name, Manager * manager, bool prepare = true);
+ ~Convert();
+
+ bool determineSource();
+ };
+
+ /**
+ * A class that represents a tool like tar, from multiple files to one file
+ **/
+ class Archive: public Base
+ {
+ Q_OBJECT
+
+ public:
+ Archive(const QString &name, Manager * manager, bool prepare = true);
+ ~Archive();
+ bool checkPrereqs();
+ void setSource(const QString & source);
+ private:
+ KileProject *m_project;
+ QString m_fileList;
+ };
+
+ class Sequence : public Base
+ {
+ Q_OBJECT
+
+ public:
+ Sequence(const QString &name, Manager * manager, bool prepare = true);
+
+ public slots:
+ int run();
+ };
+}
+
+#endif
diff --git a/src/kile/kiletool_enums.h b/src/kile/kiletool_enums.h
new file mode 100644
index 0000000..d6a98c2
--- /dev/null
+++ b/src/kile/kiletool_enums.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ begin : mon 3-11 20:40:00 CEST 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILETOOL_ENUMS_H
+#define KILETOOL_ENUMS_H
+
+namespace KileTool
+{
+ /**
+ * KileTool can send several types of messages
+ * Error
+ * Warning
+ * Info
+ **/
+ enum { Error = 0, Warning, Info, ProblemError, ProblemWarning, ProblemBadBox };
+
+ enum { NeedTargetDirExec = 0x01, NeedTargetDirWrite = 0x02, NeedTargetExists = 0x04, NeedTargetRead = 0x08,
+ NeedActiveDoc = 0x10, NeedMasterDoc = 0x20, NoUntitledDoc = 0x40, NeedSourceExists = 0x80, NeedSourceRead = 0x100 };
+
+ enum { Running = 0, ConfigureFailed, NoLauncherInstalled, NoValidTarget, NoValidSource, TargetHasWrongPermissions, NoValidPrereqs, CouldNotLaunch, SelfCheckFailed};
+
+ enum { Success = 0, Failed = 1, AbnormalExit = 2, Aborted = 3, Silent = 4 };
+}
+#endif
diff --git a/src/kile/kiletoolconfigwidget.cpp b/src/kile/kiletoolconfigwidget.cpp
new file mode 100644
index 0000000..d4f43a1
--- /dev/null
+++ b/src/kile/kiletoolconfigwidget.cpp
@@ -0,0 +1,536 @@
+/***************************************************************************
+ begin : Sat 3-1 20:40:00 CEST 2004
+ copyright : (C) 2004 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kiletoolconfigwidget.h"
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qgroupbox.h>
+#include <qspinbox.h>
+#include <qvbox.h>
+#include <qregexp.h>
+#include <qtabwidget.h>
+#include <qwidgetstack.h>
+
+#include "kiledebug.h"
+#include <klistbox.h>
+#include <keditlistbox.h>
+#include <klocale.h>
+#include <kicondialog.h>
+#include <kiconloader.h>
+#include <kcombobox.h>
+#include <kpushbutton.h>
+#include <kconfig.h>
+#include <klineedit.h>
+#include <kmessagebox.h>
+#include <kinputdialog.h>
+
+#include "kiletoolmanager.h"
+#include "kilestdtools.h"
+#include "toolconfigwidget.h"
+#include "processtoolconfigwidget.h"
+#include "librarytoolconfigwidget.h"
+#include "quicktoolconfigwidget.h"
+#include "latextoolconfigwidget.h"
+#include "newtoolwizard.h"
+
+namespace KileWidget
+{
+ ToolConfig::ToolConfig(KileTool::Manager *mngr, QWidget *parent, const char *name) :
+ QWidget(parent, name),
+ m_manager(mngr)
+ {
+ m_config = m_manager->config();
+ m_layout = new QGridLayout(this, 1, 1, 0, 0);
+ m_configWidget = new ToolConfigWidget(this);
+ m_layout->addWidget(m_configWidget, 0, 0);
+
+ m_tabGeneral = m_configWidget->m_tab->page(0);
+ m_tabAdvanced = m_configWidget->m_tab->page(1);
+ m_tabMenu = m_configWidget->m_tab->page(2);
+
+ updateToollist();
+ // --->m_configWidget->m_lstbTools->setSelected(0, true);
+ m_configWidget->m_lstbTools->setSelected(indexQuickBuild(), true);
+ connect(m_configWidget->m_cbConfig, SIGNAL(activated(int)), this, SLOT(switchConfig(int)));
+
+ QStringList lst; lst << i18n( "Quick" ) << i18n( "Compile" ) << i18n( "Convert" ) << i18n( "View" ) << i18n( "Other" );
+ m_configWidget->m_cbMenu->insertStringList(lst);
+ connect(m_configWidget->m_cbMenu, SIGNAL(activated(const QString &)), this, SLOT(setMenu(const QString &)));
+ connect(m_configWidget->m_pshbIcon, SIGNAL(clicked()), this, SLOT(selectIcon()));
+
+ connect(m_configWidget->m_pshbRemoveTool, SIGNAL(clicked()), this, SLOT(removeTool()));
+ connect(m_configWidget->m_pshbNewTool, SIGNAL(clicked()), this, SLOT(newTool()));
+ connect(m_configWidget->m_pshbRemoveConfig, SIGNAL(clicked()), this, SLOT(removeConfig()));
+ connect(m_configWidget->m_pshbNewConfig, SIGNAL(clicked()), this, SLOT(newConfig()));
+ connect(m_configWidget->m_pshbDefault, SIGNAL(clicked()), this, SLOT(writeDefaults()));
+
+ //--->m_current = m_configWidget->m_lstbTools->text(0);
+ m_current = m_configWidget->m_lstbTools->currentText();
+ m_manager->retrieveEntryMap(m_current, m_map, false, false);
+ QString cfg = KileTool::configName(m_current, m_config);
+ m_configWidget->m_cbConfig->insertItem(cfg);
+
+ setupGeneral();
+ setupAdvanced();
+
+ switchConfig(cfg);
+ switchTo(m_current, false);
+ connect(m_configWidget->m_lstbTools, SIGNAL(highlighted(const QString &)), this, SLOT(switchTo(const QString &)));
+
+ connect(this, SIGNAL(changed()), this, SLOT(updateAdvanced()));
+ connect(this, SIGNAL(changed()), this, SLOT(updateGeneral()));
+ }
+
+ void ToolConfig::setupAdvanced()
+ {
+ m_configWidget->m_cbType->insertItem(i18n("Run Outside of Kile"));
+ m_configWidget->m_cbType->insertItem(i18n("Run in Konsole"));
+ m_configWidget->m_cbType->insertItem(i18n("Run Embedded in Kile"));
+ m_configWidget->m_cbType->insertItem(i18n("Use HTML Viewer"));
+ m_configWidget->m_cbType->insertItem(i18n("Run Sequence of Tools"));
+ connect(m_configWidget->m_cbType, SIGNAL(activated(int)), this, SLOT(switchType(int)));
+ connect(m_configWidget->m_ckClose, SIGNAL(toggled(bool)), this, SLOT(setClose(bool)));
+
+ m_classes << "Compile" << "Convert" << "Archive" << "View" << "Sequence" << "LaTeX" << "ViewHTML" << "ViewBib" << "ForwardDVI" << "Base";
+ m_configWidget->m_cbClass->insertStringList(m_classes);
+ connect(m_configWidget->m_cbClass, SIGNAL(activated(const QString &)), this, SLOT(switchClass(const QString &)));
+
+ connect(m_configWidget->m_leSource, SIGNAL(textChanged(const QString &)), this, SLOT(setFrom(const QString &)));
+ connect(m_configWidget->m_leTarget, SIGNAL(textChanged(const QString &)), this, SLOT(setTo(const QString &)));
+ connect(m_configWidget->m_leFile, SIGNAL(textChanged(const QString &)), this, SLOT(setTarget(const QString &)));
+ connect(m_configWidget->m_leRelDir, SIGNAL(textChanged(const QString &)), this, SLOT(setRelDir(const QString &)));
+
+ m_configWidget->m_cbState->insertItem("Editor");
+ m_configWidget->m_cbState->insertItem("Viewer");
+ m_configWidget->m_cbState->insertItem("HTMLpreview");
+ connect(m_configWidget->m_cbState, SIGNAL(activated(const QString &)), this, SLOT(setState(const QString &)));
+ }
+
+ void ToolConfig::updateAdvanced()
+ {
+ bool enablekonsoleclose = false;
+ QString type = m_map["type"];
+ if ( type == "Process" ) m_configWidget->m_cbType->setCurrentItem(0);
+ else if ( type == "Konsole" )
+ {
+ m_configWidget->m_cbType->setCurrentItem(1);
+ enablekonsoleclose = true;
+ }
+ else if ( type == "Part" ) m_configWidget->m_cbType->setCurrentItem(2);
+ else if ( type == "DocPart" ) m_configWidget->m_cbType->setCurrentItem(3);
+ else if ( type == "Sequence" ) m_configWidget->m_cbType->setCurrentItem(4);
+ m_configWidget->m_ckClose->setEnabled(enablekonsoleclose);
+
+ QString state = m_map["state"];
+ if ( state.isEmpty() ) state = "Editor";
+ m_configWidget->m_cbState->setCurrentText(state);
+
+ int index = m_classes.findIndex(m_map["class"]);
+ if ( index == -1 ) index = m_classes.count()-1;
+ m_configWidget->m_cbClass->setCurrentItem(index);
+ m_configWidget->m_ckClose->setChecked(m_map["close"] == "yes");
+ m_configWidget->m_leSource->setText(m_map["from"]);
+ m_configWidget->m_leTarget->setText(m_map["to"]);
+ m_configWidget->m_leFile->setText(m_map["target"]);
+ m_configWidget->m_leRelDir->setText(m_map["relDir"]);
+ }
+
+ void ToolConfig::setupGeneral()
+ {
+ m_configWidget->m_stackBasic->addWidget(new QLabel(i18n("Use the \"Advanced\" tab to configure this tool."), this), GBS_None);
+
+ m_ptcw = new ProcessToolConfigWidget(m_configWidget->m_stackBasic);
+ m_configWidget->m_stackBasic->addWidget(m_ptcw, GBS_Process);
+ connect(m_ptcw->m_leCommand, SIGNAL(textChanged(const QString &)), this, SLOT(setCommand(const QString &)));
+ connect(m_ptcw->m_leOptions, SIGNAL(textChanged(const QString &)), this, SLOT(setOptions(const QString &)));
+
+ m_ltcw = new LibraryToolConfigWidget(m_configWidget->m_stackBasic);
+ m_configWidget->m_stackBasic->addWidget(m_ltcw, GBS_Library);
+ connect(m_ltcw->m_leLibrary, SIGNAL(textChanged(const QString &)), this, SLOT(setLibrary(const QString &)));
+ connect(m_ltcw->m_leLibClass, SIGNAL(textChanged(const QString &)), this, SLOT(setClassName(const QString &)));
+ connect(m_ltcw->m_leOptions, SIGNAL(textChanged(const QString &)), this, SLOT(setLibOptions(const QString &)));
+
+ m_qtcw = new QuickToolConfigWidget(m_configWidget->m_stackBasic);
+ m_configWidget->m_stackBasic->addWidget(m_qtcw, GBS_Sequence);
+ connect(m_qtcw, SIGNAL(sequenceChanged(const QString &)), this, SLOT(setSequence(const QString &)));
+
+ m_configWidget->m_stackBasic->addWidget(new QLabel(i18n("Unknown tool type; your configuration data is malformed.\nPerhaps it is a good idea to restore the default settings."), this), GBS_Error);
+
+ m_configWidget->m_stackExtra->addWidget(new QWidget(this), GES_None);
+
+ m_LaTeXtcw = new LaTeXToolConfigWidget(m_configWidget->m_stackExtra);
+ m_configWidget->m_stackExtra->addWidget(m_LaTeXtcw, GES_LaTeX);
+ connect(m_LaTeXtcw->m_ckRootDoc, SIGNAL(toggled(bool)), this, SLOT(setLaTeXCheckRoot(bool)));
+ connect(m_LaTeXtcw->m_ckJump, SIGNAL(toggled(bool)), this, SLOT(setLaTeXJump(bool)));
+ connect(m_LaTeXtcw->m_ckAutoRun, SIGNAL(toggled(bool)), this, SLOT(setLaTeXAuto(bool)));
+
+// m_ViewBibtcw = new ViewBibToolConfigWidget(m_configWidget->m_stackExtra);
+// m_configWidget->m_stackExtra->addWidget(m_ViewBibtcw, GES_ViewBib);
+// connect(m_ViewBibtcw->m_ckRunLyxServer, SIGNAL(toggled(bool)), this, SLOT(setRunLyxServer(bool)));
+ }
+
+ void ToolConfig::updateGeneral()
+ {
+ QString type = m_map["type"];
+
+ int basicPage = GBS_None;
+ int extraPage = GES_None;
+
+ if ( type == "Process" || type == "Konsole" ) basicPage = GBS_Process;
+ else if ( type == "Part" ) basicPage = GBS_Library;
+ else if ( type == "DocPart" ) basicPage = GBS_None;
+ else if ( type == "Sequence" )
+ {
+ basicPage = GBS_Sequence;
+ m_qtcw->updateSequence(m_map["sequence"]);
+ }
+ else basicPage = GBS_Error;
+
+ QString cls = m_map["class"];
+ if ( cls == "LaTeX" )
+ extraPage = GES_LaTeX;
+// else if ( cls == "ViewBib" )
+// extraPage = GES_ViewBib;
+
+ m_ptcw->m_leCommand->setText(m_map["command"]);
+ m_ptcw->m_leOptions->setText(m_map["options"]);
+
+ m_ltcw->m_leLibrary->setText(m_map["libName"]);
+ m_ltcw->m_leLibClass->setText(m_map["className"]);
+ m_ltcw->m_leOptions->setText(m_map["libOptions"]);
+
+ m_LaTeXtcw->m_ckRootDoc->setChecked(m_map["checkForRoot"] == "yes");
+ m_LaTeXtcw->m_ckJump->setChecked(m_map["jumpToFirstError"] == "yes");
+ m_LaTeXtcw->m_ckAutoRun->setChecked(m_map["autoRun"] == "yes");
+
+// m_config->setGroup("Tools");
+// m_ViewBibtcw->m_ckRunLyxServer->setChecked(m_config->readBoolEntry("RunLyxServer", true));
+
+ KILE_DEBUG() << "showing pages " << basicPage << " " << extraPage << endl;
+ m_configWidget->m_stackBasic->raiseWidget(basicPage);
+ m_configWidget->m_stackExtra->raiseWidget(extraPage);
+
+ if ( m_configWidget->m_stackBasic->widget(basicPage) )
+ {
+ QSize szHint = m_configWidget->m_stackBasic->widget(basicPage)->sizeHint();
+ if (szHint.height() > 0)
+ m_configWidget->m_stackBasic->setMaximumHeight(szHint.height());
+ }
+ if ( m_configWidget->m_stackExtra->widget(extraPage) )
+ {
+ QSize szHint = m_configWidget->m_stackExtra->widget(extraPage)->sizeHint();
+ if (szHint.height() > 0)
+ m_configWidget->m_stackExtra->setMaximumHeight(szHint.height());
+ }
+ m_configWidget->layout()->invalidate();
+ }
+
+ void ToolConfig::writeDefaults()
+ {
+ if ( KMessageBox::warningContinueCancel(this, i18n("All your tool settings will be overwritten with the default settings, are you sure you want to continue?")) == KMessageBox::Continue )
+ {
+ QStringList groups = m_config->groupList();
+ QRegExp re = QRegExp("Tool/(.+)/.+");
+ for ( uint i = 0; i < groups.count(); ++i )
+ if ( re.exactMatch(groups[i]) )
+ m_config->deleteGroup(groups[i],true);
+
+ m_manager->factory()->writeStdConfig();
+ m_config->sync();
+ updateToollist();
+ QStringList tools = KileTool::toolList(m_config, true);
+ for ( uint i = 0; i < tools.count(); ++i){
+ switchTo(tools[i], false);// needed to retrieve the new map
+ switchTo(tools[i],true); // this writes the newly retrieved entry map (and not an perhaps changed old one)
+ }
+ int index = indexQuickBuild();
+ switchTo(tools[index], false);
+ m_configWidget->m_lstbTools->setSelected(index, true);
+ }
+ }
+
+ void ToolConfig::updateToollist()
+ {
+ //KILE_DEBUG() << "==ToolConfig::updateToollist()====================" << endl;
+ m_configWidget->m_lstbTools->clear();
+ m_configWidget->m_lstbTools->insertStringList(KileTool::toolList(m_config, true));
+ m_configWidget->m_lstbTools->sort();
+ }
+
+ void ToolConfig::setMenu(const QString & menu)
+ {
+ //KILE_DEBUG() << "==ToolConfig::setMenu(const QString & menu)====================" << endl;
+ m_map["menu"] = menu;
+ }
+
+ void ToolConfig::writeConfig()
+ {
+ //KILE_DEBUG() << "==ToolConfig::writeConfig()====================" << endl;
+ //save config
+ m_manager->saveEntryMap(m_current, m_map, false, false);
+ KileTool::setGUIOptions(m_current, m_configWidget->m_cbMenu->currentText(), m_icon, m_config);
+ }
+
+ int ToolConfig::indexQuickBuild()
+ {
+ int index = m_configWidget->m_lstbTools->index( m_configWidget->m_lstbTools->findItem("QuickBuild",Qt::ExactMatch) );
+
+ return ( index >= 0 ) ? index : 0;
+ }
+
+ void ToolConfig::switchConfig(int /*index*/)
+ {
+ //KILE_DEBUG() << "==ToolConfig::switchConfig(int /*index*/)====================" << endl;
+ switchTo(m_current);
+ }
+
+ void ToolConfig::switchConfig(const QString & cfg)
+ {
+ //KILE_DEBUG() << "==ToolConfig::switchConfig(const QString & cfg)==========" << endl;
+ for ( int i = 0; i < m_configWidget->m_cbConfig->count(); ++i)
+ {
+ if ( m_configWidget->m_cbConfig->text(i) == cfg )
+ m_configWidget->m_cbConfig->setCurrentItem(i);
+ }
+ }
+
+ void ToolConfig::switchTo(const QString & tool, bool save /* = true */)
+ {
+ //KILE_DEBUG() << "==ToolConfig::switchTo(const QString & tool, bool save /* = true */)====================" << endl;
+ //save config
+ if (save)
+ {
+ writeConfig();
+
+ //update the config number
+ QString cf = m_configWidget->m_cbConfig->currentText();
+ KileTool::setConfigName(m_current, cf, m_config);
+ }
+
+ m_current = tool;
+
+ m_map.clear();
+ if (!m_manager->retrieveEntryMap(m_current, m_map, false, false))
+ kdWarning() << "no entrymap" << endl;
+
+ updateConfiglist();
+ updateGeneral();
+ updateAdvanced();
+
+ //show GUI info
+ m_configWidget->m_cbMenu->setCurrentText(KileTool::menuFor(m_current, m_config));
+ m_icon=KileTool::iconFor(m_current, m_config);
+ if ( m_icon.isEmpty() )
+ m_configWidget->m_pshbIcon->setPixmap(QString::null);
+ else
+ m_configWidget->m_pshbIcon->setPixmap(SmallIcon(m_icon));
+ }
+
+ void ToolConfig::updateConfiglist()
+ {
+ //KILE_DEBUG() << "==ToolConfig::updateConfiglist()=====================" << endl;
+ m_configWidget->m_cbConfig->clear();
+ m_configWidget->m_cbConfig->insertStringList(KileTool::configNames(m_current, m_config));
+ QString cfg = KileTool::configName(m_current, m_config);
+ switchConfig(cfg);
+ m_configWidget->m_cbConfig->setEnabled(m_configWidget->m_cbConfig->count() > 1);
+ }
+
+ void ToolConfig::selectIcon()
+ {
+ KILE_DEBUG() << "icon ---> " << m_icon << endl;
+ //KILE_DEBUG() << "==ToolConfig::selectIcon()=====================" << endl;
+ KIconDialog *dlg = new KIconDialog(this);
+ QString res = dlg->openDialog();
+ if ( m_icon != res ) {
+ if ( res.isEmpty() ) return;
+
+ m_icon = res;
+ writeConfig();
+ if ( m_icon.isEmpty() )
+ m_configWidget->m_pshbIcon->setPixmap(QString::null);
+ else
+ m_configWidget->m_pshbIcon->setPixmap(SmallIcon(m_icon));
+ }
+ }
+
+ void ToolConfig::newTool()
+ {
+ //KILE_DEBUG() << "==ToolConfig::newTool()=====================" << endl;
+ NewToolWizard *ntw = new NewToolWizard(this);
+ if (ntw->exec())
+ {
+ QString toolName = ntw->toolName();
+ QString parentTool = ntw->parentTool();
+
+ writeStdConfig(toolName, "Default");
+ if ( parentTool != ntw->customTool() )
+ {
+ //copy tool info
+ KileTool::Config tempMap;
+ m_manager->retrieveEntryMap(parentTool, tempMap, false, false);
+ m_config->setGroup(KileTool::groupFor(toolName, "Default"));
+ m_config->writeEntry("class", tempMap["class"]);
+ m_config->writeEntry("type", tempMap["type"]);
+ m_config->writeEntry("state", tempMap["state"]);
+ m_config->writeEntry("close", tempMap["close"]);
+ m_config->writeEntry("checkForRoot", tempMap["checkForRoot"]);
+ m_config->writeEntry("autoRun", tempMap["autoRun"]);
+ m_config->writeEntry("jumpToFirstError", tempMap["jumpToFirstError"]);
+ }
+
+ m_configWidget->m_lstbTools->blockSignals(true);
+ updateToollist();
+ switchTo(toolName);
+ for ( uint i = 0; i < m_configWidget->m_lstbTools->count(); ++i)
+ if ( m_configWidget->m_lstbTools->text(i) == toolName )
+ {
+ m_configWidget->m_lstbTools->setCurrentItem(i);
+ break;
+ }
+ m_configWidget->m_lstbTools->blockSignals(false);
+ }
+ }
+
+ void ToolConfig::newConfig()
+ {
+ //KILE_DEBUG() << "==ToolConfig::newConfig()=====================" << endl;
+ writeConfig();
+ bool ok;
+ QString cfg = KInputDialog::getText(i18n("New Configuration"), i18n("Enter new configuration name:"), "", &ok, this);
+ if (ok && (!cfg.isEmpty()))
+ {
+ //copy config
+ m_config->setGroup(KileTool::groupFor(m_current, cfg));
+ for (QMap<QString,QString>::Iterator it = m_map.begin(); it != m_map.end(); ++it)
+ {
+ m_config->writeEntry(it.key(), it.data());
+ }
+ KileTool::setConfigName(m_current, cfg, m_config);
+ switchTo(m_current, false);
+ switchConfig(cfg);
+ }
+ }
+
+ void ToolConfig::writeStdConfig(const QString & tool, const QString & cfg)
+ {
+ m_config->setGroup(KileTool::groupFor(tool, cfg));
+ m_config->writeEntry("class", "Compile");
+ m_config->writeEntry("type", "Process");
+ m_config->writeEntry("menu", "Compile");
+ m_config->writeEntry("state", "Editor");
+ m_config->writeEntry("close", "no");
+
+ m_config->setGroup("Tools");
+ m_config->writeEntry(tool, cfg);
+ }
+
+ void ToolConfig::removeTool()
+ {
+ //KILE_DEBUG() << "==ToolConfig::removeTool()=====================" << endl;
+ if ( KMessageBox::warningContinueCancel(this, i18n("Are you sure you want to remove the tool %1?").arg(m_current)) == KMessageBox::Continue )
+ {
+ KConfig *config = m_config;
+ QStringList cfgs = KileTool::configNames(m_current, config);
+ for ( uint i = 0; i < cfgs.count(); ++i)
+ {
+ config->deleteGroup(KileTool::groupFor(m_current, cfgs[i]));
+ }
+ config->setGroup("Tools");
+ config->deleteEntry(m_current);
+ int index = m_configWidget->m_lstbTools->currentItem()-1;
+ if ( index < 0 ) index=0;
+ QString tool = m_configWidget->m_lstbTools->text(index);
+ m_configWidget->m_lstbTools->blockSignals(true);
+ updateToollist();
+ m_configWidget->m_lstbTools->setCurrentItem(index);
+ switchTo(tool, false);
+ m_configWidget->m_lstbTools->blockSignals(false);
+ }
+ }
+
+ void ToolConfig::removeConfig()
+ {
+ //KILE_DEBUG() << "==ToolConfig::removeConfig()=====================" << endl;
+ writeConfig();
+ if ( m_configWidget->m_cbConfig->count() > 1)
+ {
+ if ( KMessageBox::warningContinueCancel(this, i18n("Are you sure you want to remove this configuration?") ) == KMessageBox::Continue )
+ {
+ m_config->deleteGroup(KileTool::groupFor(m_current, m_configWidget->m_cbConfig->currentText()));
+ updateConfiglist();
+ KileTool::setConfigName(m_current, m_configWidget->m_cbConfig->text(0), m_config);
+ switchTo(m_current, false);
+ }
+ }
+ else
+ KMessageBox::error(this, i18n("You need at least one configuration for each tool."), i18n("Cannot Remove Configuration"));
+ }
+
+ void ToolConfig::switchClass(const QString & cls)
+ {
+ if ( m_map["class"] != cls )
+ {
+ setClass(cls);
+ emit(changed());
+ }
+ }
+
+ void ToolConfig::switchType(int index)
+ {
+ switch (index)
+ {
+ case 0 : m_map["type"] = "Process"; break;
+ case 1 : m_map["type"] = "Konsole"; break;
+ case 2 : m_map["type"] = "Part"; break;
+ case 3 : m_map["type"] = "DocPart"; break;
+ case 4 : m_map["type"] = "Sequence"; break;
+ default : m_map["type"] = "Process"; break;
+ }
+ emit(changed());
+ }
+
+ void ToolConfig::setCommand(const QString & command) { m_map["command"] = command.stripWhiteSpace(); }
+ void ToolConfig::setOptions(const QString & options) { m_map["options"] = options.stripWhiteSpace(); }
+ void ToolConfig::setLibrary(const QString & lib) { m_map["libName"] = lib.stripWhiteSpace(); }
+ void ToolConfig::setLibOptions(const QString & options) { m_map["libOptions"] = options.stripWhiteSpace(); }
+ void ToolConfig::setClassName(const QString & name) { m_map["className"] = name.stripWhiteSpace(); }
+ void ToolConfig::setState(const QString & state)
+ {
+ QString str = state.stripWhiteSpace();
+ if ( str .isEmpty() ) str = "Editor";
+ m_map["state"] = str;
+ }
+ void ToolConfig::setSequence(const QString & sequence) { m_map["sequence"] = sequence.stripWhiteSpace(); }
+ void ToolConfig::setClose(bool on) { m_map["close"] = on ? "yes" : "no"; }
+ void ToolConfig::setTarget(const QString & trg) { m_map["target"] = trg.stripWhiteSpace(); }
+ void ToolConfig::setRelDir(const QString & rd) { m_map["relDir"] = rd.stripWhiteSpace(); }
+ void ToolConfig::setLaTeXCheckRoot(bool ck) { m_map["checkForRoot"] = ck ? "yes" : "no"; }
+ void ToolConfig::setLaTeXJump(bool ck) { m_map["jumpToFirstError"] = ck ? "yes" : "no"; }
+ void ToolConfig::setLaTeXAuto(bool ck) { m_map["autoRun"] = ck ? "yes" : "no"; }
+ void ToolConfig::setRunLyxServer(bool ck)
+ {
+ //KILE_DEBUG() << "setRunLyxServer" << endl;
+ m_config->setGroup("Tools");
+ m_config->writeEntry("RunLyxServer", ck);
+ }
+ void ToolConfig::setFrom(const QString & from) { m_map["from"] = from.stripWhiteSpace(); }
+ void ToolConfig::setTo(const QString & to) { m_map["to"] = to.stripWhiteSpace(); }
+ void ToolConfig::setClass(const QString & cls) { m_map["class"] = cls.stripWhiteSpace(); }
+}
+
+#include "kiletoolconfigwidget.moc"
diff --git a/src/kile/kiletoolconfigwidget.h b/src/kile/kiletoolconfigwidget.h
new file mode 100644
index 0000000..c4fb339
--- /dev/null
+++ b/src/kile/kiletoolconfigwidget.h
@@ -0,0 +1,112 @@
+/***************************************************************************
+ begin : Sat 3-1 20:40:00 CEST 2004
+ copyright : (C) 2004 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILETOOLCONFIGWIDGET_H
+#define KILETOOLCONFIGWIDGET_H
+
+#include <qstringlist.h>
+
+#include <keditlistbox.h>
+
+#include "kiletool.h"
+
+class QGridLayout;
+
+namespace KileTool { class Manager; }
+class ToolConfigWidget;
+class ProcessToolConfigWidget;
+class LibraryToolConfigWidget;
+class QuickToolConfigWidget;
+class LaTeXToolConfigWidget;
+class ViewBibToolConfigWidget;
+
+namespace KileWidget
+{
+ class ToolConfig : public QWidget
+ {
+ Q_OBJECT
+
+ enum GeneralBasicStack { GBS_None = 1, GBS_Process, GBS_Library, GBS_DocPart, GBS_Sequence, GBS_Error };
+ enum GeneralExtraStack { GES_None = 1, GES_LaTeX/*, GES_ViewBib*/ };
+
+ public:
+ ToolConfig(KileTool::Manager *mngr, QWidget *parent, const char * name = 0);
+
+ public slots:
+ void writeConfig();
+
+ private:
+ void setupAdvanced();
+ void setupGeneral();
+ int indexQuickBuild();
+
+ private slots:
+ void updateGeneral();
+ void updateAdvanced();
+ void switchTo(const QString & tool, bool save = true);
+ void updateToollist();
+ void updateConfiglist();
+ void selectIcon();
+ void setMenu(const QString &);
+ void switchConfig(int index = -1);
+ void switchConfig(const QString &);
+
+ void newTool();
+ void newConfig();
+ void removeTool();
+ void removeConfig();
+ void writeStdConfig(const QString &, const QString &);
+ void writeDefaults();
+
+ void setCommand(const QString &);
+ void setOptions(const QString &);
+ void setLibrary(const QString &);
+ void setLibOptions(const QString &);
+ void setClassName(const QString &);
+ void setState(const QString &);
+ void setSequence(const QString &);
+ void setClose(bool);
+ void setTarget(const QString &);
+ void setRelDir(const QString &);
+ void setLaTeXCheckRoot(bool);
+ void setLaTeXJump(bool);
+ void setLaTeXAuto(bool);
+ void setRunLyxServer(bool);
+ void setFrom(const QString &);
+ void setTo(const QString &);
+ void setClass(const QString &);
+ void switchClass(const QString &);
+ void switchType(int);
+
+ signals:
+ void changed();
+
+ private:
+ ToolConfigWidget *m_configWidget;
+ KileTool::Manager *m_manager;
+ KConfig *m_config;
+ KileTool::Config m_map;
+ QGridLayout *m_layout;
+ QString m_current, m_icon;
+ QStringList m_classes;
+ QWidget *m_tabGeneral, *m_tabAdvanced, *m_tabMenu;
+ ProcessToolConfigWidget *m_ptcw;
+ LibraryToolConfigWidget *m_ltcw;
+ QuickToolConfigWidget *m_qtcw;
+ LaTeXToolConfigWidget *m_LaTeXtcw;
+ };
+}
+
+#endif
diff --git a/src/kile/kiletoolmanager.cpp b/src/kile/kiletoolmanager.cpp
new file mode 100644
index 0000000..f7fe631
--- /dev/null
+++ b/src/kile/kiletoolmanager.cpp
@@ -0,0 +1,511 @@
+/***************************************************************************
+ begin : Tue Nov 25 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kiletoolmanager.h"
+
+#include <stdlib.h> //for getenv()
+
+#include <qstring.h>
+#include <qfileinfo.h>
+#include <qwidgetstack.h>
+#include <qtimer.h>
+#include <qregexp.h>
+#include <qthread.h>
+
+#include <kaction.h>
+#include <ktextedit.h>
+#include <kconfig.h>
+#include "kiledebug.h"
+#include <klocale.h>
+#include <kparts/partmanager.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+#include <ksimpleconfig.h>
+
+#include "kileinfo.h"
+#include "kileconfig.h"
+#include "kileproject.h"
+#include "kiletool_enums.h"
+#include "kilestdtools.h"
+#include "kilelogwidget.h"
+#include "kileoutputwidget.h"
+#include "kiledocmanager.h"
+#include "kilesidebar.h"
+
+namespace KileTool
+{
+ QueueItem::QueueItem(Base *tool, const QString & cfg, bool block) : m_tool(tool), m_cfg(cfg), m_bBlock(block)
+ {
+ }
+
+ QueueItem::~QueueItem()
+ {
+ delete m_tool;
+ }
+
+ Base* Queue::tool() const
+ {
+ if ( head() )
+ return head()->tool();
+ else
+ return 0;
+ }
+
+ const QString Queue::cfg() const
+ {
+ if ( head() )
+ return head()->cfg();
+ else
+ return QString::null;
+ }
+
+ bool Queue::shouldBlock() const
+ {
+ if ( head() )
+ return head()->shouldBlock();
+ else
+ return false;
+ }
+
+ void Queue::enqueueNext(QueueItem *item)
+ {
+ if ( count() < 2 )
+ enqueue(item);
+ else
+ {
+ QueueItem *headitem = dequeue();
+ Queue *oldqueue = new Queue(*this);
+
+ setAutoDelete(false); clear();
+ KILE_DEBUG() << "\tenqueueing: " << headitem->tool()->name() << endl;
+ enqueue(headitem);
+ KILE_DEBUG() << "\tenqueueing: " << item->tool()->name() << endl;
+ enqueue(item);
+ while ( oldqueue->head() )
+ {
+ KILE_DEBUG() << "\tenqueueing: " << oldqueue->head()->tool()->name() << endl;
+ enqueue(oldqueue->dequeue());
+ }
+ }
+ }
+
+ Manager::Manager(KileInfo *ki, KConfig *config, KileWidget::LogMsg *log, KileWidget::Output *output, KParts::PartManager *manager, QWidgetStack *stack, KAction *stop, uint to) :
+ m_ki(ki),
+ m_config(config),
+ m_log(log),
+ m_output(output),
+ m_pm(manager),
+ m_stack(stack),
+ m_stop(stop),
+ m_bClear(true),
+ m_nLastResult(Success),
+ m_nTimeout(to)
+ {
+ m_timer = new QTimer(this);
+ connect(m_timer, SIGNAL(timeout()), this, SLOT(enableClear()));
+ connect(stop, SIGNAL(activated()), this, SLOT(stop()));
+ }
+
+ Manager::~Manager() {}
+
+ bool Manager::shouldBlock()
+ {
+ return m_queue.shouldBlock();
+ }
+
+ void Manager::enableClear()
+ {
+ m_bClear = true;
+ }
+
+ bool Manager::queryContinue(const QString & question, const QString & caption /*= QString::null*/)
+ {
+ return (KMessageBox::warningContinueCancel(m_stack, question, caption, KStdGuiItem::cont(), "showNotALaTeXRootDocumentWarning") == KMessageBox::Continue);
+ }
+
+ int Manager::run(const QString &tool, const QString & cfg, bool insertNext /*= false*/, bool block /*= false*/)
+ {
+ if (!m_factory)
+ {
+ m_log->printMsg(Error, i18n("No factory installed, contact the author of Kile."));
+ return ConfigureFailed;
+ }
+
+ Base* pTool = m_factory->create(tool);
+ if (!pTool)
+ {
+ m_log->printMsg(Error, i18n("Unknown tool %1.").arg(tool));
+ return ConfigureFailed;
+ }
+
+ return run(pTool, cfg, insertNext, block);
+ }
+
+ int Manager::run(Base *tool, const QString & cfg, bool insertNext /*= false*/, bool block /*= false*/)
+ {
+ KILE_DEBUG() << "==KileTool::Manager::run(Base *)============" << endl;
+ if (m_bClear && (m_queue.count() == 0) )
+ {
+ m_log->clear();
+ m_ki->setLogPresent(false);
+ m_output->clear();
+ }
+
+ if ( tool->needsToBePrepared() )
+ tool->prepareToRun(cfg);
+ else
+ tool->configure(cfg);
+
+ //FIXME: shouldn't restart timer if a Sequence command takes longer than the 10 secs
+ //restart timer, so we only clear the logs if a tool is started after 10 sec.
+ m_bClear=false;
+ m_timer->start(m_nTimeout);
+
+ if ( insertNext )
+ m_queue.enqueueNext(new QueueItem(tool, cfg, block));
+ else
+ m_queue.enqueue(new QueueItem(tool, cfg, block));
+
+ KILE_DEBUG() << "\tin queue: " << m_queue.count() << endl;
+ if ( m_queue.count() == 1 )
+ return runNextInQueue();
+ else if ( m_queue.count() > 1 )
+ return Running;
+ else
+ return ConfigureFailed;
+ }
+
+ int Manager::runNext(const QString &tool , const QString &config, bool block /*= false*/)
+ {
+ return run(tool, config, true, block);
+ }
+
+ int Manager::runNext(Base *tool, const QString &config, bool block /*= false*/)
+ {
+ return run(tool, config, true, block);
+ }
+
+ int Manager::runBlocking(const QString &tool, const QString &config /*= QString::null*/, bool insertAtTop /*= false*/)
+ {
+ if ( run(tool, config, insertAtTop, true) == Running )
+ return lastResult();
+ else
+ return Failed;
+ }
+
+ int Manager::runNextBlocking(const QString &tool, const QString &config)
+ {
+ return runBlocking(tool, config, true);
+ }
+
+ int Manager::runNextInQueue()
+ {
+ Base *head = m_queue.tool();
+ if (head)
+ {
+ if (m_log->lines() > 1)
+ m_log->append("\n");
+
+ if ( ! head->isPrepared() )
+ head->prepareToRun();
+
+ int status;
+ if ( (status=head->run()) != Running ) //tool did not even start, clear queue
+ {
+ stop();
+ m_queue.setAutoDelete(true); m_queue.clear(); m_queue.setAutoDelete(false);
+ return status;
+ }
+
+ emit(toolStarted());
+
+ return Running;
+ }
+
+ return ConfigureFailed;
+ }
+
+ void Manager::initTool(Base *tool)
+ {
+ tool->setInfo(m_ki);
+ tool->setConfig(m_config);
+
+ connect(tool, SIGNAL(message(int, const QString &, const QString &)), m_log, SLOT(printMsg(int, const QString &, const QString &)));
+ connect(tool, SIGNAL(output(const QString &)), m_output, SLOT(receive(const QString &)));
+ connect(tool, SIGNAL(done(Base*,int)), this, SLOT(done(Base*, int)));
+ connect(tool, SIGNAL(start(Base* )), this, SLOT(started(Base*)));
+ connect(tool, SIGNAL(requestSaveAll(bool, bool)), this, SIGNAL(requestSaveAll(bool, bool)));
+ }
+
+ void Manager::started(Base *tool)
+ {
+ KILE_DEBUG() << "STARTING tool: " << tool->name() << endl;
+ m_stop->setEnabled(true);
+
+ if (tool->isViewer())
+ {
+ if ( tool == m_queue.tool() ) m_queue.dequeue();
+ m_stop->setEnabled(false);
+ QTimer::singleShot(100, this, SLOT(runNextInQueue()));
+ }
+ }
+
+ void Manager::stop()
+ {
+ m_stop->setEnabled(false);
+ if ( m_queue.tool() )
+ m_queue.tool()->stop();
+ }
+
+ void Manager::done(Base *tool, int result)
+ {
+ m_stop->setEnabled(false);
+ m_nLastResult = result;
+
+ if ( tool != m_queue.tool() ) //oops, tool finished async, could happen with view tools
+ {
+ delete tool;
+ return;
+ }
+
+ delete m_queue.dequeue();
+
+ if ( result == Aborted)
+ tool->sendMessage(Error, i18n("Aborted"));
+
+ if ( result != Success && result != Silent ) //abort execution, delete all remaining tools
+ {
+ m_queue.setAutoDelete(true); m_queue.clear(); m_queue.setAutoDelete(false);
+ m_ki->outputView()->showPage(m_log);
+ }
+ else //continue
+ runNextInQueue();
+ }
+
+ QString Manager::currentGroup(const QString &name, bool usequeue, bool useproject)
+ {
+ if (useproject)
+ {
+ KileProject *project = m_ki->docManager()->activeProject();
+ if (project)
+ {
+ QString cfg = configName(name, dynamic_cast<KConfig*>(project->config()));
+ if ( cfg.length() > 0 ) return groupFor(name, cfg);
+ }
+ }
+
+ if (usequeue && m_queue.tool() && (m_queue.tool()->name() == name) && (!m_queue.cfg().isNull()) )
+ return groupFor(name, m_queue.cfg());
+ else
+ return groupFor(name, m_config);
+ }
+
+ bool Manager::retrieveEntryMap(const QString & name, Config & map, bool usequeue, bool useproject, const QString & cfg /*= QString::null*/)
+ {
+ QString group = (cfg == QString::null )
+ ? currentGroup(name, usequeue, useproject) : groupFor(name, cfg);
+
+ KILE_DEBUG() << "==KileTool::Manager::retrieveEntryMap=============" << endl;
+ KILE_DEBUG() << "\t" << name << " => " << group << endl;
+ if ( m_config->hasGroup(group) )
+ {
+ map = m_config->entryMap(group);
+
+ //use project overrides
+ KileProject *project = m_ki->docManager()->activeProject();
+ if ( useproject && project)
+ {
+ KConfig *prjcfg = dynamic_cast<KConfig*>(project->config());
+ if ( prjcfg )
+ {
+ QString grp = groupFor(name, prjcfg);
+ Config prjmap = prjcfg->entryMap(grp);
+ for (Config::Iterator it = prjmap.begin(); it != prjmap.end(); ++it)
+ {
+ map[it.key()] = it.data();
+ }
+ }
+ }
+ }
+ else
+ return false;
+
+ return true;
+ }
+
+ void Manager::saveEntryMap(const QString & name, Config & map, bool usequeue, bool useproject)
+ {
+ KILE_DEBUG() << "==KileTool::Manager::saveEntryMap=============" << endl;
+ QString group = currentGroup(name, usequeue, useproject);
+ KILE_DEBUG() << "\t" << name << " => " << group << endl;
+ m_config->setGroup(group);
+
+ Config::Iterator it;
+ for ( it = map.begin() ; it != map.end(); ++it)
+ {
+ if ( ! it.data().isEmpty() )
+ m_config->writeEntry(it.key(), it.data());
+ }
+ }
+
+ bool Manager::configure(Base *tool, const QString & cfg /*=QString::null*/)
+ {
+ KILE_DEBUG() << "==KileTool::Manager::configure()===============" << endl;
+ //configure the tool
+
+ Config map;
+
+ if ( ! retrieveEntryMap(tool->name(), map, true, true, cfg) )
+ {
+ m_log->printMsg(Error, i18n("Cannot find the tool %1 in the configuration database.").arg(tool->name()));
+ return false;
+ }
+
+ tool->setEntryMap(map);
+
+ return true;
+ }
+
+ void Manager::wantGUIState(const QString & state)
+ {
+ KILE_DEBUG() << "REQUESTED state: " << state << endl;
+ emit(requestGUIState(state));
+ }
+
+ QStringList toolList(KConfig *config, bool menuOnly)
+ {
+ KILE_DEBUG() << "==KileTool::toolList()==================" << endl;
+
+ QStringList groups = config->groupList(), tools;
+ QRegExp re = QRegExp("Tool/(.+)/.+");
+
+ for ( uint i = 0; i < groups.count(); ++i )
+ {
+ if ( re.exactMatch(groups[i]) )
+ {
+ if ( ! groups[i].endsWith(configName(re.cap(1), config)) ) continue;
+
+ if ( (! menuOnly) || ( menuFor(re.cap(1),config) != "none" ) )
+ {
+ tools.append(re.cap(1));
+ }
+ }
+ }
+
+ tools.sort();
+
+ return tools;
+ }
+
+ QString configName(const QString & tool, KConfig *config)
+ {
+ config->setGroup("Tools");
+ return config->readEntry(tool, "");
+ }
+
+ void setConfigName(const QString & tool, const QString & name, KConfig *config)
+ {
+ KILE_DEBUG() << "==KileTool::Manager::setConfigName(" << tool << "," << name << ")===============" << endl;
+ config->setGroup("Tools");
+ config->writeEntry(tool, name);
+ }
+
+ QString groupFor(const QString &tool, KConfig *config)
+ {
+ return groupFor(tool, configName(tool, config));
+ }
+
+ QString groupFor(const QString & tool, const QString & cfg /* = Default */ )
+ {
+ return "Tool/" + tool + '/' + cfg;
+ }
+
+ void extract(const QString &str, QString &tool, QString &cfg)
+ {
+ static QRegExp re("([^\\(]*)\\((.*)\\)");
+ QString lcl = str;
+ lcl.stripWhiteSpace();
+ cfg = QString::null;
+ if ( re.exactMatch(lcl) )
+ {
+ tool = re.cap(1).stripWhiteSpace();
+ cfg = re.cap(2).stripWhiteSpace();
+ }
+ else
+ tool = lcl;
+ KILE_DEBUG() << "===void extract(const QString &str = " << str << " , QString &tool = " << tool << ", QString &cfg = " << cfg << " )===" << endl;
+ }
+
+ QString format(const QString & tool, const QString &cfg)
+ {
+ if (!cfg.isNull())
+ return tool + '(' + cfg + ')';
+ else
+ return tool;
+ }
+
+ QStringList configNames(const QString &tool, KConfig *config)
+ {
+ QStringList groups = config->groupList(), configs;
+ QRegExp re = QRegExp("Tool/"+ tool +"/(.+)");
+
+ for ( uint i = 0; i < groups.count(); ++i )
+ {
+ if ( re.exactMatch(groups[i]) )
+ {
+ configs.append(re.cap(1));
+ }
+ }
+
+ return configs;
+ }
+
+ QString menuFor(const QString &tool, KConfig *config)
+ {
+ config->setGroup("ToolsGUI");
+ return config->readEntry(tool, "Other,gear").section(',',0,0);
+ }
+
+ QString iconFor(const QString &tool, KConfig *config)
+ {
+ config->setGroup("ToolsGUI");
+ return config->readEntry(tool, "Other,gear").section(',',1,1);
+ }
+
+ void setGUIOptions(const QString &tool, const QString &menu, const QString &icon, KConfig *config)
+ {
+ QString entry = menu + ',' + icon;
+
+ config->setGroup("ToolsGUI");
+ config->writeEntry(tool, entry);
+ }
+
+ QString categoryFor(const QString &clss)
+ {
+ if ( clss == "Compile" || clss == "LaTeX" )
+ return "Compile";
+ if ( clss == "Convert" )
+ return "Convert";
+ if ( clss == "View" || clss == "ViewBib" || clss == "ViewHTML" || clss == "ForwardDVI" )
+ return "View";
+ if ( clss == "Sequence" )
+ return "Sequence";
+ if ( clss == "Archive")
+ return "Archive";
+ return "Base";
+ }
+}
+
+#include "kiletoolmanager.moc"
diff --git a/src/kile/kiletoolmanager.h b/src/kile/kiletoolmanager.h
new file mode 100644
index 0000000..095342a
--- /dev/null
+++ b/src/kile/kiletoolmanager.h
@@ -0,0 +1,159 @@
+/***************************************************************************
+ begin : Tue Nov 25 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ****************************************************************************/
+
+#ifndef KILETOOLMANAGER_H
+#define KILETOOLMANAGER_H
+
+#include <qobject.h>
+#include <qstringlist.h>
+#include <qptrqueue.h>
+
+#include "kiletool.h"
+
+class QTimer;
+class QWidgetStack;
+
+class KConfig;
+class KTextEdit;
+class KAction;
+namespace KParts { class PartManager; }
+
+class KileInfo;
+namespace KileWidget { class LogMsg; class Output; }
+
+namespace KileTool
+{
+ class Factory;
+
+ class QueueItem
+ {
+ public:
+ QueueItem(Base *tool, const QString & cfg = QString::null, bool block = false);
+ ~QueueItem();
+
+ Base* tool() const { return m_tool; }
+ const QString cfg() const { return m_cfg; }
+ bool shouldBlock() { return m_bBlock; }
+
+ private:
+ Base *m_tool;
+ QString m_cfg;
+ bool m_bBlock;
+ };
+
+ class Queue : public QPtrQueue<QueueItem>
+ {
+ public:
+ Base* tool() const;
+ const QString cfg() const;
+ bool shouldBlock() const;
+
+ void enqueueNext(QueueItem *);
+ };
+
+ class Manager : public QObject
+ {
+ Q_OBJECT
+
+ public:
+ Manager(KileInfo *ki, KConfig *config, KileWidget::LogMsg *log, KileWidget::Output *output, KParts::PartManager *, QWidgetStack *, KAction *, uint to);
+ ~Manager();
+
+ public:
+ void initTool(Base*);
+ bool configure(Base*, const QString & cfg = QString::null);
+ bool retrieveEntryMap(const QString & name, Config & map, bool usequeue = true, bool useproject = true, const QString & cfg = QString::null);
+ void saveEntryMap(const QString & name, Config & map, bool usequeue = true, bool useproject = true);
+ QString currentGroup(const QString &name, bool usequeue = true, bool useproject = true);
+
+ void wantGUIState(const QString &);
+
+ KParts::PartManager * partManager() { return m_pm; }
+ QWidgetStack * widgetStack() { return m_stack; }
+
+ KileInfo * info() { return m_ki; }
+ KConfig * config() { return m_config; }
+
+ void setFactory(Factory* fac) { m_factory = fac; }
+ Factory* factory() { return m_factory; }
+
+ bool queryContinue(const QString & question, const QString & caption = QString::null);
+
+ bool shouldBlock();
+ int lastResult() { return m_nLastResult; }
+
+ public slots:
+ void started(Base*);
+ void done(Base *, int);
+
+ int run(const QString &, const QString & = QString::null, bool insertAtTop = false, bool block = false);
+ int run(Base *, const QString & = QString::null, bool insertAtTop = false, bool block = false);
+
+ int runNext(const QString &, const QString & = QString::null, bool block = false);
+ int runNext(Base *, const QString & = QString::null, bool block = false);
+
+ int runBlocking(const QString &, const QString & = QString::null, bool = false);
+ int runNextBlocking(const QString &, const QString & = QString::null);
+
+ void stop(); //should be a slot that stops the active tool and clears the queue
+
+ private slots:
+ int runNextInQueue();
+ void enableClear();
+
+ signals:
+ void requestGUIState(const QString &);
+ void requestSaveAll(bool, bool);
+ void jumpToFirstError();
+ void toolStarted();
+ void previewDone();
+
+ private:
+ KileInfo *m_ki;
+ KConfig *m_config;
+ KileWidget::LogMsg *m_log;
+ KileWidget::Output *m_output;
+ KParts::PartManager *m_pm;
+ QWidgetStack *m_stack;
+ KAction *m_stop;
+ Factory *m_factory;
+ Queue m_queue;
+ QTimer *m_timer;
+ bool m_bClear;
+ int m_nLastResult;
+ uint m_nTimeout;
+ };
+
+ QStringList toolList(KConfig *config, bool menuOnly = false);
+ QStringList configNames(const QString &tool, KConfig *config);
+
+ QString configName(const QString & tool, KConfig *);
+ void setConfigName(const QString & tool, const QString & name, KConfig *);
+
+ QString groupFor(const QString & tool, KConfig *);
+ QString groupFor(const QString & tool, const QString & cfg = "Default" );
+
+ void extract(const QString &str, QString &tool, QString &cfg);
+ QString format(const QString & tool, const QString &cfg);
+
+ QString menuFor(const QString &tool, KConfig *config);
+ QString iconFor(const QString &tool, KConfig *config);
+
+ QString categoryFor(const QString &clss);
+
+ void setGUIOptions(const QString &tool, const QString &menu, const QString &icon, KConfig *config);
+}
+
+#endif
diff --git a/src/kile/kileui.rc b/src/kile/kileui.rc
new file mode 100644
index 0000000..bff45cf
--- /dev/null
+++ b/src/kile/kileui.rc
@@ -0,0 +1,854 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kile" version="30">
+<Menu name="ktexteditor_popup" noMerge="1">
+ <DefineGroup name="popup_operations" />
+ <Action name="popup_pasteaslatex"/>
+ <Action name="popup_converttolatex"/>
+ <Separator/>
+ <Action name="popup_quickpreview"/>
+</Menu>
+<MenuBar noMerge="1">
+<Menu name="file"><text>&amp;File</text>
+ <Action name="file_new"/>
+ <Separator/>
+ <Action name="file_open"/>
+ <Action name="file_open_recent"/>
+ <DefineGroup name="revert_merge" append="revert_merge"/>
+ <Separator/>
+ <DefineGroup name="save_merge" append="save_merge" />
+ <Action name="file_save_copy_as"/>
+ <Action name="file_save_all"/>
+ <Separator/>
+ <Action name="template_create"/>
+ <Action name="template_remove"/>
+ <Separator/>
+ <DefineGroup name="file_print" append="print_merge" />
+ <Merge/>
+ <Menu name="convert"><text>Con&amp;vert To</text>
+ <Action name="file_export_ascii"/>
+ <Separator/>
+ <Action name="file_export_latin1"/>
+ <Action name="file_export_latin2"/>
+ <Action name="file_export_latin3"/>
+ <Action name="file_export_latin4"/>
+ <Action name="file_export_latin5"/>
+ <Action name="file_export_latin9"/>
+ <Action name="file_export_cp1250"/>
+ <Action name="file_export_cp1252"/>
+ </Menu>
+ <Action name="Statistics"/>
+ <Separator/>
+ <Action name="file_close"/>
+ <Action name="file_close_all"/>
+ <Action name="file_close_all_others"/>
+ <Separator/>
+ <Action name="file_quit"/>
+</Menu>
+
+<Menu name="edit"><text>&amp;Edit</text>
+ <DefineGroup name="edit_undo_merge" append="edit_undo_merge"/>
+ <Separator/>
+ <DefineGroup name="edit_paste_merge" append="edit_paste_merge"/>
+ <Separator/>
+ <DefineGroup name="edit_select_merge" append="edit_select_merge"/>
+ <Separator/>
+ <DefineGroup name="edit_find_merge" append="edit_find_merge"/>
+ <Menu name="goto" >
+ <text>&amp;Goto</text>
+ <Action name="edit_goto_line" />
+ <Separator/>
+ <Action name="edit_next_section" />
+ <Action name="edit_prev_section" />
+ <Separator/>
+ <Action name="edit_next_paragraph" />
+ <Action name="edit_prev_paragraph" />
+ </Menu>
+ <Action name="FindInFiles"/>
+ <Separator/>
+ <Menu name="complete"><text>Co&amp;mplete</text>
+ <Action name="edit_complete_word"/>
+ <Action name="edit_complete_env"/>
+ <Action name="edit_complete_abbrev"/>
+ </Menu>
+ <Menu name="bullet"><text>&amp;Bullets</text>
+ <Action name="edit_next_bullet"/>
+ <Action name="edit_prev_bullet"/>
+ </Menu>
+ <Menu name="select"><text>&amp;Select</text>
+ <Action name="edit_select_inside_env"/>
+ <Action name="edit_select_outside_env"/>
+ <Separator/>
+ <Action name="edit_select_inside_group"/>
+ <Action name="edit_select_outside_group"/>
+ <Separator/>
+ <Action name="edit_select_mathgroup"/>
+ <Separator/>
+ <Action name="edit_select_paragraph"/>
+ <Action name="edit_select_line"/>
+ <Action name="edit_select_word"/>
+ </Menu>
+ <Menu name="delete"><text>D&amp;elete</text>
+ <Action name="edit_delete_inside_env"/>
+ <Action name="edit_delete_outside_env"/>
+ <Separator/>
+ <Action name="edit_delete_inside_group"/>
+ <Action name="edit_delete_outside_group"/>
+ <Separator/>
+ <Action name="edit_delete_mathgroup"/>
+ <Separator/>
+ <Action name="edit_delete_paragraph"/>
+ <Action name="edit_delete_eol"/>
+ <Action name="edit_delete_word"/>
+ </Menu>
+ <Menu name="environment"><text>Environmen&amp;t</text>
+ <Action name="edit_begin_env"/>
+ <Action name="edit_end_env"/>
+ <Action name="edit_match_env"/>
+ <Separator/>
+ <Action name="edit_close_env"/>
+ <Action name="edit_closeall_env"/>
+ </Menu>
+ <Menu name="texgroup"><text>Te&amp;X Group</text>
+ <Action name="edit_begin_group"/>
+ <Action name="edit_end_group"/>
+ <Action name="edit_match_group"/>
+ <Separator/>
+ <Action name="edit_close_group"/>
+ </Menu>
+ <Separator/>
+ <Action name="RefreshStructure"/>
+</Menu>
+
+<Menu name="view"><text>&amp;View</text>
+<Action name="EditorView"/>
+<Action name="fullscreen"/>
+<Merge/>
+<Separator/>
+<Action name="gotoPrevDocument"/>
+<Action name="gotoNextDocument"/>
+</Menu>
+<Menu name="menu_build"><text>B&amp;uild</text>
+ <ActionList name="list_quickies"/>
+ <Menu name="quickpreview"><text>QuickPreview</text>
+ <Action name="quickpreview_selection"/>
+ <Action name="quickpreview_environment"/>
+ <Action name="quickpreview_subdocument"/>
+ <Separator/>
+ <Action name="quickpreview_math" />
+ </Menu>
+ <Separator/>
+ <Menu name="menu_compile"><text>&amp;Compile</text>
+ <ActionList name="list_compilers"/>
+ </Menu>
+ <Menu name="menu_convert"><text>C&amp;onvert</text>
+ <ActionList name="list_converters"/>
+ </Menu>
+ <Menu name="menu_viewers"><text>&amp;View</text>
+ <ActionList name="list_viewers"/>
+ </Menu>
+ <Menu name="menu_other"><text>O&amp;ther</text>
+ <ActionList name="list_other"/>
+ </Menu>
+ <Action name="WatchFile"/>
+ <Separator/>
+ <Action name="ViewLog"/>
+ <Action name="PreviousError"/>
+ <Action name="NextError"/>
+ <Action name="PreviousWarning"/>
+ <Action name="NextWarning"/>
+ <Action name="PreviousBadBox"/>
+ <Action name="NextBadBox"/>
+ <Action name="Stop"/>
+ <Separator/>
+ <Action name="CleanAll"/>
+</Menu>
+<Menu name="menu_project"><text>&amp;Project</text>
+ <Action name="project_new"/>
+ <Action name="project_open"/>
+ <Action name="project_openrecent"/>
+ <Separator/>
+ <Action name="project_show" />
+ <Separator/>
+ <Action name="project_add"/>
+ <Action name="project_remove" />
+ <Action name="project_openallfiles" />
+ <Action name="project_showfiles" />
+ <Separator/>
+ <Action name="project_findfiles"/>
+ <Separator/>
+ <Action name="project_buildtree"/>
+ <Action name="project_options"/>
+ <Action name="project_archive"/>
+ <Separator/>
+ <Action name="project_close"/>
+</Menu>
+
+<Menu name="menu_latex"><text>&amp;LaTeX</text>
+ <Menu name="menu_preamble"><text>&amp;Preamble</text>
+ <Action name="tag_documentclass"/>
+ <Action name="tag_usepackage"/>
+ <Action name="tag_amspackages"/>
+ <Action name="tag_env_document"/>
+ <Separator/>
+ <Action name="tag_author"/>
+ <Action name="tag_title"/>
+ <Action name="tag_maketitle"/>
+ <Separator/>
+ <Action name="tag_titlepage"/>
+ <Action name="tag_env_abstract"/>
+ </Menu>
+ <Separator/>
+ <Menu name="menu_lists"><text>Tables and Lists</text>
+ <Action name="tag_tableofcontents"/>
+ <Action name="tag_listoffigures"/>
+ <Action name="tag_listoftables"/>
+ <Separator/>
+ <Action name="tag_makeindex"/>
+ <Action name="tag_printindex"/>
+ <Separator/>
+ <Action name="tag_makeglossary"/>
+ <Action name="tag_env_thebibliography"/>
+ </Menu>
+ <Menu name="menu_sectioning"><text>&amp;Sectioning</text>
+ <Action name="tag_part"/>
+ <Separator/>
+ <Action name="tag_chapter"/>
+ <Action name="tag_section"/>
+ <Action name="tag_subsection"/>
+ <Action name="tag_subsubsection"/>
+ <Separator/>
+ <Action name="tag_paragraph"/>
+ <Action name="tag_subparagraph"/>
+ </Menu>
+ <Menu name="references"><text>&amp;References</text>
+ <Action name="tag_label"/>
+ <Action name="tag_ref"/>
+ <Action name="tag_pageref"/>
+ <Separator/>
+ <Action name="tag_index"/>
+ <Action name="tag_footnote"/>
+ <Separator/>
+ <Action name="tag_cite"/>
+ <Action name="citeViewBib"/>
+ </Menu>
+ <Separator/>
+ <Menu name="menu_environment"><text>&amp;Environment</text>
+ <Action name="tag_center"/>
+ <Action name="tag_flushleft"/>
+ <Action name="tag_flushright"/>
+ <Separator/>
+ <Action name="tag_env_minipage"/>
+ <Separator/>
+ <Action name="tag_quote"/>
+ <Action name="tag_quotation"/>
+ <Action name="tag_verse"/>
+ </Menu>
+ <Menu name="menu_listenv"><text>&amp;List Environment</text>
+ <Action name="tag_env_itemize"/>
+ <Action name="tag_env_enumerate"/>
+ <Action name="tag_env_description"/>
+ <Separator/>
+ <Action name="tag_item"/>
+ </Menu>
+ <Menu name="menu_tabularenv"><text>&amp;Tabular Environment</text>
+ <Action name="tag_env_tabular"/>
+ <Action name="tag_env_tabular*"/>
+ <Separator/>
+ <Action name="tag_env_tabbing"/>
+ <Separator/>
+ <Action name="tag_multicolumn"/>
+ <Action name="tag_hline"/>
+ <Action name="tag_vline"/>
+ <Action name="tag_cline"/>
+ </Menu>
+ <Menu name="menu_floatenv"><text>&amp;Floating Environment</text>
+ <Action name="tag_figure"/>
+ <Action name="tag_table"/>
+ </Menu>
+ <Menu name="menu_code"><text>&amp;Code Environment</text>
+ <Action name="tag_verbatim"/>
+ <Action name="tag_env_verbatim*"/>
+ <Separator/>
+ <Action name="tag_verb"/>
+ <Action name="tag_verb*"/>
+ </Menu>
+ <Separator/>
+ <Menu name="menu_math"><text>&amp;Math Commands</text>
+ <Action name="tag_mathmode"/>
+ <Action name="tag_equation"/>
+ <Separator/>
+ <Action name="tag_subscript"/>
+ <Action name="tag_superscript"/>
+ <Separator/>
+ <Action name="tag_sqrt"/>
+ <Action name="tag_nroot"/>
+ <Separator/>
+ <Menu name="menu_mathbraces"><text>Braces</text>
+ <Action name="tag_left"/>
+ <Action name="tag_right"/>
+ <Action name="tag_leftright"/>
+ <Separator/>
+ <Action name="tag_bigl"/>
+ <Action name="tag_bigr"/>
+ <Separator/>
+ <Action name="tag_Bigl"/>
+ <Action name="tag_Bigr"/>
+ <Separator/>
+ <Action name="tag_biggl"/>
+ <Action name="tag_biggr"/>
+ <Separator/>
+ <Action name="tag_Biggl"/>
+ <Action name="tag_Biggr"/>
+ </Menu>
+ <Separator/>
+ <Menu name="menu_mathtext"><text>AMS Text and Boxes</text>
+ <Action name="tag_text"/>
+ <Action name="tag_intertext"/>
+ <Separator/>
+ <Action name="tag_boxed"/>
+ </Menu>
+ <Menu name="menu_mathfrac"><text>AMS Fraction</text>
+ <Action name="tag_frac"/>
+ <Action name="tag_dfrac"/>
+ <Action name="tag_tfrac"/>
+ </Menu>
+ <Menu name="menu_mathbinom"><text>AMS Binomial Expression</text>
+ <Action name="tag_binom"/>
+ <Action name="tag_dbinom"/>
+ <Action name="tag_tbinom"/>
+ </Menu>
+ <Menu name="menu_mathcommands"><text>AMS Arrows</text>
+ <Action name="tag_xleftarrow"/>
+ <Action name="tag_xrightarrow"/>
+ </Menu>
+ <Separator/>
+ <Menu name="menu_mathfontstyles"><text>Math &amp;Font Styles</text>
+ <Action name="tag_mathrm"/>
+ <Action name="tag_mathit"/>
+ <Action name="tag_mathbf"/>
+ <Action name="tag_mathsf"/>
+ <Action name="tag_mathtt"/>
+ <Action name="tag_mathcal"/>
+ <Action name="tag_mathbb"/>
+ <Action name="tag_mathfrak"/>
+ </Menu>
+ <Menu name="menu_mathaccents"><text>Math &amp;Accents</text>
+ <Action name="tag_acute"/>
+ <Action name="tag_grave"/>
+ <Action name="tag_tilde"/>
+ <Action name="tag_bar"/>
+ <Action name="tag_vec"/>
+ <Action name="tag_hat"/>
+ <Action name="tag_check"/>
+ <Action name="tag_breve"/>
+ <Action name="tag_dot"/>
+ <Action name="tag_ddot"/>
+ </Menu>
+ <Menu name="menu_mathspaces"><text>Math &amp;Spaces</text>
+ <Action name="tag_space_small"/>
+ <Action name="tag_space_medium"/>
+ <Action name="tag_space_large"/>
+ <Separator/>
+ <Action name="tag_quad"/>
+ <Action name="tag_qquad"/>
+ <Separator/>
+ <Action name="tag_enskip"/>
+ </Menu>
+ </Menu>
+ <Menu name="menu_mathenv"><text>Standard Math &amp;Environments</text>
+ <Action name="tag_env_displaymath"/>
+ <Separator/>
+ <Action name="tag_env_equation"/>
+ <Action name="tag_env_equation*"/>
+ <Separator/>
+ <Action name="tag_env_array"/>
+ </Menu>
+ <Menu name="menu_mathamsenv"><text>&amp;AMS Math Environments</text>
+ <Action name="tag_env_multline"/>
+ <Action name="tag_env_multline*"/>
+ <Separator/>
+ <Action name="tag_env_split"/>
+ <Separator/>
+ <Action name="tag_env_gather"/>
+ <Action name="tag_env_gather*"/>
+ <Separator/>
+ <Action name="tag_env_align"/>
+ <Action name="tag_env_align*"/>
+ <Action name="tag_env_flalign"/>
+ <Action name="tag_env_flalign*"/>
+ <Separator/>
+ <Action name="tag_env_alignat"/>
+ <Action name="tag_env_alignat*"/>
+ <Separator/>
+ <Action name="tag_env_aligned"/>
+ <Action name="tag_env_gathered"/>
+ <Action name="tag_env_alignedat"/>
+ <Separator/>
+ <Action name="tag_env_cases"/>
+ </Menu>
+ <Separator/>
+ <Menu name="menu_bibliography"><text>&amp;Bibliography</text>
+ <Action name="tag_bibliographystyle"/>
+ <Action name="tag_bibliography"/>
+ <Separator/>
+ <Action name="tag_bib_article"/>
+ <Action name="tag_bib_inproc"/>
+ <Action name="tag_bib_incol"/>
+ <Action name="tag_bib_inbook"/>
+ <Action name="tag_bib_proceedings"/>
+ <Action name="tag_bib_book"/>
+ <Action name="tag_bib_booklet"/>
+ <Action name="tag_bib_phdthesis"/>
+ <Action name="tag_bib_masterthesis"/>
+ <Action name="tag_bib_techreport"/>
+ <Action name="tag_bib_manual"/>
+ <Action name="tag_bib_unpublished"/>
+ <Action name="tag_bib_misc"/>
+ <Separator/>
+ <Action name="CleanBib"/>
+ </Menu>
+ <Separator/>
+ <Menu name="menu_fontstyles"><text>&amp;Font Styles</text>
+ <Action name="tag_textit"/>
+ <Action name="tag_textsl"/>
+ <Action name="tag_textbf"/>
+ <Action name="tag_texttt"/>
+ <Action name="tag_textsc"/>
+ <Separator/>
+ <Action name="tag_emph"/>
+ <Action name="tag_strong"/>
+ <Separator/>
+ <Menu name="menu_fontfamily"><text>Font Family</text>
+ <Action name="tag_rmfamily"/>
+ <Action name="tag_sffamily"/>
+ <Action name="tag_ttfamily"/>
+ </Menu>
+ <Menu name="menu_fontseries"><text>Font Series</text>
+ <Action name="tag_mdseries"/>
+ <Action name="tag_bfseries"/>
+ </Menu>
+ <Menu name="menu_fontshape"><text>Font Shape</text>
+ <Action name="tag_upshape"/>
+ <Action name="tag_itshape"/>
+ <Action name="tag_slshape"/>
+ <Action name="tag_scshape"/>
+ </Menu>
+ </Menu>
+ <Menu name="menu_spacing"><text>Spa&amp;cing</text>
+ <Menu name="menu_breaks"><text>Page- and Linebreaks</text>
+ <Action name="tag_newline"/>
+ <Action name="tag_newpage"/>
+ <Separator/>
+ <Action name="tag_linebreak"/>
+ <Action name="tag_pagebreak"/>
+ </Menu>
+ <Menu name="menu_skips"><text>Space</text>
+ <Action name="tag_bigskip"/>
+ <Action name="tag_medskip"/>
+ <Action name="tag_smallskip"/>
+ <Separator/>
+ <Action name="tag_hspace"/>
+ <Action name="tag_hspace*"/>
+ <Separator/>
+ <Action name="tag_vspace"/>
+ <Action name="tag_vspace*"/>
+ </Menu>
+ <Menu name="menu_rubberlength"><text>Rubber Lenghts</text>
+ <Action name="tag_hfill"/>
+ <Action name="tag_hrulefill"/>
+ <Action name="tag_dotfill"/>
+ <Separator/>
+ <Action name="tag_vfill"/>
+ </Menu>
+ </Menu>
+ <Separator/>
+ <Action name="tag_includegraphics"/>
+ <Action name="tag_include"/>
+ <Action name="tag_input"/>
+ <Separator/>
+ <Action name="menuUserTags"/>
+</Menu>
+
+<Menu name="wizard"><text>&amp;Wizard</text>
+ <Action name="wizard_document"/>
+ <Separator/>
+ <Action name="wizard_tabular"/>
+ <Action name="wizard_array"/>
+ <Action name="wizard_tabbing"/>
+ <Separator/>
+ <Action name="wizard_float"/>
+ <Action name="wizard_mathenv"/>
+ <Separator/>
+ <Action name="wizard_postscript"/>
+</Menu>
+
+<Merge/>
+
+<Menu name="settings" noMerge="1"><text>&amp;Settings</text>
+ <Action name="Mode"/>
+ <Separator/>
+ <Action name="StructureView"/>
+ <Action name="MessageView"/>
+ <Merge name="StandardToolBarMenuHandler" />
+ <Separator/>
+ <Action name="settings_keys"/>
+ <Action name="settings_toolbars"/>
+ <Action name="settings_configure" />
+ <DefineGroup name="configure_merge" append="configure_merge" />
+ <Separator/>
+ <Action name="settings_perform_check" />
+</Menu>
+<Menu name="help"><text>&amp;Help</text>
+ <Action name="help_latex_reference"/>
+ <Action name="help_handbook"/>
+ <Action name="help_tipofday"/>
+ <Merge/>
+ <Separator/>
+ <Action name="help_context" />
+ <Menu name="help_tex" ><text>TeX Documentation</text>
+ <Action name="help_docbrowser" />
+ <Action name="help_tex_guide" />
+ <Separator/>
+ <Action name="help_latex_index" />
+ <Separator/>
+ <Action name="help_latex_command" />
+ <Action name="help_latex_subject" />
+ <Action name="help_latex_env" />
+ </Menu>
+ <Separator/>
+ <Action name="report_bug"/>
+ <Separator/>
+ <Action name="help_aboutKile"/>
+ <Action name="help_aboutKDE"/>
+</Menu>
+</MenuBar>
+<ToolBar name="mainToolBar" fullWidth="false" index="1" noMerge="1"><text>Main</text>
+ <Action name="file_new"/>
+ <Action name="file_open"/>
+ <Action name="file_close"/>
+ <Merge/>
+ <Action name="Mode"/>
+ <Action name="settings_configure" />
+</ToolBar>
+<ToolBar name="buildToolBar" fullWidth="false" index="2"><text>Build</text>
+ <Action name="WatchFile"/>
+ <Action name="Stop"/>
+</ToolBar>
+<ToolBar name="errorToolBar" fullWidth="false" index="3"><text>Error</text>
+ <Action name="ViewLog"/>
+ <Action name="PreviousError"/>
+ <Action name="NextError"/>
+ <Action name="PreviousWarning"/>
+ <Action name="NextWarning"/>
+ <Action name="PreviousBadBox"/>
+ <Action name="NextBadBox"/>
+</ToolBar>
+<ToolBar name="toolsToolBar" fullWidth="false" index="4"><text>Tools</text>
+ <Action name="tool_QuickBuild"/>
+ <Action name="quickpreview_selection"/>
+ <Separator lineSeparator="true"/>
+ <Action name="tool_LaTeX"/>
+ <Action name="tool_ViewDVI"/>
+ <Action name="tool_DVItoPS"/>
+ <Action name="tool_ViewPS"/>
+ <Separator lineSeparator="true"/>
+ <Action name="tool_PDFLaTeX"/>
+ <Action name="tool_ViewPDF"/>
+ <Separator lineSeparator="true"/>
+ <Action name="tool_DVItoPDF"/>
+ <Action name="tool_PStoPDF"/>
+ <Separator lineSeparator="true"/>
+ <Action name="tool_LaTeXtoHTML"/>
+ <Action name="tool_ViewHTML"/>
+ <Separator lineSeparator="true"/>
+ <Action name="tool_ForwardDVI"/>
+</ToolBar>
+<ToolBar name="editToolBar" fullWidth="false" index="5"><text>Edit</text>
+ <Action name="structure_list"/>
+ <Separator lineSeparator="true"/>
+ <Action name="other_list"/>
+ <Separator lineSeparator="true"/>
+ <Action name="size_list"/>
+ <Separator lineSeparator="true"/>
+ <Action name="tag_textbf"/>
+ <Action name="tag_textit"/>
+ <Action name="tag_texttt"/>
+ <Action name="tag_underline"/>
+ <Separator/>
+ <Action name="tag_center"/>
+ <Separator/>
+ <Action name="tag_env_itemize"/>
+ <Action name="tag_env_enumerate"/>
+ <Action name="tag_env_description"/>
+ <Action name="tag_item"/>
+</ToolBar>
+<ToolBar name="mathToolBar" fullWidth="false" index="6"><text>Math</text>
+ <Action name="tag_mathmode"/>
+ <Action name="tag_subscript"/>
+ <Action name="tag_superscript"/>
+ <Action name="tag_frac"/>
+ <Action name="tag_dfrac"/>
+ <Action name="tag_sqrt"/>
+ <Separator lineSeparator="true"/>
+ <Action name="left_list"/>
+ <Separator lineSeparator="true"/>
+ <Action name="right_list"/>
+ <Separator lineSeparator="true"/>
+ <Action name="tag_newline"/>
+</ToolBar>
+<ToolBar name="extraToolBar" index="7" noMerge="1"><text>Extra</text>
+ <Merge/>
+ <Separator lineSeparator="true"/>
+ <Action name="EditorView"/>
+</ToolBar>
+<State name="HTMLpreview">
+<Disable>
+ <Action name="file_new"/>
+ <Action name="file_open"/>
+ <Action name="file_open_recent"/>
+ <Action name="file_save"/>
+ <Action name="file_save_as"/>
+ <Action name="file_save_all"/>
+ <Action name="file_close"/>
+ <Action name="file_close_all"/>
+ <Action name="file_close_all_others"/>
+ <Action name="file_export_ascii"/>
+ <Action name="file_export_latin1"/>
+ <Action name="file_export_latin2"/>
+ <Action name="file_export_latin3"/>
+ <Action name="file_export_latin4"/>
+ <Action name="file_export_latin5"/>
+ <Action name="file_export_latin9"/>
+ <Action name="file_export_cp1250"/>
+ <Action name="file_export_cp1252"/>
+ <Action name="Statistics"/>
+ <Action name="template_create"/>
+ <Action name="template_remove"/>
+ <Action name="RefreshStructure"/>
+ <Action name="FindInFiles"/>
+ <Action name="settings_configure"/>
+ <Action name="Mode"/>
+ <Action name="gotoNextDocument"/>
+ <Action name="gotoPrevDocument"/>
+ <Action name="edit_goto_line" />
+ <Action name="edit_next_section" />
+ <Action name="edit_prev_section" />
+ <Action name="edit_next_paragraph" />
+ <Action name="edit_prev_paragraph" />
+ <Action name="edit_complete_word"/>
+ <Action name="edit_complete_env"/>
+ <Action name="edit_complete_abbrev"/>
+ <Action name="edit_next_bullet"/>
+ <Action name="edit_prev_bullet"/>
+ <Action name="edit_select_inside_env"/>
+ <Action name="edit_select_outside_env"/>
+ <Action name="edit_select_inside_group"/>
+ <Action name="edit_select_outside_group"/>
+ <Action name="edit_select_mathgroup"/>
+ <Action name="edit_select_paragraph"/>
+ <Action name="edit_select_line"/>
+ <Action name="edit_select_word"/>
+ <Action name="edit_delete_inside_env"/>
+ <Action name="edit_delete_outside_env"/>
+ <Action name="edit_delete_inside_group"/>
+ <Action name="edit_delete_outside_group"/>
+ <Action name="edit_delete_mathgroup"/>
+ <Action name="edit_delete_eol"/>
+ <Action name="edit_delete_paragraph"/>
+ <Action name="edit_delete_word"/>
+ <Action name="edit_begin_env"/>
+ <Action name="edit_end_env"/>
+ <Action name="edit_match_env"/>
+ <Action name="edit_close_env"/>
+ <Action name="edit_closeall_env"/>
+ <Action name="edit_begin_group"/>
+ <Action name="edit_end_group"/>
+ <Action name="edit_match_group"/>
+ <Action name="edit_close_group"/>
+ <Action name="help_latex_reference"/>
+ <Action name="help_handbook"/>
+ <Action name="help_tipofday"/>
+ <Action name="help_context" />
+ <Action name="help_docbrowser" />
+ <Action name="help_tex_guide" />
+ <Action name="help_latex_index" />
+ <Action name="help_latex_command" />
+ <Action name="help_latex_subject" />
+ <Action name="help_latex_env" />
+ <Action name="report_bug"/>
+</Disable>
+<Enable>
+ <Action name="file_print"/>
+ <Action name="EditorView"/>
+ <Action name="Back"/>
+ <Action name="Forward"/>
+ <Action name="Home"/>
+</Enable>
+</State>
+<State name="Viewer">
+<Disable>
+ <Action name="file_new"/>
+ <Action name="file_open"/>
+ <Action name="file_open_recent"/>
+ <Action name="file_save"/>
+ <Action name="file_save_as"/>
+ <Action name="file_save_all"/>
+ <Action name="file_close"/>
+ <Action name="file_close_all"/>
+ <Action name="file_close_all_others"/>
+ <Action name="file_export_ascii"/>
+ <Action name="file_export_latin1"/>
+ <Action name="file_export_latin2"/>
+ <Action name="file_export_latin3"/>
+ <Action name="file_export_latin4"/>
+ <Action name="file_export_latin5"/>
+ <Action name="file_export_latin9"/>
+ <Action name="file_export_cp1250"/>
+ <Action name="file_export_cp1252"/>
+ <Action name="Statistics"/>
+ <Action name="template_create"/>
+ <Action name="template_remove"/>
+ <Action name="RefreshStructure"/>
+ <Action name="FindInFiles"/>
+ <Action name="settings_configure"/>
+ <Action name="Mode"/>
+ <Action name="gotoNextDocument"/>
+ <Action name="gotoPrevDocument"/>
+ <Action name="edit_goto_line" />
+ <Action name="edit_next_section" />
+ <Action name="edit_prev_section" />
+ <Action name="edit_next_paragraph" />
+ <Action name="edit_prev_paragraph" />
+ <Action name="edit_complete_word"/>
+ <Action name="edit_complete_env"/>
+ <Action name="edit_complete_abbrev"/>
+ <Action name="edit_next_bullet"/>
+ <Action name="edit_prev_bullet"/>
+ <Action name="edit_select_inside_env"/>
+ <Action name="edit_select_outside_env"/>
+ <Action name="edit_select_inside_group"/>
+ <Action name="edit_select_outside_group"/>
+ <Action name="edit_select_mathgroup"/>
+ <Action name="edit_select_paragraph"/>
+ <Action name="edit_select_line"/>
+ <Action name="edit_select_word"/>
+ <Action name="edit_delete_inside_env"/>
+ <Action name="edit_delete_outside_env"/>
+ <Action name="edit_delete_inside_group"/>
+ <Action name="edit_delete_outside_group"/>
+ <Action name="edit_delete_mathgroup"/>
+ <Action name="edit_delete_eol"/>
+ <Action name="edit_delete_paragraph"/>
+ <Action name="edit_delete_word"/>
+ <Action name="edit_begin_env"/>
+ <Action name="edit_end_env"/>
+ <Action name="edit_match_env"/>
+ <Action name="edit_close_env"/>
+ <Action name="edit_closeall_env"/>
+ <Action name="edit_begin_group"/>
+ <Action name="edit_end_group"/>
+ <Action name="edit_match_group"/>
+ <Action name="edit_close_group"/>
+ <Action name="help_latex_reference"/>
+ <Action name="help_handbook"/>
+ <Action name="help_tipofday"/>
+ <Action name="help_context" />
+ <Action name="help_docbrowser" />
+ <Action name="help_tex_guide" />
+ <Action name="help_latex_index" />
+ <Action name="help_latex_command" />
+ <Action name="help_latex_subject" />
+ <Action name="help_latex_env" />
+ <Action name="report_bug"/>
+ <Action name="Back"/>
+ <Action name="Forward"/>
+ <Action name="Home"/>
+</Disable>
+<Enable>
+ <Action name="file_print"/>
+ <Action name="EditorView"/>
+</Enable>
+</State>
+<State name="Editor">
+<Enable>
+ <Action name="file_new"/>
+ <Action name="file_open"/>
+ <Action name="file_open_recent"/>
+ <Action name="file_save"/>
+ <Action name="file_save_as"/>
+ <Action name="file_save_all"/>
+ <Action name="file_close"/>
+ <Action name="file_close_all"/>
+ <Action name="file_close_all_others"/>
+ <Action name="file_print"/>
+ <Action name="file_export_ascii"/>
+ <Action name="file_export_latin1"/>
+ <Action name="file_export_latin2"/>
+ <Action name="file_export_latin3"/>
+ <Action name="file_export_latin4"/>
+ <Action name="file_export_latin5"/>
+ <Action name="file_export_latin9"/>
+ <Action name="file_export_cp1250"/>
+ <Action name="file_export_cp1252"/>
+ <Action name="Statistics"/>
+ <Action name="template_create"/>
+ <Action name="template_remove"/>
+ <Action name="RefreshStructure"/>
+ <Action name="FindInFiles"/>
+ <Action name="settings_configure"/>
+ <Action name="Mode"/>
+ <Action name="gotoNextDocument"/>
+ <Action name="gotoPrevDocument"/>
+ <Action name="edit_goto_line" />
+ <Action name="edit_next_section" />
+ <Action name="edit_prev_section" />
+ <Action name="edit_next_paragraph" />
+ <Action name="edit_prev_paragraph" />
+ <Action name="edit_complete_word"/>
+ <Action name="edit_complete_env"/>
+ <Action name="edit_complete_abbrev"/>
+ <Action name="edit_next_bullet"/>
+ <Action name="edit_prev_bullet"/>
+ <Action name="edit_select_inside_env"/>
+ <Action name="edit_select_outside_env"/>
+ <Action name="edit_select_inside_group"/>
+ <Action name="edit_select_outside_group"/>
+ <Action name="edit_select_mathgroup"/>
+ <Action name="edit_select_paragraph"/>
+ <Action name="edit_select_line"/>
+ <Action name="edit_select_word"/>
+ <Action name="edit_delete_inside_env"/>
+ <Action name="edit_delete_outside_env"/>
+ <Action name="edit_delete_inside_group"/>
+ <Action name="edit_delete_outside_group"/>
+ <Action name="edit_delete_mathgroup"/>
+ <Action name="edit_delete_eol"/>
+ <Action name="edit_delete_paragraph"/>
+ <Action name="edit_delete_word"/>
+ <Action name="edit_begin_env"/>
+ <Action name="edit_end_env"/>
+ <Action name="edit_match_env"/>
+ <Action name="edit_close_env"/>
+ <Action name="edit_closeall_env"/>
+ <Action name="edit_begin_group"/>
+ <Action name="edit_end_group"/>
+ <Action name="edit_match_group"/>
+ <Action name="edit_close_group"/>
+ <Action name="help_latex_reference"/>
+ <Action name="help_handbook"/>
+ <Action name="help_tipofday"/>
+ <Action name="help_context" />
+ <Action name="help_docbrowser" />
+ <Action name="help_tex_guide" />
+ <Action name="help_latex_index" />
+ <Action name="help_latex_command" />
+ <Action name="help_latex_subject" />
+ <Action name="help_latex_env" />
+ <Action name="report_bug"/>
+</Enable>
+<Disable>
+ <Action name="EditorView"/>
+</Disable>
+</State>
+</kpartgui>
+
diff --git a/src/kile/kileuntitled.cpp b/src/kile/kileuntitled.cpp
new file mode 100644
index 0000000..508d00b
--- /dev/null
+++ b/src/kile/kileuntitled.cpp
@@ -0,0 +1,37 @@
+//
+// C++ Implementation: kileuntitled
+//
+// Description:
+//
+//
+// Author: Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#include "kileuntitled.h"
+
+#include <qregexp.h>
+#include <klocale.h>
+
+QString KileUntitled::m_untitled = i18n("Untitled");
+int KileUntitled::m_last = -1;
+
+bool KileUntitled::isUntitled(const QString &str)
+{
+ static QRegExp reUntitled(m_untitled + " [0-9]+.*");
+ return reUntitled.exactMatch(str);
+}
+
+QString KileUntitled::next()
+{
+ ++m_last;
+ return current();
+}
+
+QString KileUntitled::current()
+{
+ return m_untitled + ' ' + QString::number(m_last);
+}
+
diff --git a/src/kile/kileuntitled.h b/src/kile/kileuntitled.h
new file mode 100644
index 0000000..6121298
--- /dev/null
+++ b/src/kile/kileuntitled.h
@@ -0,0 +1,31 @@
+//
+// C++ Interface: kileuntitled
+//
+// Description:
+//
+//
+// Author: Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef KILEUNTITLED_H
+#define KILEUNTITLED_H
+
+#include <qstring.h>
+
+class KileUntitled
+{
+public:
+ static bool isUntitled(const QString &str);
+ static QString next();
+ static QString current();
+
+private:
+ static QString m_untitled;
+ static int m_last;
+};
+
+#endif // KILEUNTITLED_H
+
diff --git a/src/kile/kileversion.cpp b/src/kile/kileversion.cpp
new file mode 100644
index 0000000..cc45df1
--- /dev/null
+++ b/src/kile/kileversion.cpp
@@ -0,0 +1,43 @@
+/**************************************************************************
+* Copyright (C) 2006 by Michel Ludwig (michel.ludwig@kdemail.net) *
+***************************************************************************/
+
+/**************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "kileversion.h"
+
+#include <qstringlist.h>
+
+int compareVersionStrings(const QString& s1, const QString& s2) {
+ QStringList l1 = QStringList::split(".", s1);
+ QStringList l2 = QStringList::split(".", s2);
+ while(l1.size() < 3) {
+ l1.push_back("0");
+ }
+ while(l2.size() < 3) {
+ l2.push_back("0");
+ }
+ QStringList::iterator i1 = l1.begin();
+ QStringList::iterator i2 = l2.begin();
+ for(unsigned int i = 0; i < 3; ++i) {
+ unsigned int c1 = (*i1).toUInt();
+ unsigned int c2 = (*i2).toUInt();
+ if(c1 < c2) {
+ return -1;
+ }
+ else if(c1 > c2) {
+ return 1;
+ }
+ ++i1;
+ ++i2;
+ }
+ return 0;
+}
+
diff --git a/src/kile/kileversion.h b/src/kile/kileversion.h
new file mode 100644
index 0000000..5a3b340
--- /dev/null
+++ b/src/kile/kileversion.h
@@ -0,0 +1,33 @@
+/***************************************************************************
+ begin : Wednesday Jan 25 2006
+ copyright : (C) 2006 by Thomas Braun
+ email : braun@physik.fu-berlin.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ****************************************************************************/
+
+
+#ifndef KILEVERSION_H
+#define KILEVERSION_H
+
+#include <qstring.h>
+
+const QString kileVersion="2.0";
+const QString kileFullVersion="2.0.1";
+const QString kilePrVersion="2";
+
+/**
+ * Compares two strings of the form "a.b(.c)" and "d.e(.f)" lexicographically,
+ * where a, b, c, d, e and f are natural numbers.
+ * @return 1 if s1 is bigger than s2, 0 if s1 == s2, -1 if s1 is smaller than s2
+ **/
+int compareVersionStrings(const QString& s1, const QString& s2);
+
+#endif
diff --git a/src/kile/kileviewmanager.cpp b/src/kile/kileviewmanager.cpp
new file mode 100644
index 0000000..cf78294
--- /dev/null
+++ b/src/kile/kileviewmanager.cpp
@@ -0,0 +1,584 @@
+//
+// C++ Implementation: kileviewmanager
+//
+// Description:
+//
+//
+// Author: Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>, (C) 2004
+// Michel Ludwig <michel.ludwig@kdemail.net>, (C) 2006, 2007
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kileviewmanager.h"
+
+#include <qpopupmenu.h>
+#include <qtimer.h> //for QTimer::singleShot trick
+#include <qpixmap.h>
+#include <qclipboard.h>
+
+#include <kdeversion.h>
+#include <kglobal.h>
+#include <kate/view.h>
+#include <kate/document.h>
+#include <kparts/componentfactory.h>
+#include <kxmlguiclient.h>
+#include <kxmlguifactory.h>
+#include <kiconloader.h>
+#include <kmimetype.h>
+#include <klocale.h>
+#include <ktexteditor/editinterfaceext.h>
+#include <kapplication.h>
+#include <kurldrag.h>
+
+#include "editorkeysequencemanager.h"
+#include "kileinfo.h"
+#include "kileconstants.h"
+#include "kiledocmanager.h"
+#include "kileextensions.h"
+#include "kileprojectview.h"
+#include "kileeventfilter.h"
+#include "kilestructurewidget.h"
+#include "kileedit.h"
+#include "plaintolatexconverter.h"
+#include "previewwidget.h"
+#include "quickpreview.h"
+
+namespace KileView
+{
+
+Manager::Manager(KileInfo *info, QObject *parent, const char *name) :
+ QObject(parent, name),
+ m_ki(info),
+ m_activeTextView(0L),
+// m_projectview(0L),
+ m_tabs(0L),
+ m_widgetStack(0L),
+ m_emptyDropWidget(0L)
+{
+}
+
+
+Manager::~Manager()
+{
+}
+
+void Manager::setClient(QObject *receiver, KXMLGUIClient *client)
+{
+ m_receiver = receiver;
+ m_client = client;
+ if(NULL == m_client->actionCollection()->action("popup_pasteaslatex"))
+ new KAction(i18n("Paste as LaTe&X"), 0, this,
+ SLOT(pasteAsLaTeX()), m_client->actionCollection(), "popup_pasteaslatex");
+ if(NULL == m_client->actionCollection()->action("popup_converttolatex"))
+ new KAction(i18n("Convert Selection to &LaTeX"), 0, this,
+ SLOT(convertSelectionToLaTeX()), m_client->actionCollection(), "popup_converttolatex");
+ if(NULL == m_client->actionCollection()->action("popup_quickpreview"))
+ new KAction(i18n("&QuickPreview Selection"), 0, this,
+ SLOT(quickPreviewPopup()), m_client->actionCollection(), "popup_quickpreview");
+}
+
+void Manager::createTabs(QWidget *parent)
+{
+ m_widgetStack = new QWidgetStack(parent);
+ m_emptyDropWidget = new DropWidget(parent);
+ m_widgetStack->addWidget(m_emptyDropWidget);
+ connect(m_emptyDropWidget, SIGNAL(testCanDecode(const QDragMoveEvent *, bool &)), this, SLOT(testCanDecodeURLs(const QDragMoveEvent *, bool &)));
+ connect(m_emptyDropWidget, SIGNAL(receivedDropEvent(QDropEvent *)), m_ki->docManager(), SLOT(openDroppedURLs(QDropEvent *)));
+ m_tabs = new KTabWidget(parent);
+ m_widgetStack->addWidget(m_tabs);
+ m_tabs->setFocusPolicy(QWidget::ClickFocus);
+ m_tabs->setTabReorderingEnabled(true);
+ m_tabs->setHoverCloseButton(true);
+ m_tabs->setHoverCloseButtonDelayed(true);
+ m_tabs->setFocus();
+ connect( m_tabs, SIGNAL( currentChanged( QWidget * ) ), m_receiver, SLOT(newCaption()) );
+ connect( m_tabs, SIGNAL( currentChanged( QWidget * ) ), m_receiver, SLOT(activateView( QWidget * )) );
+ connect( m_tabs, SIGNAL( currentChanged( QWidget * ) ), m_receiver, SLOT(updateModeStatus()) );
+ connect( m_tabs, SIGNAL( closeRequest(QWidget *) ), this, SLOT(closeWidget(QWidget *)));
+ connect( m_tabs, SIGNAL( testCanDecode( const QDragMoveEvent *, bool & ) ), this, SLOT(testCanDecodeURLs( const QDragMoveEvent *, bool & )) );
+ connect( m_tabs, SIGNAL( receivedDropEvent( QDropEvent * ) ), m_ki->docManager(), SLOT(openDroppedURLs( QDropEvent * )) );
+ connect( m_tabs, SIGNAL( receivedDropEvent( QWidget*, QDropEvent * ) ), this, SLOT(replaceLoadedURL( QWidget *, QDropEvent * )) );
+ m_widgetStack->raiseWidget(m_emptyDropWidget); // there are no tabs, so show the DropWidget
+}
+
+void Manager::closeWidget(QWidget *widget)
+{
+ if (widget->inherits( "Kate::View" ))
+ {
+ Kate::View *view = static_cast<Kate::View*>(widget);
+ m_ki->docManager()->fileClose(view->getDoc());
+ }
+}
+
+Kate::View* Manager::createTextView(KileDocument::TextInfo *info, int index)
+{
+ Kate::Document *doc = info->getDoc();
+ Kate::View *view = static_cast<Kate::View*>(info->createView (m_tabs, 0L));
+
+ //install a key sequence recorder on the view
+ view->focusProxy()->installEventFilter(new KileEditorKeySequence::Recorder(view, m_ki->editorKeySequenceManager()));
+
+ // in the case of simple text documents, we mimic the behaviour of LaTeX documents
+ if(info->getType() == KileDocument::Text)
+ {
+ view->focusProxy()->installEventFilter(m_ki->eventFilter());
+ }
+
+ //insert the view in the tab widget
+ m_tabs->insertTab( view, m_ki->getShortName(doc), index );
+ #if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0)
+ m_tabs->setTabToolTip(view, doc->url().pathOrURL() );
+ #else
+ m_tabs->setTabToolTip(view, doc->url().prettyURL() );
+ #endif
+
+ m_tabs->showPage( view );
+ m_textViewList.insert((index < 0 || (uint)index >= m_textViewList.count()) ? m_textViewList.count() : index, view);
+
+ connect(view, SIGNAL(viewStatusMsg(const QString&)), m_receiver, SLOT(newStatus(const QString&)));
+ connect(view, SIGNAL(newStatus()), m_receiver, SLOT(newCaption()));
+ connect(view, SIGNAL(dropEventPass(QDropEvent *)), m_ki->docManager(), SLOT(openDroppedURLs(QDropEvent *)));
+ connect(info, SIGNAL(urlChanged(KileDocument::Info*, const KURL&)), this, SLOT(urlChanged(KileDocument::Info*, const KURL&)));
+
+ connect( doc, SIGNAL(charactersInteractivelyInserted (int,int,const QString&)), m_ki->editorExtension()->complete(), SLOT(slotCharactersInserted(int,int,const QString&)) );
+ connect( view, SIGNAL(completionDone(KTextEditor::CompletionEntry)), m_ki->editorExtension()->complete(), SLOT( slotCompletionDone(KTextEditor::CompletionEntry)) );
+ connect( view, SIGNAL(completionAborted()), m_ki->editorExtension()->complete(), SLOT( slotCompletionAborted()) );
+ connect( view, SIGNAL(filterInsertString(KTextEditor::CompletionEntry*,QString *)), m_ki->editorExtension()->complete(), SLOT(slotFilterCompletion(KTextEditor::CompletionEntry*,QString *)) );
+
+ // install a working kate part popup dialog thingy
+ QPopupMenu *viewPopupMenu = (QPopupMenu*)(m_client->factory()->container("ktexteditor_popup", m_client));
+ if((NULL != view) && (NULL != viewPopupMenu))
+ view->installPopup(viewPopupMenu);
+ if(NULL != viewPopupMenu)
+ connect(viewPopupMenu, SIGNAL(aboutToShow()), this, SLOT(onKatePopupMenuRequest()));
+
+ //activate the newly created view
+ emit(activateView(view, false));
+ QTimer::singleShot(0, m_receiver, SLOT(newCaption())); //make sure the caption gets updated
+
+ reflectDocumentStatus(view->getDoc(), false, 0);
+
+ view->setFocusPolicy(QWidget::StrongFocus);
+ view->setFocus();
+
+ emit(prepareForPart("Editor"));
+ unplugKatePartMenu(view);
+
+ // use Kile's save and save-as functions instead of Katepart's
+ KAction *action = view->actionCollection()->action(KStdAction::stdName(KStdAction::Save));
+ if ( action )
+ {
+ KILE_DEBUG() << " reconnect action 'file_save'..." << endl;
+ action->disconnect(SIGNAL(activated()));
+ connect(action, SIGNAL(activated()), m_ki->docManager(), SLOT(fileSave()));
+ }
+ action = view->actionCollection()->action(KStdAction::stdName(KStdAction::SaveAs));
+ if ( action )
+ {
+ KILE_DEBUG() << " reconnect action 'file_save_as'..." << endl;
+ action->disconnect(SIGNAL(activated()));
+ connect(action, SIGNAL(activated()), m_ki->docManager(), SLOT(fileSaveAs()));
+ }
+ m_widgetStack->raiseWidget(m_tabs); // there is at least one tab, so show the KTabWidget now
+
+ return view;
+}
+
+void Manager::removeView(Kate::View *view)
+{
+ if (view)
+ {
+ m_client->factory()->removeClient(view);
+
+ m_tabs->removePage(view);
+ m_textViewList.remove(view);
+ delete view;
+
+ QTimer::singleShot(0, m_receiver, SLOT(newCaption())); //make sure the caption gets updated
+ if (textViews().isEmpty()) {
+ m_ki->structureWidget()->clear();
+ m_widgetStack->raiseWidget(m_emptyDropWidget); // there are no tabs left, so show
+ // the DropWidget
+ }
+ }
+}
+
+Kate::View *Manager::currentTextView() const
+{
+ if ( m_tabs->currentPage() &&
+ m_tabs->currentPage()->inherits( "Kate::View" ) )
+ {
+ return (Kate::View*) m_tabs->currentPage();
+ }
+
+ return 0;
+}
+
+Kate::View* Manager::textView(KileDocument::TextInfo *info)
+{
+ Kate::Document *doc = info->getDoc();
+ if(!doc)
+ {
+ return NULL;
+ }
+ for(Kate::View *view = m_textViewList.first(); view; view = m_textViewList.next())
+ {
+ if(view->getDoc() == doc)
+ {
+ return view;
+ }
+ }
+ return NULL;
+}
+
+int Manager::getIndexOf(Kate::View* view) const
+{
+ return m_tabs->indexOf(view);
+}
+
+unsigned int Manager::getTabCount() const {
+ return m_tabs->count();
+}
+
+Kate::View* Manager::switchToTextView(const KURL & url, bool requestFocus)
+{
+ Kate::View *view = 0L;
+ Kate::Document *doc = m_ki->docManager()->docFor(url);
+
+ if (doc)
+ {
+ view = static_cast<Kate::View*>(doc->views().first());
+ if(view)
+ {
+ m_tabs->showPage(view);
+ if(requestFocus)
+ view->setFocus();
+ }
+ }
+ return view;
+}
+
+void Manager::updateStructure(bool parse /* = false */, KileDocument::Info *docinfo /* = 0L */)
+{
+ if (docinfo == 0L)
+ docinfo = m_ki->docManager()->getInfo();
+
+ if (docinfo)
+ m_ki->structureWidget()->update(docinfo, parse);
+
+ Kate::View *view = currentTextView();
+ if (view) {view->setFocus();}
+
+ if ( textViews().count() == 0 )
+ m_ki->structureWidget()->clear();
+}
+
+void Manager::gotoNextView()
+{
+ if ( m_tabs->count() < 2 )
+ return;
+
+ int cPage = m_tabs->currentPageIndex() + 1;
+ if ( cPage >= m_tabs->count() )
+ m_tabs->setCurrentPage( 0 );
+ else
+ m_tabs->setCurrentPage( cPage );
+}
+
+void Manager::gotoPrevView()
+{
+ if ( m_tabs->count() < 2 )
+ return;
+
+ int cPage = m_tabs->currentPageIndex() - 1;
+ if ( cPage < 0 )
+ m_tabs->setCurrentPage( m_tabs->count() - 1 );
+ else
+ m_tabs->setCurrentPage( cPage );
+}
+
+void Manager::reflectDocumentStatus(Kate::Document *doc, bool isModified, unsigned char reason)
+{
+ QPixmap icon;
+ if ( reason == 0 && isModified ) //nothing
+ icon = SmallIcon("filesave");
+ else if ( reason == 1 || reason == 2 ) //dirty file
+ icon = SmallIcon("revert");
+ else if ( reason == 3 ) //file deleted
+ icon = SmallIcon("stop");
+ else if ( m_ki->extensions()->isScriptFile(doc->url()) )
+ icon = SmallIcon("js");
+ else
+ icon = KMimeType::pixmapForURL (doc->url(), 0, KIcon::Small);
+
+ changeTab(doc->views().first(), icon, m_ki->getShortName(doc));
+}
+
+/**
+ * Adds/removes the "Convert to LaTeX" entry in Kate's popup menu according to the selection.
+ */
+void Manager::onKatePopupMenuRequest(void)
+{
+ Kate::View *view = currentTextView();
+ if(NULL == view)
+ return;
+
+ QPopupMenu *viewPopupMenu = (QPopupMenu*)(m_client->factory()->container("ktexteditor_popup", m_client));
+ if(NULL == viewPopupMenu)
+ return;
+
+ // Setting up the "QuickPreview selection" entry
+ KAction *quickPreviewAction = m_client->actionCollection()->action("popup_quickpreview");
+ if(NULL != quickPreviewAction) {
+ if(!quickPreviewAction->isPlugged())
+ quickPreviewAction->plug(viewPopupMenu);
+
+ quickPreviewAction->setEnabled( view->getDoc()->hasSelection() ||
+ m_ki->editorExtension()->hasMathgroup(view) ||
+ m_ki->editorExtension()->hasEnvironment(view)
+ );
+ }
+
+ // Setting up the "Convert to LaTeX" entry
+ KAction *latexCvtAction = m_client->actionCollection()->action("popup_converttolatex");
+ if(NULL != latexCvtAction) {
+ if(!latexCvtAction->isPlugged())
+ latexCvtAction->plug(viewPopupMenu);
+
+ latexCvtAction->setEnabled(view->getDoc()->hasSelection());
+ }
+
+ // Setting up the "Paste as LaTeX" entry
+ KAction *pasteAsLaTeXAction = m_client->actionCollection()->action("popup_pasteaslatex");
+ if((NULL != pasteAsLaTeXAction)) {
+ if(!pasteAsLaTeXAction->isPlugged())
+ pasteAsLaTeXAction->plug(viewPopupMenu);
+
+ QClipboard *clip = KApplication::clipboard();
+ if(NULL != clip)
+ pasteAsLaTeXAction->setEnabled(!clip->text().isNull());
+ }
+}
+
+void Manager::convertSelectionToLaTeX(void)
+{
+ Kate::View *view = currentTextView();
+
+ if(NULL == view)
+ return;
+
+ Kate::Document *doc = view->getDoc();
+
+ if(NULL == doc)
+ return;
+
+ // Getting the selection
+ uint selStartLine = doc->selStartLine(), selStartCol = doc->selStartCol();
+ uint selEndLine = doc->selEndLine(), selEndCol = doc->selEndCol();
+
+ /* Variable to "restore" the selection after replacement: if {} was selected,
+ we increase the selection of two characters */
+ uint newSelEndCol;
+
+ PlainToLaTeXConverter cvt;
+
+ // "Notifying" the editor that what we're about to do must be seen as ONE operation
+ KTextEditor::EditInterfaceExt *editInterfaceExt = KTextEditor::editInterfaceExt(doc);
+ if(NULL != editInterfaceExt)
+ editInterfaceExt->editBegin();
+
+ // Processing the first line
+ int firstLineLength;
+ if(selStartLine != selEndLine)
+ firstLineLength = doc->lineLength(selStartLine);
+ else
+ firstLineLength = selEndCol;
+ QString firstLine = doc->text(selStartLine, selStartCol, selStartLine, firstLineLength);
+ QString firstLineCvt = cvt.ConvertToLaTeX(firstLine);
+ doc->removeText(selStartLine, selStartCol, selStartLine, firstLineLength);
+ doc->insertText(selStartLine, selStartCol, firstLineCvt);
+ newSelEndCol = selStartCol + firstLineCvt.length();
+
+ // Processing the intermediate lines
+ for(uint nLine = selStartLine + 1 ; nLine < selEndLine ; ++nLine) {
+ QString line = doc->textLine(nLine);
+ QString newLine = cvt.ConvertToLaTeX(line);
+ doc->removeLine(nLine);
+ doc->insertLine(nLine, newLine);
+ }
+
+ // Processing the final line
+ if(selStartLine != selEndLine) {
+ QString lastLine = doc->text(selEndLine, 0, selEndLine, selEndCol);
+ QString lastLineCvt = cvt.ConvertToLaTeX(lastLine);
+ doc->removeText(selEndLine, 0, selEndLine, selEndCol);
+ doc->insertText(selEndLine, 0, lastLineCvt);
+ newSelEndCol = lastLineCvt.length();
+ }
+
+ // End of the "atomic edit operation"
+ if(NULL != editInterfaceExt)
+ editInterfaceExt->editEnd();
+
+ doc->setSelection(selStartLine, selStartCol, selEndLine, newSelEndCol);
+}
+
+/**
+ * Pastes the clipboard's contents as LaTeX (ie. % -> \%, etc.).
+ */
+void Manager::pasteAsLaTeX(void)
+{
+ Kate::View *view = currentTextView();
+
+ if(NULL == view)
+ return;
+
+ Kate::Document *doc = view->getDoc();
+
+ if(NULL == doc)
+ return;
+
+ // Getting a proper text insertion point BEFORE the atomic editing operation
+ uint cursorLine, cursorCol;
+ if(doc->hasSelection()) {
+ cursorLine = doc->selStartLine();
+ cursorCol = doc->selStartCol();
+ } else {
+ view->cursorPositionReal(&cursorLine, &cursorCol);
+ }
+
+ // "Notifying" the editor that what we're about to do must be seen as ONE operation
+ KTextEditor::EditInterfaceExt *editInterfaceExt = KTextEditor::editInterfaceExt(doc);
+ if(NULL != editInterfaceExt)
+ editInterfaceExt->editBegin();
+
+ // If there is a selection, one must remove it
+ if(doc->hasSelection())
+ doc->removeSelectedText();
+
+ PlainToLaTeXConverter cvt;
+ QString toPaste = cvt.ConvertToLaTeX(KApplication::clipboard()->text());
+ doc->insertText(cursorLine, cursorCol, toPaste);
+
+ // End of the "atomic edit operation"
+ if(NULL != editInterfaceExt)
+ editInterfaceExt->editEnd();
+}
+
+void Manager::quickPreviewPopup()
+{
+ Kate::View *view = currentTextView();
+ if( ! view )
+ return;
+
+ Kate::Document *doc = view->getDoc();
+ if ( doc )
+ {
+ if ( doc->hasSelection() )
+ emit( startQuickPreview(KileTool::qpSelection) );
+ else if ( m_ki->editorExtension()->hasMathgroup(view) )
+ emit( startQuickPreview(KileTool::qpMathgroup) );
+ else if ( m_ki->editorExtension()->hasEnvironment(view) )
+ emit( startQuickPreview(KileTool::qpEnvironment) );
+ }
+}
+
+void Manager::testCanDecodeURLs(const QDragMoveEvent *e, bool &accept)
+{
+ accept = KURLDrag::canDecode(e); // only accept URL drops
+}
+
+void Manager::replaceLoadedURL(QWidget *w, QDropEvent *e)
+{
+ KURL::List urls;
+ if(!KURLDrag::decode(e, urls)) {
+ return;
+ }
+ int index = m_tabs->indexOf(w);
+ KileDocument::Extensions *extensions = m_ki->extensions();
+ bool hasReplacedTab = false;
+ for(KURL::List::iterator i = urls.begin(); i != urls.end(); ++i) {
+ KURL url = *i;
+ if(extensions->isProjectFile(url)) {
+ m_ki->docManager()->projectOpen(url);
+ }
+ else if(!hasReplacedTab) {
+ closeWidget(w);
+ m_ki->docManager()->fileOpen(url, QString::null, index);
+ hasReplacedTab = true;
+ }
+ else {
+ m_ki->docManager()->fileOpen(url);
+ }
+ }
+}
+
+void Manager::urlChanged(KileDocument::Info* info, const KURL& /*url*/)
+{
+ KileDocument::TextInfo *textInfo = dynamic_cast<KileDocument::TextInfo*>(info);
+ if(textInfo)
+ {
+ Kate::View *view = textView(textInfo);
+ if(!view)
+ {
+ return;
+ }
+ setTabLabel(view, m_ki->getShortName(textInfo->getDoc()));
+ }
+}
+
+DropWidget::DropWidget(QWidget * parent, const char * name, WFlags f) : QWidget(parent, name, f)
+{
+ setAcceptDrops(true);
+}
+
+DropWidget::~DropWidget()
+{
+}
+
+void DropWidget::dragMoveEvent(QDragMoveEvent *e)
+{
+ bool b;
+ emit testCanDecode(e, b);
+ e->accept(b);
+}
+
+void DropWidget::dropEvent(QDropEvent *e)
+{
+ emit receivedDropEvent(e);
+}
+
+// remove entries from KatePart menu:
+// - menu entry to config Kate, because there is
+// already one call to this configuration dialog from Kile
+// - goto line, because we put it into a submenu
+
+void Manager::unplugKatePartMenu(Kate::View* view)
+{
+ if ( view )
+ {
+ QStringList actionlist;
+ actionlist << "set_confdlg" << "go_goto_line"; // action names from katepartui.rc
+
+ for ( uint i=0; i < actionlist.count(); ++i )
+ {
+ KAction *action = view->actionCollection()->action( actionlist[i].ascii() );
+ if ( action )
+ {
+ action->unplugAll();
+// action->setShortcut(KShortcut());
+ }
+ }
+ }
+}
+
+}
+
+#include "kileviewmanager.moc"
diff --git a/src/kile/kileviewmanager.h b/src/kile/kileviewmanager.h
new file mode 100644
index 0000000..cbe443d
--- /dev/null
+++ b/src/kile/kileviewmanager.h
@@ -0,0 +1,149 @@
+//
+// C++ Interface: kileviewmanager
+//
+// Description:
+//
+//
+// Author: Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>, (C) 2004
+// Michel Ludwig <michel.ludwig@kdemail.net>, (C) 2006
+//
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEVIEWKILEVIEWMANAGER_H
+#define KILEVIEWKILEVIEWMANAGER_H
+
+#include <qobject.h>
+#include <qwidgetstack.h>
+
+#include <ktabwidget.h>
+
+class QPixmap;
+
+class KURL;
+class KXMLGUIClient;
+
+class KileInfo;
+class KileEventFilter;
+class KileProjectView;
+
+namespace Kate {
+ class Document;
+ class View;
+}
+
+namespace KileDocument {
+ class Info;
+ class TextInfo;
+}
+
+namespace KileView
+{
+
+//TODO inherit from KParts::Manager
+class Manager : public QObject
+{
+ Q_OBJECT
+
+public:
+ Manager(KileInfo *ki, QObject *parent = 0, const char *name = 0);
+
+ ~Manager();
+
+public:
+ void setClient(QObject *receiver, KXMLGUIClient *client);
+
+ Kate::View* currentTextView() const;
+ QPtrList<Kate::View>& textViews() {return m_textViewList;}
+ Kate::View* textView(int i) { return m_textViewList.at(i); }
+ Kate::View* textView(KileDocument::TextInfo *info);
+ int getIndexOf(Kate::View* view) const;
+ unsigned int getTabCount() const;
+
+ void createTabs(QWidget *);
+ Kate::View* createTextView(KileDocument::TextInfo *info, int index = -1);
+ KTabWidget* tabs() { return m_tabs; }
+
+ void unplugKatePartMenu(Kate::View* view);
+
+// void setProjectView(KileProjectView *view) { m_projectview = view; }
+// KileProjectView *projectView() { return m_projectview; } commented out by tbraun, better use signal/slot stuff
+
+public slots:
+ Kate::View* switchToTextView(const KURL & url, bool requestFocus = false);
+
+ void closeWidget(QWidget *);
+ void removeView(Kate::View *view);
+
+ void setTabLabel(QWidget *view, const QString & name) { m_tabs->setTabLabel(view, name); }
+ void changeTab(QWidget *view, const QPixmap & icon, const QString & name) { m_tabs->changeTab(view, icon, name); }
+
+ void updateStructure(bool parse = false, KileDocument::Info *docinfo = 0L);
+
+ void gotoNextView();
+ void gotoPrevView();
+
+ void reflectDocumentStatus(Kate::Document*, bool, unsigned char);
+
+ void onKatePopupMenuRequest(void);
+ void convertSelectionToLaTeX(void);
+ void pasteAsLaTeX(void);
+ void quickPreviewPopup();
+
+protected slots:
+ void testCanDecodeURLs(const QDragMoveEvent *e, bool &accept);
+ void replaceLoadedURL(QWidget *w, QDropEvent *e);
+
+ /**
+ *
+ **/
+ void urlChanged(KileDocument::Info* info, const KURL& url);
+
+signals:
+ void activateView(QWidget *, bool);
+ void prepareForPart(const QString &);
+ void startQuickPreview(int);
+
+private:
+ KileInfo *m_ki;
+ Kate::View *m_activeTextView;
+// KileProjectView *m_projectview;
+ QPtrList<Kate::View> m_textViewList;
+ KTabWidget *m_tabs;
+ QObject *m_receiver;
+ KXMLGUIClient *m_client;
+ QWidgetStack *m_widgetStack;
+ QWidget *m_emptyDropWidget;
+
+};
+
+/**
+ * Little helper widget to overcome the limitation that KTabWidget doesn't honour drop events when
+ * there are no tabs: the DropWidget is shown instead of KTabWidget when there are no tabs.
+ */
+class DropWidget : public QWidget {
+ Q_OBJECT
+
+ public:
+ DropWidget(QWidget * parent = 0, const char * name = 0, WFlags f = 0);
+ virtual ~DropWidget();
+
+ virtual void dragMoveEvent(QDragMoveEvent *e);
+
+ virtual void dropEvent(QDropEvent *e);
+
+ signals:
+ void testCanDecode(const QDragMoveEvent *, bool &);
+ void receivedDropEvent(QDropEvent *);
+};
+
+}
+
+#endif
diff --git a/src/kile/kilewizard.cpp b/src/kile/kilewizard.cpp
new file mode 100644
index 0000000..6f26ad3
--- /dev/null
+++ b/src/kile/kilewizard.cpp
@@ -0,0 +1,29 @@
+/***************************************************************************
+ begin : Tue Dec 23 2003
+ copyright : (C) 2003 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kilewizard.h"
+
+namespace KileDialog
+{
+ Wizard::Wizard(KConfig *config, QWidget *parent, const char *name, const QString &caption) :
+ KDialogBase(parent,name,true,caption,KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true),
+ m_td(QString::null, QString::null, QString::null, 0, 0, QString::null),
+ m_config(config)
+ {
+ }
+
+ Wizard::~Wizard()
+ {}
+}
diff --git a/src/kile/kilewizard.h b/src/kile/kilewizard.h
new file mode 100644
index 0000000..0798123
--- /dev/null
+++ b/src/kile/kilewizard.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ begin : Tue Dec 23 2003
+ copyright : (C) 2003 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEWIZARD_H
+#define KILEWIZARD_H
+
+#include <kdialogbase.h>
+
+#include "kileactions.h"
+
+class KConfig;
+
+namespace KileDialog
+{
+ class Wizard : public KDialogBase
+ {
+ public:
+ Wizard(KConfig *, QWidget *parent=0, const char *name=0, const QString &caption = QString::null);
+ ~Wizard();
+
+ public:
+ const KileAction::TagData & tagData() const { return m_td; }
+
+ protected:
+ KileAction::TagData m_td;
+ KConfig *m_config;
+ };
+}
+
+#endif
diff --git a/src/kile/latexcmd.cpp b/src/kile/latexcmd.cpp
new file mode 100644
index 0000000..f097d5d
--- /dev/null
+++ b/src/kile/latexcmd.cpp
@@ -0,0 +1,442 @@
+/***************************************************************************
+ latexcmd.cpp
+ ------------
+ date : Nov 26 2005
+ version : 0.22
+ copyright : (C) 2005 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "latexcmd.h"
+
+#include <klocale.h>
+#include "kiledebug.h"
+
+namespace KileDocument
+{
+
+// BEGIN LatexCommands
+
+LatexCommands::LatexCommands(KConfig *config, KileInfo *info) : m_config(config), m_ki(info)
+{
+ m_envGroupName = "Latex Environments";
+ m_cmdGroupName = "Latex Commands";
+
+ LatexCommands::resetCommands();
+}
+
+void LatexCommands::resetCommands()
+{
+ // description of the fields for environments
+ // 0: standard entry (+,-)
+ // 1: environmenty type (a,m,l,t,v)
+ // 2: including starred version (*)
+ // 3: eol character (\\\\)
+ // 4: need mathmode ($) or displaymathmode ($$)
+ // 5: standard tabulator (tabulator string, f.e. &=& or &=)
+ // 6: optional parameter
+ // 7: parameter group(s)
+
+ QStringList envlist;
+ envlist
+ // list environments
+ << "itemize,+,l,*,,,,,"
+ << "enumerate,+,l,*,,,,,"
+ << "description,+,l,*,,,,,"
+ << "Bitemize,+,l,,,,,,"
+ << "Benumerate,+,l,,,,,,"
+ << "Bdescription,+,l,,,,,,"
+ << "labeling,+,l,,,,,[ ],{ }"
+ // tabular environments
+ << "tabular,+,t,*,\\\\,,&,[tcb],"
+ << "tabularx,+,t,,\\\\,,&,,{w}"
+ << "tabbing,+,t,,\\\\,,\\>,,"
+ << "longtable,+,t,,\\\\,,&,[tcb],"
+ << "ltxtable,+,t,,\\\\,,&,[tcb],{w}"
+ << "supertabular,+,t,*,\\\\,,&,,"
+ << "mpsupertabular,+,t,*,\\\\,,&,,"
+ << "xtabular,+,t,*,\\\\,,&,,"
+ << "mpxtabular,+,t,*,\\\\,,&,,"
+ // math environments
+ << "displaymath,+,m,,,,,,"
+ << "equation,+,m,*,,,,,"
+ << "eqnarray,+,m,*,\\\\,,&=&,,"
+ << "array,+,m,,\\\\,$,&,[tcb],"
+ << "matrix,+,m,,\\\\,$,&,,"
+ << "pmatrix,+,m,,\\\\,$,&,,"
+ << "bmatrix,+,m,,\\\\,$,&,,"
+ << "Bmatrix,+,m,,\\\\,$,&,,"
+ << "vmatrix,+,m,,\\\\,$,&,,"
+ << "Vmatrix,+,m,,\\\\,$,&,,"
+ // amsmath environments
+ << "multline,+,a,*,\\\\,,,,"
+ << "gather,+,a,*,\\\\,,,,"
+ << "split,+,a,,\\\\,$$,,," // needs surrounding environment
+ << "align,+,a,*,\\\\,,&=,,"
+ << "flalign,+,a,*,\\\\,,&=,,"
+ << "alignat,+,a,*,\\\\,,&=,,{n}"
+ << "aligned,+,a,,\\\\,$,&=,[tcb],"
+ << "gathered,+,a,,\\\\,$,,[tcb],"
+ << "alignedat,+,a,,\\\\,$,&=,[tcb],{n}"
+ //<< "xalignat,+,a,*,\\\\,,&=,,{n}" // obsolet
+ //<< "xxalignat,+,a,*,\\\\,,&=,,{n}" // obsolet
+ << "cases,+,a,,\\\\,$,&,,"
+ // verbatim environments
+ << "verbatim,+,v,*,,,,,"
+ << "boxedverbatim,+,v,,,,,,"
+ << "Bverbatim,+,v,,,,,[ ],"
+ << "Lverbatim,+,v,,,,,[ ],"
+ << "lstlisting,+,v,,,,,[ ],"
+ ;
+
+ // description of the fields for commands
+ // 0: standard entry (+,-)
+ // 1: command type (L,R,C,I)
+ // 2: including starred version (*)
+ // 3: optional parameter
+ // 4: parameter
+
+ QStringList cmdlist;
+ cmdlist
+ // Labels
+ << "\\label,+,L,,,{ }"
+ // References
+ << "\\ref,+,R,,,{ }"
+ << "\\pageref,+,R,,,{ }"
+ << "\\vref,+,R,,,{ }"
+ << "\\vpageref,+,R,,[ ],{ }"
+ << "\\fref,+,R,,,{ }"
+ << "\\Fref,+,R,,,{ }"
+ << "\\eqref,+,R,,,{ }"
+ << "\\autoref,+,R,,,{ }"
+ // Citations
+ << "\\cite,+,C,,,{ }"
+ // Includes
+ << "\\include,+,I,,,{ }"
+ << "\\input,+,I,,,{ }"
+ << "\\Input,+,I,,,{ }"
+ ;
+
+ // first clear the dictionary
+ m_latexCommands.clear();
+
+ // insert environments
+ addUserCommands(m_envGroupName,envlist);
+ insert(envlist);
+
+ // insert commands
+ addUserCommands(m_cmdGroupName,cmdlist);
+ insert(cmdlist);
+}
+
+
+// add user defined environments/commands
+
+void LatexCommands::addUserCommands(const QString &name, QStringList &list)
+{
+ if ( m_config->hasGroup(name) )
+ {
+ KILE_DEBUG() << name << endl;
+ QMap<QString,QString> map = m_config->entryMap(name);
+ if ( ! map.empty() )
+ {
+ QMapConstIterator<QString,QString> it;
+ for ( it=map.begin(); it!=map.end(); ++it)
+ {
+ list << it.key() + ",-," + it.data();
+ KILE_DEBUG() << "\tadd: " << it.key() + " --> " + it.data() << endl;
+ }
+ }
+ }
+}
+
+// insert all entries into the dictionary
+
+void LatexCommands::insert(const QStringList &list)
+{
+ // now insert new entries, if they have the right number of attributes
+ QStringList::ConstIterator it;
+ for ( it=list.begin(); it!=list.end(); ++it )
+ {
+ int pos = (*it).find(',');
+ if ( pos >= 0 )
+ {
+ QString key = (*it).left(pos);
+ QString value = (*it).right( (*it).length()-pos-1 );
+ QStringList valuelist = QStringList::split(',',value,true);
+ uint attributes = ( key.at(0)=='\\' ) ? MaxCmdAttr : MaxEnvAttr;
+ if ( valuelist.count() == attributes )
+ m_latexCommands[key] = value;
+ else
+ KILE_DEBUG() << "\tLatexCommands error: wrong number of attributes (" << key << " ---> " << value << ")" << endl;
+ }
+ else
+ {
+ KILE_DEBUG() << "\tLatexCommands error: no separator found (" << (*it) << ")" << endl;
+ }
+ }
+}
+
+//////////////////// get value from dictionary ////////////////////
+
+// Get value of a key. A star at the end is stripped.
+
+QString LatexCommands::getValue(const QString &name)
+{
+ QString key = ( name.find('*',-1) >= 0 ) ? name.left(name.length()-1) : name;
+ return ( m_latexCommands.contains(key) ) ? m_latexCommands[key] : QString::null;
+}
+
+//////////////////// internal functions ////////////////////
+
+// get parameter at index
+
+QString LatexCommands::getAttrAt(const QString &name, uint index)
+{
+ uint attributes = ( name.at(0)=='\\' ) ? MaxCmdAttr : MaxEnvAttr;
+ QStringList list = QStringList::split(',',getValue(name),true);
+ return ( index<attributes && list.count()==attributes ) ? list[index] : QString::null;
+}
+
+// check for a standard environment
+
+bool LatexCommands::isUserDefined(const QString &name)
+{
+ return ( getValue(name).at(0) == '-' );
+}
+
+// check for a special environment type
+
+bool LatexCommands::isType(const QString &name, QChar ch)
+{
+ if ( name.find('*',-1) >= 0 )
+ {
+ QString envname = name.left( name.length()-1 );
+ return ( getValue(envname).at(2)==ch && isStarredEnv(envname) );
+ }
+ else
+ {
+ return ( getValue(name).at(2) == ch );
+ }
+}
+
+//////////////////// attributes and characters ////////////////////
+
+// convert attribute to character
+
+QChar LatexCommands::getAttrChar(CmdAttribute attr)
+{
+ QChar ch;
+ switch ( attr )
+ {
+ case CmdAttrAmsmath: ch = 'a'; break;
+ case CmdAttrMath: ch = 'm'; break;
+ case CmdAttrList: ch = 'l'; break;
+ case CmdAttrVerbatim: ch = 'v'; break;
+ case CmdAttrTabular: ch = 't'; break;
+ case CmdAttrLabel: ch = 'L'; break;
+ case CmdAttrReference: ch = 'R'; break;
+ case CmdAttrCitations: ch = 'C'; break;
+ case CmdAttrIncludes: ch = 'I'; break;
+ default:
+ KILE_DEBUG() << "\tLatexCommands error: unknown type of env/cmd: code " << attr << endl;
+ return '?';
+ }
+
+ return ch;
+}
+
+// convert character to attribute
+
+CmdAttribute LatexCommands::getCharAttr(QChar ch)
+{
+ CmdAttribute attr;
+ switch ( ch )
+ {
+ case 'a': attr = CmdAttrAmsmath; break;
+ case 'm': attr = CmdAttrMath; break;
+ case 'l': attr = CmdAttrList; break;
+ case 'v': attr = CmdAttrVerbatim; break;
+ case 't': attr = CmdAttrTabular; break;
+ case 'L': attr = CmdAttrLabel; break;
+ case 'R': attr = CmdAttrReference; break;
+ case 'C': attr = CmdAttrCitations; break;
+ case 'I': attr = CmdAttrIncludes; break;
+ default:
+ KILE_DEBUG() << "\tLatexCommands error: unknown type of env/cmd: " << static_cast<char>(ch) << endl;
+ return CmdAttrNone;
+ }
+
+ return attr;
+}
+
+//////////////////// public attributes ////////////////////
+
+// check for environment types
+
+bool LatexCommands::isMathEnv(const QString &name)
+{
+ QChar ch = getValue(name).at(2);
+ return ( ch=='m' || ch=='a' );
+}
+
+// check for some special attributes
+
+bool LatexCommands::isStarredEnv(const QString &name)
+{
+ return ( getAttrAt(name,2) == "*" );
+}
+
+bool LatexCommands::isCrEnv(const QString &name)
+{
+ return ( getAttrAt(name,3) == "\\\\" );
+}
+
+bool LatexCommands::isMathModeEnv(const QString &name)
+{
+ return ( getAttrAt(name,4) == "$" );
+}
+
+bool LatexCommands::isDisplaymathModeEnv(const QString &name)
+{
+ return ( getAttrAt(name,4) == "$$" );
+}
+
+bool LatexCommands::needsMathMode(const QString &name)
+{
+ return ( isMathModeEnv(name) || isDisplaymathModeEnv(name) );
+}
+
+QString LatexCommands::getTabulator(const QString &name)
+{
+ QString tab = getAttrAt(name,5);
+ return ( tab.find('&') >= 0 ) ? tab : QString::null;
+}
+
+//////////////////// environments and commands ////////////////////
+
+// get a list of environments and commands. The search can be restricted
+// to given attributes and userdefined environments and commands
+
+void LatexCommands::commandList(QStringList &list, uint attr, bool userdefined)
+{
+ list.clear();
+
+ QMapConstIterator<QString,QString> it;
+ for ( it=m_latexCommands.begin(); it!=m_latexCommands.end(); ++it)
+ {
+ // first check, if we need really need all environments and commands
+ // or if a restriction to some attributes is given
+ if ( attr != (uint)CmdAttrNone )
+ {
+ if ( ! ( attr & (uint)getCharAttr( it.data().at(2) ) ) )
+ continue;
+ }
+
+ // second check, if we need only user defined environments or commands
+ if ( ! userdefined )
+ list.append( it.key() );
+ else if ( it.data().at(0) == '-' )
+ list.append( it.key() );
+ }
+}
+
+// get all attributes for a given environment and command
+
+bool LatexCommands::commandAttributes(const QString &name, LatexCmdAttributes &attr)
+{
+ uint attributes = ( name.at(0)=='\\' ) ? MaxCmdAttr : MaxEnvAttr;
+
+ // split attribute list
+ QStringList list = QStringList::split(',',getValue(name),true);
+
+ // check number of attributes
+ if ( list.count() != attributes )
+ return false;
+
+ // check for a standard environment/command
+ attr.standard = ( list[0] == "+" );
+
+ // most important: type of environment or command
+ attr.type = getCharAttr( list[1].at(0) );
+ if ( attr.type == CmdAttrNone )
+ return false;
+
+ // all environments/commands have starred attribute
+ attr.starred = ( list[2] == "*" ) ;
+
+ // next attributes differ for environments and commands
+ if ( attributes == MaxEnvAttr )
+ {
+ attr.cr = ( list[3] == "\\\\" ) ;
+ attr.mathmode = ( list[4] == "$" ) ;
+ attr.displaymathmode = ( list[4] == "$$" ) ;
+ attr.tabulator = list[5];
+ attr.option = list[6];
+ attr.parameter = list[7];
+ }
+ else
+ {
+ attr.cr = false;
+ attr.mathmode = false;
+ attr.displaymathmode = false;
+ attr.tabulator = QString::null;
+ attr.option = list[3];
+ attr.parameter = list[4];
+ }
+
+ return true;
+}
+
+//////////////////// determine config string ////////////////////
+
+QString LatexCommands::configString(LatexCmdAttributes &attr,bool env)
+{
+ // most important: type of environment or command
+ QChar ch = getAttrChar( attr.type );
+ if ( ch == '?' )
+ return QString::null;
+ QString s = QString("%1,").arg(ch);
+
+ // all environments/commands have starred attribute
+ if ( attr.starred )
+ s += "*,";
+ else
+ s += ',';
+
+ // next attributes are only valid for environments
+ if ( env )
+ {
+ if ( attr.cr )
+ s += "\\\\,";
+ else
+ s += ',';
+ if ( attr.mathmode )
+ s += "$,";
+ else if ( attr.displaymathmode )
+ s += "$$";
+ else
+ s += ',';
+ s += attr.tabulator + ',';
+ }
+
+ // option and parameter are for both types again
+ s += attr.option + ',';
+ s += attr.parameter;
+
+ return s; // s.left(s.length()-1);
+}
+
+// END LatexCommands
+
+}
+#include "latexcmd.moc"
diff --git a/src/kile/latexcmd.h b/src/kile/latexcmd.h
new file mode 100644
index 0000000..095a65a
--- /dev/null
+++ b/src/kile/latexcmd.h
@@ -0,0 +1,119 @@
+/***************************************************************************
+ latexcmd.h
+ ----------
+ date : Jul 25 2005
+ version : 0.20
+ copyright : (C) 2005 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// kommandos mit weiteren Parametern
+
+#ifndef LATEXCMD_H
+#define LATEXCMD_H
+
+#include <qobject.h>
+#include <qstringlist.h>
+#include <qmap.h>
+
+#include <kconfig.h>
+
+class KileInfo;
+
+namespace KileDocument
+{
+
+const uint MaxEnvAttr = 8;
+const uint MaxCmdAttr = 5;
+
+enum CmdAttribute {
+ CmdAttrNone=0, // unknown
+ CmdAttrAmsmath=1,CmdAttrMath=2,CmdAttrList=4,CmdAttrTabular=8,CmdAttrVerbatim=16, // environments
+ CmdAttrLabel=32,CmdAttrReference=64,CmdAttrCitations=128,CmdAttrIncludes=256 // commands
+};
+
+class LatexCmdAttributes
+{
+public:
+ bool standard;
+ CmdAttribute type;
+ bool starred;
+ bool cr;
+ bool mathmode;
+ bool displaymathmode;
+ QString tabulator;
+ QString option;
+ QString parameter;
+};
+
+class LatexCommands : public QObject
+{
+ Q_OBJECT
+
+public:
+ LatexCommands(KConfig *config, KileInfo *info);
+ ~LatexCommands() {};
+
+ QString envGroupName() { return m_envGroupName; }
+ QString cmdGroupName() { return m_cmdGroupName; }
+ QString configString(LatexCmdAttributes &attr,bool env);
+
+ bool isMathEnv(const QString &name);
+ bool isListEnv(const QString &name) { return isType(name,'l'); }
+ bool isTabularEnv(const QString &name) { return isType(name,'t'); }
+ bool isVerbatimEnv(const QString &name) { return isType(name,'v'); }
+
+ bool isLabelCmd(const QString &name) { return isType(name,'L'); }
+ bool isReferenceCmd(const QString &name) { return isType(name,'R'); }
+ bool isCitationCmd(const QString &name) { return isType(name,'C'); }
+ bool isInputCmd(const QString &name) { return isType(name,'I'); }
+
+ bool isStarredEnv(const QString &name);
+ bool isCrEnv(const QString &name);
+ bool isMathModeEnv(const QString &name);
+ bool isDisplaymathModeEnv(const QString &name);
+ bool needsMathMode(const QString &name);
+ QString getTabulator(const QString &name);
+
+ void commandList(QStringList &list, uint attr, bool userdefined);
+ bool commandAttributes(const QString &name, LatexCmdAttributes &attr);
+
+ void resetCommands();
+
+private:
+
+ KConfig *m_config;
+ KileInfo *m_ki;
+
+ QString m_envGroupName, m_cmdGroupName;
+ QMap<QString,QString> m_latexCommands;
+
+ void addUserCommands(const QString &name, QStringList &list);
+ void insert(const QStringList &list);
+
+ QString getValue(const QString &name);
+
+
+ bool isUserDefined(const QString &name);
+ bool isType(const QString &name, QChar ch);
+ QString getAttrAt(const QString &name, uint index);
+ QChar getAttrChar(CmdAttribute attr);
+ CmdAttribute getCharAttr(QChar ch);
+
+};
+
+
+
+
+}
+
+#endif
diff --git a/src/kile/latexcmddialog.cpp b/src/kile/latexcmddialog.cpp
new file mode 100644
index 0000000..d1ff7ff
--- /dev/null
+++ b/src/kile/latexcmddialog.cpp
@@ -0,0 +1,911 @@
+/***************************************************************************
+ latexcmddialog.cpp
+ --------------
+ date : Jul 25 2005
+ version : 0.20
+ copyright : (C) 2005 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// kommandos mit weiteren Parametern
+
+#include "latexcmddialog.h"
+#include "latexcmd.h"
+
+#include <qlayout.h>
+#include <qvgroupbox.h>
+#include <qvalidator.h>
+#include <qregexp.h>
+#include <qwhatsthis.h>
+
+#include <kmessagebox.h>
+#include <klocale.h>
+#include "kiledebug.h"
+
+#include "kileconfig.h"
+
+namespace KileDialog
+{
+
+// BEGIN NewLatexCommand
+
+NewLatexCommand::NewLatexCommand(QWidget *parent, const QString &caption,
+ const QString &groupname, KListViewItem *lvitem,
+ KileDocument::CmdAttribute cmdtype,
+ QMap<QString,bool> *dict)
+ : KDialogBase( parent,0, true, caption, Ok | Cancel, Ok, true ),
+ m_dict(dict)
+{
+ // 'add' is only allowed, if the KListViewItem is defined
+ m_addmode = ( lvitem == 0 );
+ m_envmode = ( cmdtype < KileDocument::CmdAttrLabel );
+ m_cmdType = cmdtype;
+
+ // set modes for input dialog
+ // AMS Math Tab List Verb Label Ref Cit Inc
+ // MathOrTab + + +
+ // Option + + + + + + + +
+ // Parameter + + + + + + + +
+
+ m_useMathOrTab = false;
+ m_useOption = m_useParameter = true;
+ if ( cmdtype==KileDocument::CmdAttrAmsmath || cmdtype==KileDocument::CmdAttrMath || cmdtype==KileDocument::CmdAttrTabular)
+ m_useMathOrTab = true;
+ else if ( cmdtype==KileDocument::CmdAttrVerbatim )
+ m_useParameter = false;
+
+ QWidget *page = new QWidget( this );
+ setMainWidget(page);
+
+ // layout
+ QVBoxLayout *vbox = new QVBoxLayout(page, 6,6 );
+ QLabel *label1 = new QLabel(page);
+
+ QVGroupBox* group= new QVGroupBox(i18n("Attributes"),page );
+ QWidget *widget = new QWidget(group);
+ QGridLayout *grid = new QGridLayout(widget, 8,3, marginHint(),spacingHint());
+
+ QLabel *label2 = new QLabel(i18n("Group:"), widget);
+ QLabel *label3 = new QLabel(i18n("&Name:"), widget);
+ QLabel *grouplabel = new QLabel(groupname, widget);
+ QLabel *label4 = new QLabel(i18n("Include *-&version:"), widget);
+ m_edName = new KLineEdit(widget);
+ m_chStarred = new QCheckBox(widget);
+
+ grid->addWidget(label2,0,0);
+ grid->addWidget(grouplabel,0,2);
+ grid->addWidget(label3,1,0);
+ grid->addWidget(m_edName,1,2);
+ grid->addWidget(label4,2,0);
+ grid->addWidget(m_chStarred,2,2);
+
+ label3->setBuddy(m_edName);
+ label4->setBuddy(m_chStarred);
+ QWhatsThis::add(grouplabel,i18n("Name of the group, to which this environment or command belongs."));
+ if ( m_addmode )
+ QWhatsThis::add(m_edName,i18n("Name of the new environment or command."));
+ else
+ QWhatsThis::add(m_edName,i18n("Name of the environment or command to edit."));
+ QWhatsThis::add(m_chStarred,i18n("Does this environment or command also exist in a starred version?"));
+
+ int currentRow = 3;
+ if ( m_useMathOrTab )
+ {
+ QLabel *label5 = new QLabel(i18n("\\\\ is end of &line:"), widget);
+ QLabel *label6 = new QLabel(i18n("Needs &math mode:"), widget);
+ QLabel *label7 = new QLabel(i18n("&Tabulator:"), widget);
+ m_chEndofline = new QCheckBox(widget);
+ m_chMath = new QCheckBox(widget);
+ m_coTab = new QComboBox(widget);
+
+ grid->addWidget(label5,3,0);
+ grid->addWidget(m_chEndofline,3,2);
+ grid->addWidget(label6,4,0);
+ grid->addWidget(m_chMath,4,2);
+ grid->addWidget(label7,5,0);
+ grid->addWidget(m_coTab,5,2);
+
+ label5->setBuddy(m_chEndofline);
+ label6->setBuddy(m_chMath);
+ label7->setBuddy(m_coTab);
+ QWhatsThis::add(m_chEndofline,i18n("Shall 'Smart New Line' insert \\\\?"));
+ QWhatsThis::add(m_chMath,i18n("Does this environment need math mode?"));
+ QWhatsThis::add(m_coTab,i18n("Define the standard tabulator of this environment."));
+
+ m_coTab->insertItem(QString::null);
+ m_coTab->insertItem("&");
+ m_coTab->insertItem("&=");
+ m_coTab->insertItem("&=&");
+
+ currentRow += 3;
+ }
+
+ if ( m_useOption )
+ {
+ QLabel *label8 = new QLabel(i18n("Opt&ion:"), widget);
+ m_coOption = new QComboBox(widget);
+ grid->addWidget(label8,currentRow,0);
+ grid->addWidget(m_coOption,currentRow,2);
+
+ label8->setBuddy(m_coOption);
+
+ m_coOption->insertItem(QString::null);
+ if ( m_envmode )
+ {
+ m_coOption->insertItem("[tcb]");
+ m_coOption->insertItem("[lcr]");
+ QWhatsThis::add(m_coOption,i18n("Define an optional alignment parameter."));
+ }
+ else
+ {
+ QWhatsThis::add(m_coOption,i18n("Does this command need an optional parameter."));
+ }
+ m_coOption->insertItem("[ ]");
+
+ currentRow++;
+ }
+
+ if ( m_useParameter )
+ {
+ QLabel *label9 = new QLabel(i18n("&Parameter:"), widget);
+ m_coParameter = new QComboBox(widget);
+ grid->addWidget(label9,currentRow,0);
+ grid->addWidget(m_coParameter,currentRow,2);
+
+ label9->setBuddy(m_coParameter);
+
+ if ( m_envmode )
+ {
+ m_coParameter->insertItem(QString::null);
+ m_coParameter->insertItem("{n}");
+ m_coParameter->insertItem("{w}");
+ m_coParameter->insertItem("{ }");
+ QWhatsThis::add(m_coParameter,i18n("Does this environment need an additional parameter like {n} for an integer number, {w} for a width or { } for any other parameter?"));
+ }
+ else
+ {
+ m_coParameter->insertItem("{ }");
+ // m_coParameter->insertItem(QString::null);
+ QWhatsThis::add(m_coParameter,i18n("Does this command need an argument?"));
+ }
+
+ currentRow++;
+ }
+
+ // stretch last row
+ //grid->setRowStretch(maxrows-1,1);
+
+ // add or edit mode
+ if ( m_addmode ) // add mode
+ {
+ QString pattern;
+ if ( m_envmode )
+ {
+ label1->setText( i18n("Define a new LaTeX environment:") );
+ pattern = "[A-Za-z]+";
+ }
+ else
+ {
+ label1->setText( i18n("Define a new LaTeX command:") );
+ pattern = "\\\\?[A-Za-z]+";
+ }
+ QRegExp reg(pattern);
+ m_edName->setValidator( new QRegExpValidator(reg,m_edName) );
+ m_edName->setFocus();
+ }
+ else // edit mode
+ {
+ // always insert name and starred attribute
+ m_edName->setText(lvitem->text(0));
+ m_edName->setReadOnly(true);
+ m_chStarred->setChecked( lvitem->text(1) == "*" );
+
+ if ( m_envmode ) // insert existing arguments for environments
+ {
+ label1->setText( i18n("Edit a LaTeX Environment") );
+ if ( m_useMathOrTab )
+ {
+ m_chEndofline->setChecked( lvitem->text(2) == "\\\\" );
+ m_chMath->setChecked( lvitem->text(3) == "$" );
+ m_coTab->setCurrentText( lvitem->text(4) );
+ }
+ if ( m_useOption )
+ m_coOption->setCurrentText( lvitem->text(5) );
+ if ( m_useParameter )
+ m_coParameter->setCurrentText( lvitem->text(6) );
+ }
+ else // insert existing arguments for commands
+ {
+ label1->setText( i18n("Edit a LaTeX Command") );
+ if ( m_useOption )
+ m_coOption->setCurrentText( lvitem->text(2) );
+ if ( m_useParameter )
+ m_coParameter->setCurrentText( lvitem->text(3) );
+ }
+ }
+
+ // fill vbox
+ vbox->addWidget(label1,0,Qt::AlignHCenter);
+ vbox->addWidget(group);
+ vbox->addStretch();
+}
+
+// get all attributes of this command
+
+void NewLatexCommand::getParameter(QString &name, KileDocument::LatexCmdAttributes &attr)
+{
+ name = m_edName->text();
+ if ( m_envmode==false && name.at(0)!='\\' )
+ name.prepend('\\');
+
+ // set main attributes
+ attr.standard = false;
+ attr.type = m_cmdType;
+ attr.starred = m_chStarred->isChecked();
+
+ // read all atributes attributes
+ if ( m_useMathOrTab )
+ {
+ attr.cr = m_chEndofline->isChecked();
+ attr.mathmode = m_chMath->isChecked();
+ attr.displaymathmode = false;
+ attr.tabulator = m_coTab->currentText();
+ }
+ else
+ {
+ attr.cr = false;
+ attr.mathmode = false;
+ attr.displaymathmode = false;
+ attr.tabulator = QString::null;
+ }
+
+ attr.option = ( m_useOption ) ? m_coOption->currentText() : QString::null;
+ attr.parameter = ( m_useParameter ) ? m_coParameter->currentText() : QString::null;
+}
+
+void NewLatexCommand::slotOk()
+{
+ // check for an empty string
+ if ( m_edName->text().isEmpty() )
+ {
+ KMessageBox::error( this, i18n("An empty string is not allowed.") );
+ return;
+ }
+
+ QString name = m_edName->text();
+ if ( m_envmode==false && name.at(0)!='\\' )
+ name.prepend('\\');
+
+ if ( m_addmode && m_dict->contains(name) ) {
+ QString msg = ( m_envmode ) ? i18n("This environment already exists.")
+ : i18n("This command already exists.");
+ KMessageBox::error( this,msg );
+ return;
+ }
+
+ accept();
+}
+//END NewLatexCommand
+
+////////////////////////////// LaTeX environments/commands dialog //////////////////////////////
+
+//BEGIN LatexCommandsDialog
+
+LatexCommandsDialog::LatexCommandsDialog(KConfig *config, KileDocument::LatexCommands *commands, QWidget *parent, const char *name)
+ : KDialogBase( parent,name, true, i18n("LaTeX Configuration"), Ok | Cancel | Help, Ok, true ),
+ m_config(config), m_commands(commands)
+{
+ QWidget *page = new QWidget( this );
+ setMainWidget(page);
+
+ QGridLayout *grid = new QGridLayout(page, 7,3, 6,spacingHint());
+ QLabel *label = new QLabel(i18n("Define LaTeX Environments and Commands for Kile"), page);
+
+ // create TabWidget
+ m_tab = new QTabWidget(page);
+ m_cbUserDefined = new QCheckBox(i18n("&Show only user defined environments and commands"),page);
+
+ // page 1: environment listview
+ QWidget *page1 = new QWidget(m_tab);
+ m_lvEnvironments = new KListView(page1);
+ m_lvEnvironments->setRootIsDecorated(true);
+ m_lvEnvironments->addColumn(i18n("Environment"));
+ m_lvEnvironments->addColumn(i18n("Starred"));
+ m_lvEnvironments->addColumn(i18n("EOL"));
+ m_lvEnvironments->addColumn(i18n("Math"));
+ m_lvEnvironments->addColumn(i18n("Tab"));
+ m_lvEnvironments->addColumn(i18n("Option"));
+ m_lvEnvironments->addColumn(i18n("Parameter"));
+ m_lvEnvironments->setAllColumnsShowFocus(true);
+ m_lvEnvironments->setSelectionMode(QListView::Single);
+
+ QGridLayout *grid1 = new QGridLayout(page1, 1,1, 10,10);
+ grid1->addWidget(m_lvEnvironments,0,0);
+
+ for ( int col=1; col<=6; col++ )
+ m_lvEnvironments->setColumnAlignment(col,Qt::AlignHCenter);
+
+ // page 2: command listview
+ QWidget *page2 = new QWidget(m_tab);
+ m_lvCommands = new KListView(page2);
+ m_lvCommands->setRootIsDecorated(true);
+ m_lvCommands->addColumn(i18n("Command"));
+ m_lvCommands->addColumn(i18n("Starred"));
+ m_lvCommands->addColumn(i18n("Option"));
+ m_lvCommands->addColumn(i18n("Parameter"));
+ m_lvCommands->setAllColumnsShowFocus(true);
+ m_lvCommands->setSelectionMode(QListView::Single);
+
+ QGridLayout *grid2 = new QGridLayout(page2, 1,1, 10,10);
+ grid2->addWidget(m_lvCommands,0,0);
+
+ for ( int col=1; col<=3; col++ )
+ m_lvCommands->setColumnAlignment(col,Qt::AlignHCenter);
+
+ // add all pages to TabWidget
+ m_tab->addTab(page1,i18n("&Environments"));
+ m_tab->addTab(page2,i18n("&Commands"));
+ // page2->setEnabled(false); // disable command page
+
+ // button
+ m_btnAdd = new KPushButton(i18n("&Add..."), page);
+ m_btnDelete = new KPushButton(i18n("&Delete"), page);
+ m_btnEdit = new KPushButton(i18n("&Edit..."), page);
+
+ // add to grid
+ grid->addMultiCellWidget(label,0,0,0,2, Qt::AlignHCenter);
+ grid->addMultiCellWidget(m_tab,1,5,0,0);
+ grid->addWidget(m_cbUserDefined,6,0); // grid --> 7
+ grid->addWidget(m_btnAdd,2,2);
+ grid->addWidget(m_btnDelete,3,2);
+ grid->addWidget(m_btnEdit,4,2);
+
+ grid->setRowSpacing(1,m_btnAdd->height()-4);
+ grid->setRowStretch(5,1);
+ grid->setColStretch(0,1);
+ grid->addColSpacing(1,12);
+
+ setButtonText(Help,"Default Settings");
+ slotEnableButtons();
+
+ QWhatsThis::add(m_lvEnvironments,i18n("List of known environments with a lot of additional information, which Kile could perhaps use. You can add your own environments, which will be recognized by autocompletion of environments, 'Smart Newline' and 'Smart Tabulator' for example. Of course you can only edit and delete user defined environments."));
+ QWhatsThis::add(m_btnAdd,i18n("Add a new environment."));
+ QWhatsThis::add(m_btnDelete,i18n("Delete an user defined environment."));
+ QWhatsThis::add(m_btnEdit,i18n("Edit an user defined environment."));
+
+ connect(m_tab,SIGNAL(currentChanged(QWidget*)),this,SLOT(slotPageChanged(QWidget*)));
+ connect(m_lvEnvironments, SIGNAL(selectionChanged()),this, SLOT(slotEnableButtons()));
+ connect(m_lvCommands, SIGNAL(selectionChanged()),this, SLOT(slotEnableButtons()));
+ connect(m_btnAdd, SIGNAL(clicked()),this, SLOT(slotAddClicked()));
+ connect(m_btnDelete, SIGNAL(clicked()),this, SLOT(slotDeleteClicked()));
+ connect(m_btnEdit, SIGNAL(clicked()),this, SLOT(slotEditClicked()));
+ connect(m_cbUserDefined, SIGNAL(clicked()),this, SLOT(slotUserDefinedClicked()));
+
+ // read config and initialize changes (add, edit or delete an entry)
+ readConfig();
+ m_commandChanged = false;
+
+ // init listview
+ resetListviews();
+ slotEnableButtons();
+
+ resize(sizeHint().width()+20,sizeHint().height()+50);
+}
+
+////////////////////////////// listview //////////////////////////////
+
+void LatexCommandsDialog::resetListviews()
+{
+ m_dictCommands.clear();
+ m_lvEnvironments->clear();
+ m_lvCommands->clear();
+
+ m_lviAmsmath = new KListViewItem(m_lvEnvironments,i18n("AMS-Math"));
+ m_lviMath = new KListViewItem(m_lvEnvironments,i18n("Math"));
+ m_lviList = new KListViewItem(m_lvEnvironments,i18n("Lists"));
+ m_lviTabular = new KListViewItem(m_lvEnvironments,i18n("Tabular"));
+ m_lviVerbatim = new KListViewItem(m_lvEnvironments,i18n("Verbatim"));
+
+ m_lviLabels = new KListViewItem(m_lvCommands,i18n("Labels"));
+ m_lviReferences = new KListViewItem(m_lvCommands,i18n("References"));
+ m_lviCitations = new KListViewItem(m_lvCommands,i18n("Citations"));
+ m_lviInputs = new KListViewItem(m_lvCommands,i18n("Includes"));
+
+ QStringList list;
+ QStringList::ConstIterator it;
+ KileDocument::LatexCmdAttributes attr;
+
+ m_commands->commandList(list,KileDocument::CmdAttrNone,m_cbUserDefined->isChecked());
+ for ( it=list.begin(); it != list.end(); ++it )
+ {
+ if ( m_commands->commandAttributes(*it,attr) )
+ {
+ KListViewItem *parent;
+ switch ( attr.type ) {
+ case KileDocument::CmdAttrAmsmath: parent = m_lviAmsmath; break;
+ case KileDocument::CmdAttrMath: parent = m_lviMath; break;
+ case KileDocument::CmdAttrList: parent = m_lviList; break;
+ case KileDocument::CmdAttrTabular: parent = m_lviTabular; break;
+ case KileDocument::CmdAttrVerbatim: parent = m_lviVerbatim; break;
+ case KileDocument::CmdAttrLabel: parent = m_lviLabels; break;
+ case KileDocument::CmdAttrReference: parent = m_lviReferences; break;
+ case KileDocument::CmdAttrCitations: parent = m_lviCitations; break;
+ case KileDocument::CmdAttrIncludes: parent = m_lviInputs; break;
+ default: continue;
+ }
+ setEntry(parent,*it,attr);
+ }
+ }
+}
+
+LatexCommandsDialog::LVmode LatexCommandsDialog::getListviewMode()
+{
+ return ( m_tab->currentPageIndex() == 0 ) ? lvEnvMode : lvCmdMode;
+}
+
+KileDocument::CmdAttribute LatexCommandsDialog::getCommandMode(KListViewItem *item)
+{
+ KileDocument::CmdAttribute type;
+
+ if ( item == m_lviAmsmath )
+ type = KileDocument::CmdAttrAmsmath;
+ else if ( item == m_lviMath )
+ type = KileDocument::CmdAttrMath;
+ else if ( item == m_lviList )
+ type = KileDocument::CmdAttrList;
+ else if ( item == m_lviTabular )
+ type = KileDocument::CmdAttrTabular;
+ else if ( item == m_lviVerbatim )
+ type = KileDocument::CmdAttrVerbatim;
+ else if ( item == m_lviLabels )
+ type = KileDocument::CmdAttrLabel;
+ else if ( item == m_lviReferences )
+ type = KileDocument::CmdAttrReference;
+ else if ( item == m_lviCitations )
+ type = KileDocument::CmdAttrCitations;
+ else if ( item == m_lviInputs )
+ type = KileDocument::CmdAttrIncludes;
+ else
+ type = KileDocument::CmdAttrNone;
+
+ return type;
+}
+
+bool LatexCommandsDialog::isParentItem(KListViewItem *item)
+{
+ return ( item==m_lviMath ||
+ item==m_lviList ||
+ item==m_lviTabular ||
+ item==m_lviVerbatim ||
+ item==m_lviLabels ||
+ item==m_lviReferences ||
+ item==m_lviCitations ||
+ item==m_lviInputs
+ );
+}
+
+////////////////////////////// entries //////////////////////////////
+
+void LatexCommandsDialog::setEntry(KListViewItem *parent,const QString &name,
+ KileDocument::LatexCmdAttributes &attr)
+{
+ // set dictionary
+ m_dictCommands[name] = attr.standard;
+
+ // create an item
+ KListViewItem *item = new KListViewItem(parent,name);
+
+ // always set the starred entry
+ if ( attr.starred )
+ item->setText(1,"*");
+
+ // environments have more attributes
+ if ( attr.type < KileDocument::CmdAttrLabel ) // environments
+ {
+ if ( attr.cr )
+ item->setText(2,"\\\\");
+ if ( attr.mathmode )
+ item->setText(3,"$");
+ else if ( attr.displaymathmode )
+ item->setText(3,"$$");
+ item->setText(4,attr.tabulator);
+ item->setText(5,attr.option);
+ item->setText(6,attr.parameter);
+ }
+ else // commands
+ {
+ item->setText(2,attr.option);
+ item->setText(3,attr.parameter);
+ }
+}
+
+void LatexCommandsDialog::getEntry(KListViewItem *item,KileDocument::LatexCmdAttributes &attr)
+{
+ // always set the starred entry
+ attr.starred = ( item->text(1) == "*" );
+
+ // get all attributes
+ if ( item->text(0).at(0) != '\\' ) // environment
+ {
+ attr.cr = ( item->text(2) == "\\\\" );
+ attr.mathmode = ( item->text(3) == "$" );
+ attr.displaymathmode = ( item->text(3) == "$$" );
+ attr.tabulator = item->text(4);
+ attr.option = item->text(5);
+ attr.parameter = item->text(6);
+ }
+ else // commands
+ {
+ attr.cr = false;
+ attr.mathmode = false;
+ attr.displaymathmode = false;
+ attr.tabulator = QString::null;
+ attr.option = item->text(2);
+ attr.parameter = item->text(3);
+ }
+}
+
+////////////////////////////// type of environment or command //////////////////////////////
+
+bool LatexCommandsDialog::isUserDefined(const QString &name)
+{
+ return ( m_dictCommands.contains(name) && m_dictCommands[name]==false );
+}
+
+// look for user defined environment or commands in this listview
+
+bool LatexCommandsDialog::hasUserDefined(KListView *listview)
+{
+ for ( QListViewItem *cur=listview->firstChild(); cur; cur=cur->nextSibling() )
+ {
+ for ( QListViewItem *curchild=cur->firstChild(); curchild; curchild=curchild->nextSibling() )
+ {
+ if ( isUserDefined(curchild->text(0)) )
+ return true;
+ }
+ }
+ return false;
+}
+
+////////////////////////////// slots //////////////////////////////
+
+void LatexCommandsDialog::slotPageChanged(QWidget *)
+{
+ slotEnableButtons();
+}
+
+void LatexCommandsDialog::slotEnableButtons()
+{
+ bool addState = false;
+ bool deleteState = false;
+ bool editState = false;
+ bool resetState = false;
+
+ KListView *listview = ( getListviewMode() == lvEnvMode ) ? m_lvEnvironments : m_lvCommands;
+ resetState = ( hasUserDefined(listview) );
+
+ KListViewItem *item = (KListViewItem *)listview->selectedItem();
+
+ if ( item && item!=m_lviAmsmath )
+ {
+ addState = isParentItem(item);
+ if ( !addState && isUserDefined(item->text(0)) )
+ {
+ deleteState = true;
+ editState = true;
+ }
+ }
+
+ m_btnAdd->setEnabled(addState);
+ m_btnDelete->setEnabled(deleteState);
+ m_btnEdit->setEnabled(editState);
+ enableButton(Help,resetState);
+}
+
+void LatexCommandsDialog::slotAddClicked()
+{
+ KListView *listview;
+ QString caption;
+ bool envmode;
+
+ if ( getListviewMode() == lvEnvMode )
+ {
+ listview = m_lvEnvironments;
+ caption = i18n("LaTeX Environments");
+ envmode = true;
+ }
+ else
+ {
+ listview = m_lvCommands;
+ caption = i18n("LaTeX Commands");
+ envmode = false;
+ }
+
+ KListViewItem *item = (KListViewItem *)listview->selectedItem();
+ if ( item && isParentItem(item) )
+ {
+ // get current command type
+ KileDocument::CmdAttribute type = getCommandMode(item);
+ if ( type == KileDocument::CmdAttrNone )
+ {
+ KILE_DEBUG() << "\tLatexCommandsDialog error: no item in slotAddClicked() (" << item->text(0) << ")" << endl;
+ return;
+ }
+
+ // add a new environment or command
+ NewLatexCommand *dialog = new NewLatexCommand(this,caption,item->text(0),0L,type,&m_dictCommands);
+ if ( dialog->exec() == QDialog::Accepted )
+ {
+ m_commandChanged = true;
+
+ // insert new item with attributes
+ QString name;
+ KileDocument::LatexCmdAttributes attr;
+ dialog->getParameter(name,attr);
+ setEntry((KListViewItem *)item,name,attr);
+ // open this parent item
+ if ( !item->isOpen() )
+ {
+ item->setOpen(true);
+ }
+ slotEnableButtons();
+ }
+ delete dialog;
+ }
+}
+
+void LatexCommandsDialog::slotDeleteClicked()
+{
+ KListView *listview;
+ QString message;
+
+ if ( getListviewMode() == lvEnvMode )
+ {
+ listview = m_lvEnvironments;
+ message = i18n("Do you want to delete this environment?");
+ }
+ else
+ {
+ listview = m_lvCommands;
+ message = i18n("Do you want to delete this command?");
+ }
+
+ KListViewItem *item = (KListViewItem *)listview->selectedItem();
+ if ( item && !isParentItem(item) )
+ {
+ if (KMessageBox::warningContinueCancel(this, message, i18n("Delete"))==KMessageBox::Continue)
+ {
+ m_commandChanged = true;
+
+ if ( isUserDefined(item->text(0)) )
+ m_dictCommands.remove(item->text(0));
+ delete item;
+ slotEnableButtons();
+ }
+ }
+}
+
+void LatexCommandsDialog::slotEditClicked()
+{
+ KListView *listview;
+ QString caption;
+
+ if ( getListviewMode() == lvEnvMode )
+ {
+ listview = m_lvEnvironments;
+ caption = i18n("LaTeX Environment");
+ }
+ else
+ {
+ listview = m_lvCommands;
+ caption = i18n("LaTeX Commands");
+ }
+
+ KListViewItem *item = (KListViewItem *)listview->selectedItem();
+ if ( item && !isParentItem(item) )
+ {
+ KListViewItem *parentitem = (KListViewItem *)item->parent();
+ if ( parentitem )
+ {
+ // get current command type
+ KileDocument::CmdAttribute type = getCommandMode(parentitem);
+ if ( type == KileDocument::CmdAttrNone )
+ {
+ KILE_DEBUG() << "\tLatexCommandsDialog error: no item in slotAddClicked() (" << item->text(0) << ")" << endl;
+ return;
+ }
+
+ // edit a new environment or command
+ NewLatexCommand *dialog = new NewLatexCommand(this,caption,parentitem->text(0),item,type, &m_dictCommands);
+ if ( dialog->exec() == QDialog::Accepted )
+ {
+ m_commandChanged = true;
+
+ // delete old item
+ delete item;
+ // insert new item with changed attributes
+ QString name;
+ KileDocument::LatexCmdAttributes attr;
+ dialog->getParameter(name,attr);
+ setEntry(parentitem,name,attr);
+ }
+ delete dialog;
+ }
+ }
+}
+
+void LatexCommandsDialog::slotUserDefinedClicked()
+{
+ bool states[9];
+
+ getListviewStates(states);
+ resetListviews();
+ setListviewStates(states);
+}
+
+// reset to default settings
+
+void LatexCommandsDialog::slotHelp()
+{
+ QString mode = ( getListviewMode() == lvEnvMode ) ? i18n("'environment'") : i18n("'command'");
+ if ( KMessageBox::warningContinueCancel(this, i18n("All your %1 settings will be overwritten with the default settings, are you sure you want to continue?").arg(mode)) == KMessageBox::Continue )
+ {
+ if ( getListviewMode() == lvEnvMode )
+ resetEnvironments();
+ else
+ resetCommands();
+ slotEnableButtons();
+ }
+}
+
+// OK-Button clicked, we have to look for user defined environments/commands
+
+void LatexCommandsDialog::slotOk()
+{
+ // save checkbox for user defined commands
+ KileConfig::setShowUserCommands(m_cbUserDefined->isChecked());
+
+ // write config entries for environments and commands
+ writeConfig(m_lvEnvironments,m_commands->envGroupName(),true);
+ writeConfig(m_lvCommands,m_commands->cmdGroupName(),false);
+ m_config->sync();
+
+ // reset known LaTeX environments and commands
+ m_commands->resetCommands();
+
+ // save if there is a change in user defined commands and environments
+ KileConfig::setCompleteChangedCommands( m_commandChanged );
+
+ accept();
+}
+
+////////////////////////////// read/write config //////////////////////////////
+
+void LatexCommandsDialog::readConfig()
+{
+ // read checkbox for user defined commands
+ m_cbUserDefined->setChecked( KileConfig::showUserCommands() );
+}
+
+void LatexCommandsDialog::writeConfig(KListView *listview, const QString &groupname, bool env)
+{
+ // first delete old entries
+ if ( m_config->hasGroup(groupname) )
+ m_config->deleteGroup(groupname);
+
+ // prepare for new entries
+ m_config->setGroup(groupname);
+
+ // now get all attributes
+ KileDocument::LatexCmdAttributes attr;
+ attr.standard = false;
+
+ // scan the listview for non standard entries
+ for ( QListViewItem *cur=listview->firstChild(); cur; cur=cur->nextSibling() )
+ {
+ // get the type of the parent entry
+ attr.type = getCommandMode((KListViewItem *)cur);
+ if ( attr.type == KileDocument::CmdAttrNone )
+ {
+ KILE_DEBUG() << "\tLatexCommandsDialog error: no parent item (" << cur->text(0) << ")" << endl;
+ continue;
+ }
+
+ // look for children
+ for ( QListViewItem *curchild=cur->firstChild(); curchild; curchild=curchild->nextSibling() )
+ {
+ QString key = curchild->text(0);
+ if ( isUserDefined(key) )
+ {
+ getEntry((KListViewItem *)curchild,attr);
+ QString value = m_commands->configString(attr,env);
+ KILE_DEBUG() << "\tLatexCommandsDialog write config: " << key << " --> " << value << endl;
+ if ( ! value.isEmpty() )
+ m_config->writeEntry(key,value);
+ }
+ }
+ }
+}
+
+////////////////////////////// reset environments and commands //////////////////////////////
+
+// delete all user defined environments
+
+void LatexCommandsDialog::resetEnvironments()
+{
+ // remember current states
+ bool states[9];
+ getListviewStates(states);
+
+ // delete user defined commands ands re-read the list
+ if ( m_config->hasGroup(m_commands->envGroupName()) )
+ m_config->deleteGroup(m_commands->envGroupName());
+ m_commands->resetCommands();
+
+ // reset Listview and set old states again (if possible)
+ resetListviews();
+ setListviewStates(states);
+}
+
+// delete all user defined commands
+
+void LatexCommandsDialog::resetCommands()
+{
+ // remember current states
+ bool states[9];
+ getListviewStates(states);
+
+ // delete user defined commands ands re-read the list
+ if ( m_config->hasGroup(m_commands->cmdGroupName()) )
+ m_config->deleteGroup(m_commands->cmdGroupName());
+ m_commands->resetCommands();
+
+ // reset Listview and set old states again (if possible)
+ resetListviews();
+ setListviewStates(states);
+}
+
+// states of all parent items
+
+void LatexCommandsDialog::getListviewStates(bool states[])
+{
+ states[0] = m_lvEnvironments->isOpen(m_lviAmsmath);
+ states[1] = m_lvEnvironments->isOpen(m_lviMath);
+ states[2] = m_lvEnvironments->isOpen(m_lviList);
+ states[3] = m_lvEnvironments->isOpen(m_lviTabular);
+ states[4] = m_lvEnvironments->isOpen(m_lviVerbatim);
+
+ states[5] = m_lvCommands->isOpen(m_lviLabels);
+ states[6] = m_lvCommands->isOpen(m_lviReferences);
+ states[7] = m_lvCommands->isOpen(m_lviCitations);
+ states[8] = m_lvCommands->isOpen(m_lviInputs);
+}
+
+void LatexCommandsDialog::setListviewStates(bool states[])
+{
+ m_lvEnvironments->setOpen(m_lviAmsmath,states[0]);
+ m_lvEnvironments->setOpen(m_lviMath,states[1]);
+ m_lvEnvironments->setOpen(m_lviList,states[2]);
+ m_lvEnvironments->setOpen(m_lviTabular,states[3]);
+ m_lvEnvironments->setOpen(m_lviVerbatim,states[4]);
+
+ m_lvCommands->setOpen(m_lviLabels,states[5]);
+ m_lvCommands->setOpen(m_lviReferences,states[6]);
+ m_lvCommands->setOpen(m_lviCitations,states[7]);
+ m_lvCommands->setOpen(m_lviInputs,states[8]);
+}
+
+//END LatexCommandsDialog
+
+
+}
+#include "latexcmddialog.moc"
diff --git a/src/kile/latexcmddialog.h b/src/kile/latexcmddialog.h
new file mode 100644
index 0000000..345a1cd
--- /dev/null
+++ b/src/kile/latexcmddialog.h
@@ -0,0 +1,126 @@
+/***************************************************************************
+ latexcmddialog.h
+ --------------
+ date : Jul 25 2005
+ version : 0.20
+ copyright : (C) 2005 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef LATEXCMDDIALOG_H
+#define LATEXCMDDIALOG_H
+
+#include <kpushbutton.h>
+#include <kdialogbase.h>
+#include <klineedit.h>
+#include <klistview.h>
+#include <kconfig.h>
+
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qlistview.h>
+#include <qstringlist.h>
+#include <qtabwidget.h>
+#include <qmap.h>
+
+#include "latexcmd.h"
+
+namespace KileDialog
+{
+
+class NewLatexCommand : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ NewLatexCommand(QWidget *parent, const QString &caption,
+ const QString &groupname, KListViewItem *lvitem,
+ KileDocument::CmdAttribute cmdtype, QMap<QString,bool> *dict);
+ ~NewLatexCommand() {}
+ void getParameter(QString &name, KileDocument::LatexCmdAttributes &attr);
+
+private:
+ KLineEdit *m_edName;
+ QCheckBox *m_chStarred, *m_chEndofline, *m_chMath;
+ QComboBox *m_coTab, *m_coOption, *m_coParameter;
+
+ bool m_addmode, m_envmode;
+ bool m_useMathOrTab, m_useOption, m_useParameter;
+ KileDocument::CmdAttribute m_cmdType;
+ QMap<QString,bool> *m_dict;
+
+private slots:
+ void slotOk();
+};
+
+
+class LatexCommandsDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ LatexCommandsDialog(KConfig *config, KileDocument::LatexCommands *commands, QWidget *parent=0, const char *name=0);
+ ~LatexCommandsDialog() {}
+
+ //enum EnvParameter { envName,envStarred,envEOL,envMath,envTab,envOption };
+
+private:
+ enum LVmode { lvEnvMode=1, lvCmdMode=2 };
+
+ KConfig *m_config;
+ KileDocument::LatexCommands *m_commands;
+ QMap<QString,bool> m_dictCommands;
+ bool m_commandChanged;
+
+ KListView *m_lvEnvironments, *m_lvCommands;
+ KListViewItem *m_lviList,*m_lviTabular,*m_lviMath,*m_lviAmsmath,*m_lviVerbatim;
+ KListViewItem *m_lviLabels,*m_lviReferences,*m_lviCitations;
+ KListViewItem *m_lviInputs;
+ QTabWidget *m_tab;
+ KPushButton *m_btnAdd, *m_btnDelete, *m_btnEdit;
+ QCheckBox *m_cbUserDefined;
+
+ void resetListviews();
+ LVmode getListviewMode();
+ KileDocument::CmdAttribute getCommandMode(KListViewItem *item);
+ bool isParentItem(KListViewItem *item);
+
+ void setEntry(KListViewItem *parent,const QString &name,KileDocument::LatexCmdAttributes &attr);
+ void getEntry(KListViewItem *item,KileDocument::LatexCmdAttributes &attr);
+
+ bool isUserDefined(const QString &name);
+ bool hasUserDefined(KListView *listview);
+
+ void resetEnvironments();
+ void resetCommands();
+ void getListviewStates(bool states[]);
+ void setListviewStates(bool states[]);
+
+ void readConfig();
+ void writeConfig(KListView *listview, const QString &groupname, bool env);
+
+private slots:
+ void slotPageChanged(QWidget *);
+ void slotEnableButtons();
+ void slotAddClicked();
+ void slotDeleteClicked();
+ void slotEditClicked();
+ void slotUserDefinedClicked();
+ void slotHelp();
+ void slotOk();
+};
+
+}
+
+#endif
diff --git a/src/kile/latexconfigwidget.ui b/src/kile/latexconfigwidget.ui
new file mode 100644
index 0000000..28ec181
--- /dev/null
+++ b/src/kile/latexconfigwidget.ui
@@ -0,0 +1,258 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KileWidgetLatexConfig</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KileWidgetLatexConfig</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>602</width>
+ <height>365</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>LaTeX</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>m_bgCommands</cstring>
+ </property>
+ <property name="title">
+ <string>Commands</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>m_pbCommands</cstring>
+ </property>
+ <property name="text">
+ <string>Configure...</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>m_tlCommands</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Configure LaTeX environments and commands</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>m_bgQuotes</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Double Quotes</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>m_tlType</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Type:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_DoubleQuotes</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>kcfg_InsertDoubleQuotes</cstring>
+ </property>
+ <property name="text">
+ <string>Automatically insert opening and closing double &amp;quotes for LaTeX</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>kcfg_DoubleQuotes</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <spacer row="1" column="2">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>280</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>m_bgMathmode</cstring>
+ </property>
+ <property name="title">
+ <string>Mathmode</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_autoInsertDollar</cstring>
+ </property>
+ <property name="text">
+ <string>Auto insert $</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox5</cstring>
+ </property>
+ <property name="title">
+ <string>Environment Variables</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_tlPath</cstring>
+ </property>
+ <property name="text">
+ <string>TEXINPUTS:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_TeXPaths</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>kcfg_TeXPaths</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>kcfg_BibInputPaths</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>kcfg_BstInputPaths</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>m_bibinputpath</cstring>
+ </property>
+ <property name="text">
+ <string>BIBINPUTS:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_BibInputPaths</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_bstinputpath</cstring>
+ </property>
+ <property name="text">
+ <string>B&amp;STINPUTS:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_BstInputPaths</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>m_pbCommands</sender>
+ <signal>clicked()</signal>
+ <receiver>KileWidgetLatexConfig</receiver>
+ <slot>slotConfigure()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in declaration">kconfig.h</include>
+ <include location="local" impldecl="in declaration">latexcmd.h</include>
+ <include location="local" impldecl="in declaration">latexcmddialog.h</include>
+ <include location="local" impldecl="in implementation">latexconfigwidget.ui.h</include>
+</includes>
+<variables>
+ <variable access="private">KConfig *m_config;</variable>
+ <variable access="private">KileDocument::LatexCommands *m_commands;</variable>
+</variables>
+<slots>
+ <slot access="private" specifier="non virtual">slotConfigure()</slot>
+</slots>
+<functions>
+ <function access="private" specifier="non virtual">init()</function>
+ <function specifier="non virtual">setLatexCommands( KConfig * config, KileDocument::LatexCommands * commands )</function>
+</functions>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/src/kile/latexconfigwidget.ui.h b/src/kile/latexconfigwidget.ui.h
new file mode 100644
index 0000000..6fd456d
--- /dev/null
+++ b/src/kile/latexconfigwidget.ui.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you want to add, delete, or rename functions or slots, use
+** Qt Designer to update this file, preserving your code.
+**
+** You should not define a constructor or destructor in this file.
+** Instead, write your code in functions called init() and destroy().
+** These will automatically be called by the form's constructor and
+** destructor.
+*****************************************************************************/
+
+
+void KileWidgetLatexConfig::init()
+{
+ int w = m_tlType->sizeHint().width();
+
+ int wi = m_tlPath->sizeHint().width();
+ if ( wi > w ) w = wi;
+
+ wi = m_pbCommands->sizeHint().width();
+ if ( wi > w ) w = wi;
+
+ w += 8;
+ m_tlType->setFixedWidth(w);
+ m_tlPath->setFixedWidth(w);
+ m_pbCommands->setFixedWidth(w);
+}
+
+
+
+void KileWidgetLatexConfig::slotConfigure()
+{
+ KileDialog::LatexCommandsDialog *dlg = new KileDialog::LatexCommandsDialog(m_config,m_commands,this);
+ dlg->exec();
+ delete dlg;
+}
+
+
+void KileWidgetLatexConfig::setLatexCommands( KConfig *config, KileDocument::LatexCommands *commands )
+{
+ m_config = config;
+ m_commands = commands;
+}
+
+
diff --git a/src/kile/latexoutputfilter.cpp b/src/kile/latexoutputfilter.cpp
new file mode 100644
index 0000000..8bec577
--- /dev/null
+++ b/src/kile/latexoutputfilter.cpp
@@ -0,0 +1,659 @@
+/***************************************************************************
+ begin : Die Sep 16 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : wijnhout@science.uva.nl
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// 2007-03-12 dani
+// - use KileDocument::Extensions
+
+#include "latexoutputfilter.h"
+
+#include <qfile.h>
+#include <qregexp.h>
+#include <qfileinfo.h>
+
+#include "kiledebug.h"
+#include <ktextedit.h>
+#include <klocale.h>
+
+#include "kiletool_enums.h"
+
+using namespace std;
+
+LatexOutputFilter::LatexOutputFilter(LatexOutputInfoArray* LatexOutputInfoArray, KileDocument::Extensions *extensions) :
+ m_nErrors(0),
+ m_nWarnings(0),
+ m_nBadBoxes(0),
+ m_InfoList(LatexOutputInfoArray),
+ m_extensions(extensions)
+{
+}
+
+LatexOutputFilter::~ LatexOutputFilter()
+{
+}
+
+bool LatexOutputFilter::OnPreCreate()
+{
+ m_nErrors = 0;
+ m_nWarnings = 0;
+ m_nBadBoxes = 0;
+
+ return true;
+}
+
+
+bool LatexOutputFilter::fileExists(const QString & name)
+{
+ static QFileInfo::QFileInfo fi;
+
+ if (name[0] == '/' )
+ {
+ fi.setFile(name);
+ if ( fi.exists() && !fi.isDir() ) return true;
+ else return false;
+ }
+
+ fi.setFile(path() + '/' + name);
+ if ( fi.exists() && !fi.isDir() ) return true;
+
+ fi.setFile(path() + '/' + name + m_extensions->latexDocumentDefault() );
+ if ( fi.exists() && !fi.isDir() ) return true;
+
+ // try to determine the LaTeX source file
+ QStringList extlist = QStringList::split(" ", m_extensions->latexDocuments() );
+ for ( QStringList::Iterator it=extlist.begin(); it!=extlist.end(); ++it )
+ {
+ fi.setFile( path() + '/' + name + (*it) );
+ if ( fi.exists() && !fi.isDir() )
+ return true;
+ }
+
+ return false;
+}
+
+// There are basically two ways to detect the current file TeX is processing:
+// 1) Use \Input (i.c.w. srctex.sty or srcltx.sty) and \include exclusively. This will
+// cause (La)TeX to print the line ":<+ filename" in the log file when opening a file,
+// ":<-" when closing a file. Filenames pushed on the stack in this mode are marked
+// as reliable.
+//
+// 2) Since people will probably also use the \input command, we also have to be
+// to detect the old-fashioned way. TeX prints '(filename' when opening a file and a ')'
+// when closing one. It is impossible to detect this with 100% certainty (TeX prints many messages
+// and even text (a context) from the TeX source file, there could be unbalanced parentheses),
+// so we use a heuristic algorithm. In heuristic mode a ')' will only be considered as a signal that
+// TeX is closing a file if the top of the stack is not marked as "reliable".
+// Also, when scanning for a TeX error linenumber (which sometimes causes a context to be printed
+// to the log-file), updateFileStack is not called, helping not to pick up unbalanced parentheses
+// from the context.
+void LatexOutputFilter::updateFileStack(const QString &strLine, short & dwCookie)
+{
+ //KILE_DEBUG() << "==LatexOutputFilter::updateFileStack()================" << endl;
+
+ static QString::QString strPartialFileName;
+
+ switch (dwCookie)
+ {
+ //we're looking for a filename
+ case Start : case FileNameHeuristic :
+ //TeX is opening a file
+ if ( strLine.startsWith(":<+ ") )
+ {
+// KILE_DEBUG() << "filename detected" << endl;
+ //grab the filename, it might be a partial name (i.e. continued on the next line)
+ strPartialFileName = strLine.mid(4).stripWhiteSpace();
+
+ //change the cookie so we remember we aren't sure the filename is complete
+ dwCookie = FileName;
+ }
+ //TeX closed a file
+ else if ( strLine.startsWith(":<-") )
+ {
+// KILE_DEBUG() << "\tpopping : " << m_stackFile.top().file() << endl;
+ m_stackFile.pop();
+ dwCookie = Start;
+ }
+ else
+ //fallback to the heuristic detection of filenames
+ updateFileStackHeuristic(strLine, dwCookie);
+ break;
+
+ case FileName :
+ //The partial filename was followed by '(', this means that TeX is signalling it is
+ //opening the file. We are sure the filename is complete now. Don't call updateFileStackHeuristic
+ //since we don't want the filename on the stack twice.
+ if ( strLine.startsWith("(") || strLine.startsWith("\\openout") )
+ {
+ //push the filename on the stack and mark it as 'reliable'
+ m_stackFile.push(LOFStackItem(strPartialFileName, true));
+// KILE_DEBUG() << "\tpushed : " << strPartialFileName << endl;
+ strPartialFileName = QString::null;
+ dwCookie = Start;
+ }
+ //The partial filename was followed by an TeX error, meaning the file doesn't exist.
+ //Don't push it on the stack, instead try to detect the error.
+ else if ( strLine.startsWith("!") )
+ {
+// KILE_DEBUG() << "oops!" << endl;
+ dwCookie = Start;
+ strPartialFileName = QString::null;
+ detectError(strLine, dwCookie);
+ }
+ else if ( strLine.startsWith("No file") )
+ {
+// KILE_DEBUG() << "No file: " << strLine << endl;
+ dwCookie = Start;
+ strPartialFileName = QString::null;
+ detectWarning(strLine, dwCookie);
+ }
+ //Partial filename still isn't complete.
+ else
+ {
+// KILE_DEBUG() << "\tpartial file name, adding" << endl;
+ strPartialFileName = strPartialFileName + strLine.stripWhiteSpace();
+ }
+ break;
+
+ default : break;
+ }
+}
+
+void LatexOutputFilter::updateFileStackHeuristic(const QString &strLine, short & dwCookie)
+{
+ //KILE_DEBUG() << "==LatexOutputFilter::updateFileStackHeuristic()================" << endl;
+ static QString::QString strPartialFileName;
+ bool expectFileName = (dwCookie == FileNameHeuristic);
+ int index = 0;
+
+ // handle special case (bug fix for 101810)
+ if(expectFileName && strLine[0] == ')') {
+ m_stackFile.push(LOFStackItem(strPartialFileName));
+ expectFileName = false;
+ dwCookie = Start;
+ }
+
+ //scan for parentheses and grab filenames
+ for (unsigned int i = 0; i < strLine.length(); ++i) {
+ //We're expecting a filename. If a filename really ends at this position one of the following must be true:
+ // 1) Next character is a space (indicating the end of a filename (yes, there can't spaces in the
+ // path, this is a TeX limitation).
+ // 2) We're at the end of the line, the filename is probably continued on the next line.
+ // 3) The TeX was closed already, signalled by the ')'.
+
+ if(expectFileName && (i+1 >= strLine.length() || strLine[i+1].isSpace() || strLine[i+1] == ')')) {
+ //update the partial filename
+ strPartialFileName = strPartialFileName + strLine.mid(index, i-index + 1);
+
+ //FIXME: improve these heuristics
+ if (i+1 < strLine.length() && (strLine[i+1].isSpace() || ( (i < 78) && (i+1 == strLine.length())) ||
+ strLine[i+1] == ')' ||
+ fileExists(strPartialFileName))) {
+ m_stackFile.push(LOFStackItem(strPartialFileName));
+ // KILE_DEBUG() << "\tpushed (i = " << i << " length = " << strLine.length() << "): " << strPartialFileName << endl;
+ expectFileName = false;
+ dwCookie = Start;
+ }
+ //Guess the filename is continued on the next line.
+ else if(i+1 >= strLine.length()) {
+ // KILE_DEBUG() << "\tFilename spans more than one line." << endl;
+ dwCookie = FileNameHeuristic;
+ }
+ //bail out
+ else {
+ dwCookie = Start;
+ strPartialFileName = QString::null;
+ expectFileName = false;
+ }
+ }
+ //TeX is opening a file
+ else if(strLine[i] == '(') {
+ //we need to extract the filename
+ expectFileName = true;
+ strPartialFileName = QString::null;
+ dwCookie = Start;
+
+ //this is were the filename is supposed to start
+ index = i + 1;
+ }
+ //TeX is closing a file
+ else if(strLine[i] == ')') {
+ // KILE_DEBUG() << "\tpopping : " << m_stackFile.top().file() << endl;
+ //If this filename was pushed on the stack by the reliable ":<+-" method, don't pop
+ //a ":<-" will follow. This helps in preventing unbalanced ')' from popping filenames
+ //from the stack too soon.
+ if ( ! m_stackFile.top().reliable() )
+ m_stackFile.pop();
+ else
+ KILE_DEBUG() << "\t\toh no, forget about it!" << endl;
+ }
+ }
+}
+
+
+void LatexOutputFilter::flushCurrentItem()
+{
+ //KILE_DEBUG() << "==LatexOutputFilter::flushCurrentItem()================" << endl;
+ int nItemType = m_currentItem.type();
+
+ while ( (! fileExists(m_stackFile.top().file()) ) && (m_stackFile.count() > 1) )
+ m_stackFile.pop();
+
+ m_currentItem.setSource(m_stackFile.top().file());
+
+ switch (nItemType)
+ {
+ case itmError:
+ ++m_nErrors;
+ m_InfoList->push_back(m_currentItem);
+ //KILE_DEBUG() << "Flushing Error in" << m_currentItem.source() << "@" << m_currentItem.sourceLine() << " reported in line " << m_currentItem.outputLine() << endl;
+ break;
+
+ case itmWarning:
+ ++m_nWarnings;
+ m_InfoList->push_back(m_currentItem);
+ //KILE_DEBUG() << "Flushing Warning in " << m_currentItem.source() << "@" << m_currentItem.sourceLine() << " reported in line " << m_currentItem.outputLine() << endl;
+ break;
+
+ case itmBadBox:
+ ++m_nBadBoxes;
+ m_InfoList->push_back(m_currentItem);
+ //KILE_DEBUG() << "Flushing BadBox in " << m_currentItem.source() << "@" << m_currentItem.sourceLine() << " reported in line " << m_currentItem.outputLine() << endl;
+ break;
+
+ default: break;
+ }
+ m_currentItem.Clear();
+}
+
+bool LatexOutputFilter::detectError(const QString & strLine, short &dwCookie)
+{
+ //KILE_DEBUG() << "==LatexOutputFilter::detectError(" << strLine.length() << ")================" << endl;
+
+ bool found = false, flush = false;
+
+ static QRegExp::QRegExp reLaTeXError("^! LaTeX Error: (.*)$", false);
+ static QRegExp::QRegExp rePDFLaTeXError("^Error: pdflatex (.*)$", false);
+ static QRegExp::QRegExp reTeXError("^! (.*)");
+ static QRegExp::QRegExp reLineNumber("^l\\.([0-9]+)(.*)");
+
+ switch (dwCookie)
+ {
+ case Start :
+ if (reLaTeXError.search(strLine) != -1)
+ {
+ //KILE_DEBUG() << "\tError : " << reLaTeXError.cap(1) << endl;
+ m_currentItem.setMessage(reLaTeXError.cap(1));
+ found = true;
+ }
+ else if (rePDFLaTeXError.search(strLine) != -1)
+ {
+ //KILE_DEBUG() << "\tError : " << rePDFLaTeXError.cap(1) << endl;
+ m_currentItem.setMessage(rePDFLaTeXError.cap(1));
+ found = true;
+ }
+ else if (reTeXError.search(strLine) != -1 )
+ {
+ //KILE_DEBUG() << "\tError : " << reTeXError.cap(1) << endl;
+ m_currentItem.setMessage(reTeXError.cap(1));
+ found = true;
+ }
+ if (found)
+ {
+ dwCookie = strLine.endsWith(".") ? LineNumber : Error;
+ m_currentItem.setOutputLine(GetCurrentOutputLine());
+ }
+ break;
+
+ case Error :
+ //KILE_DEBUG() << "\tError (cont'd): " << strLine << endl;
+ if ( strLine.endsWith(".") )
+ {
+ dwCookie = LineNumber;
+ m_currentItem.setMessage(m_currentItem.message() + strLine);
+ }
+ else if ( GetCurrentOutputLine() - m_currentItem.outputLine() > 3 )
+ {
+ kdWarning() << "\tBAILING OUT: error description spans more than three lines" << endl;
+ dwCookie = Start;
+ flush = true;
+ }
+ break;
+
+ case LineNumber :
+ //KILE_DEBUG() << "\tLineNumber " << endl;
+ if ( reLineNumber.search(strLine) != -1 )
+ {
+ dwCookie = Start;
+ flush = true;
+ //KILE_DEBUG() << "\tline number: " << reLineNumber.cap(1) << endl;
+ m_currentItem.setSourceLine(reLineNumber.cap(1).toInt());
+ m_currentItem.setMessage(m_currentItem.message() + reLineNumber.cap(2));
+ }
+ else if ( GetCurrentOutputLine() - m_currentItem.outputLine() > 10 )
+ {
+ dwCookie = Start;
+ flush = true;
+ kdWarning() << "\tBAILING OUT: did not detect a TeX line number for an error" << endl;
+ m_currentItem.setSourceLine(0);
+ }
+ break;
+
+ default : break;
+ }
+
+ if (found)
+ {
+ m_currentItem.setType(itmError);
+ m_currentItem.setOutputLine(GetCurrentOutputLine());
+ }
+
+ if (flush) flushCurrentItem();
+
+ return found;
+}
+
+bool LatexOutputFilter::detectWarning(const QString & strLine, short &dwCookie)
+{
+ //KILE_DEBUG() << "==LatexOutputFilter::detectWarning(" << strLine.length() << ")================" << endl;
+
+ bool found = false, flush = false;
+ QString warning;
+
+ static QRegExp::QRegExp reLaTeXWarning("^(((! )?(La|pdf)TeX)|Package) .*Warning.*:(.*)", false);
+ static QRegExp::QRegExp reNoFile("No file (.*)");
+ static QRegExp::QRegExp reNoAsyFile("File .* does not exist."); // FIXME can be removed when http://sourceforge.net/tracker/index.php?func=detail&aid=1772022&group_id=120000&atid=685683 has promoted to the users
+
+ switch (dwCookie)
+ {
+ //detect the beginning of a warning
+ case Start :
+ if ( reLaTeXWarning.search(strLine) != -1 )
+ {
+ warning = reLaTeXWarning.cap(5);
+ //KILE_DEBUG() << "\tWarning found: " << warning << endl;
+
+ found = true;
+ dwCookie = Start;
+
+ m_currentItem.setMessage(warning);
+ m_currentItem.setOutputLine(GetCurrentOutputLine());
+
+ //do we expect a line number?
+ flush = detectLaTeXLineNumber(warning, dwCookie, strLine.length());
+ }
+ else if ( reNoFile.search(strLine) != -1 )
+ {
+ found = true;
+ flush = true;
+ m_currentItem.setSourceLine(0);
+ m_currentItem.setMessage(reNoFile.cap(0));
+ m_currentItem.setOutputLine(GetCurrentOutputLine());
+ }
+ else if ( reNoAsyFile.search(strLine) != -1 )
+ {
+ found = true;
+ flush = true;
+ m_currentItem.setSourceLine(0);
+ m_currentItem.setMessage(reNoAsyFile.cap(0));
+ m_currentItem.setOutputLine(GetCurrentOutputLine());
+ }
+
+ break;
+
+ //warning spans multiple lines, detect the end
+ case Warning :
+ warning = m_currentItem.message() + strLine;
+ //KILE_DEBUG() << "'\tWarning (cont'd) : " << warning << endl;
+ flush = detectLaTeXLineNumber(warning, dwCookie, strLine.length());
+ m_currentItem.setMessage(warning);
+ break;
+
+ default : break;
+ }
+
+ if ( found )
+ {
+ m_currentItem.setType(itmWarning);
+ m_currentItem.setOutputLine(GetCurrentOutputLine());
+ }
+
+ if (flush) flushCurrentItem();
+
+ return found;
+}
+
+bool LatexOutputFilter::detectLaTeXLineNumber(QString & warning, short & dwCookie, int len)
+{
+ //KILE_DEBUG() << "==LatexOutputFilter::detectLaTeXLineNumber(" << warning.length() << ")================" << endl;
+
+ static QRegExp::QRegExp reLaTeXLineNumber("(.*) on input line ([0-9]+)\\.$", false);
+ static QRegExp::QRegExp reInternationalLaTeXLineNumber("(.*)([0-9]+)\\.$", false);
+ if ( (reLaTeXLineNumber.search(warning) != -1) || (reInternationalLaTeXLineNumber.search(warning) != -1) )
+ {
+ //KILE_DEBUG() << "een" << endl;
+ m_currentItem.setSourceLine(reLaTeXLineNumber.cap(2).toInt());
+ warning += reLaTeXLineNumber.cap(1);
+ dwCookie = Start;
+ return true;
+ }
+ else if ( warning.endsWith(".") )
+ {
+ //KILE_DEBUG() << "twee" << endl;
+ m_currentItem.setSourceLine(0);
+ dwCookie = Start;
+ return true;
+ }
+ //bailing out, did not find a line number
+ else if ( (GetCurrentOutputLine() - m_currentItem.outputLine() > 4) || (len == 0) )
+ {
+ //KILE_DEBUG() << "drie current " << GetCurrentOutputLine() << " " << m_currentItem.outputLine() << " len " << len << endl;
+ m_currentItem.setSourceLine(0);
+ dwCookie = Start;
+ return true;
+ }
+ //error message is continued on the other line
+ else
+ {
+ //KILE_DEBUG() << "vier" << endl;
+ dwCookie = Warning;
+ return false;
+ }
+}
+
+bool LatexOutputFilter::detectBadBox(const QString & strLine, short & dwCookie)
+{
+ //KILE_DEBUG() << "==LatexOutputFilter::detectBadBox(" << strLine.length() << ")================" << endl;
+
+ bool found = false, flush = false;
+ QString badbox;
+
+ static QRegExp::QRegExp reBadBox("^(Over|Under)(full \\\\[hv]box .*)", false);
+
+ switch (dwCookie)
+ {
+ case Start :
+ if ( reBadBox.search(strLine) != -1)
+ {
+ found = true;
+ dwCookie = Start;
+ badbox = strLine;
+ flush = detectBadBoxLineNumber(badbox, dwCookie, strLine.length());
+ m_currentItem.setMessage(badbox);
+ }
+ break;
+
+ case BadBox :
+ badbox = m_currentItem.message() + strLine;
+ flush = detectBadBoxLineNumber(badbox, dwCookie, strLine.length());
+ m_currentItem.setMessage(badbox);
+ break;
+
+ default : break;
+ }
+
+ if ( found )
+ {
+ m_currentItem.setType(itmBadBox);
+ m_currentItem.setOutputLine(GetCurrentOutputLine());
+ }
+
+ if (flush) flushCurrentItem();
+
+ return found;
+}
+
+bool LatexOutputFilter::detectBadBoxLineNumber(QString & strLine, short & dwCookie, int len)
+{
+ //KILE_DEBUG() << "==LatexOutputFilter::detectBadBoxLineNumber(" << strLine.length() << ")================" << endl;
+
+ static QRegExp::QRegExp reBadBoxLines("(.*) at lines ([0-9]+)--([0-9]+)", false);
+ static QRegExp::QRegExp reBadBoxLine("(.*) at line ([0-9]+)", false);
+ //Use the following only, if you know how to get the source line for it.
+ // This is not simple, as TeX is not reporting it.
+ static QRegExp::QRegExp reBadBoxOutput("(.*)has occurred while \\output is active^", false);
+
+ if ( reBadBoxLines.search(strLine) != -1)
+ {
+ dwCookie = Start;
+ strLine = reBadBoxLines.cap(1);
+ int n1 = reBadBoxLines.cap(2).toInt();
+ int n2 = reBadBoxLines.cap(3).toInt();
+ m_currentItem.setSourceLine(n1 < n2 ? n1 : n2);
+ return true;
+ }
+ else if ( reBadBoxLine.search(strLine) != -1)
+ {
+ dwCookie = Start;
+ strLine = reBadBoxLine.cap(1);
+ m_currentItem.setSourceLine(reBadBoxLine.cap(2).toInt());
+ //KILE_DEBUG() << "\tBadBox@" << reBadBoxLine.cap(2) << "." << endl;
+ return true;
+ }
+ else if ( reBadBoxOutput.search(strLine) != -1)
+ {
+ dwCookie = Start;
+ strLine = reBadBoxLines.cap(1);
+ m_currentItem.setSourceLine(0);
+ return true;
+ }
+ //bailing out, did not find a line number
+ else if ( (GetCurrentOutputLine() - m_currentItem.outputLine() > 3) || (len == 0) )
+ {
+ dwCookie = Start;
+ m_currentItem.setSourceLine(0);
+ return true;
+ }
+ else
+ {
+ dwCookie = BadBox;
+ }
+
+ return false;
+}
+
+short LatexOutputFilter::parseLine(const QString & strLine, short dwCookie)
+{
+ //KILE_DEBUG() << "==LatexOutputFilter::parseLine(" << strLine.length() << ")================" << endl;
+
+ switch (dwCookie)
+ {
+ case Start :
+ if ( ! (detectBadBox(strLine, dwCookie) || detectWarning(strLine, dwCookie) || detectError(strLine, dwCookie)) )
+ updateFileStack(strLine, dwCookie);
+ break;
+
+ case Warning :
+ detectWarning(strLine, dwCookie);
+ break;
+
+ case Error : case LineNumber :
+ detectError(strLine, dwCookie);
+ break;
+
+ case BadBox :
+ detectBadBox(strLine, dwCookie);
+ break;
+
+ case FileName : case FileNameHeuristic :
+ updateFileStack(strLine, dwCookie);
+ break;
+
+ default: dwCookie = Start; break;
+ }
+
+ return dwCookie;
+}
+
+// split old Run() into three parts
+// - Run() : parse the logfile
+// - updateInfoLists() : needed by QuickPreview
+// - sendProblems() : emit signals
+//
+// dani 18.02.2005
+
+bool LatexOutputFilter::Run(const QString & logfile)
+{
+ m_InfoList->clear();
+ m_nErrors = m_nWarnings = m_nBadBoxes = m_nParens = 0;
+ m_stackFile.clear();
+ m_stackFile.push(LOFStackItem(QFileInfo(source()).fileName(), true));
+
+ return OutputFilter::Run(logfile);
+}
+
+void LatexOutputFilter::updateInfoLists(const QString &texfilename, int selrow, int docrow)
+{
+ // get a short name for the original tex file
+ QString filename = "./" + QFileInfo(texfilename).fileName();
+ setSource(texfilename);
+
+ //print detailed error info
+ for(unsigned int i=0; i < m_InfoList->count(); ++i) {
+ // perhaps correct filename and line number in OutputInfo
+ OutputInfo *info = &(*m_InfoList)[i];
+ info->setSource(filename);
+
+ int linenumber = selrow + info->sourceLine() - docrow;
+ if ( linenumber < 0 )
+ linenumber = 0;
+ info->setSourceLine(linenumber);
+ }
+}
+
+void LatexOutputFilter::sendProblems()
+{
+ QString Message;
+ int type;
+
+ //print detailed error info
+ for(unsigned int i=0; i < m_InfoList->count(); ++i) {
+ Message = QString("%1:%2:%3").arg((*m_InfoList)[i].source()).arg((*m_InfoList)[i].sourceLine()).arg((*m_InfoList)[i].message());
+ switch ( (*m_InfoList)[i].type() )
+ {
+ case LatexOutputInfo::itmBadBox : type = KileTool::ProblemBadBox; break;
+ case LatexOutputInfo::itmError : type = KileTool::ProblemError; break;
+ case LatexOutputInfo::itmWarning : type = KileTool::ProblemWarning; break;
+ default : type = KileTool::Info; break;
+ }
+ emit(problem(type, Message));
+ }
+}
+
+/** Return number of errors etc. found in log-file. */
+void LatexOutputFilter::getErrorCount(int *errors, int *warnings, int *badboxes)
+{
+ *errors = m_nErrors;
+ *warnings = m_nWarnings;
+ *badboxes = m_nBadBoxes;
+}
diff --git a/src/kile/latexoutputfilter.h b/src/kile/latexoutputfilter.h
new file mode 100644
index 0000000..dd0097c
--- /dev/null
+++ b/src/kile/latexoutputfilter.h
@@ -0,0 +1,139 @@
+/***************************************************************************
+ begin : Die Sep 16 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : wijnhout@science.uva.nl
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef LATEXOUTPUTFILTER_H
+#define LATEXOUTPUTFILTER_H
+
+#include <qvaluestack.h>
+#include <qstring.h>
+
+#include "outputfilter.h"
+#include "latexoutputinfo.h"
+#include "kileextensions.h"
+
+/**An object of this class is used to parse the output messages
+generated by a TeX/LaTeX-compiler.
+
+@author Thorsten Lck
+ *@author Jeroen Wijnhout
+ */
+
+class KTextEdit;
+
+class LOFStackItem
+{
+public:
+ LOFStackItem(const QString & file = QString::null, bool sure = false) : m_file(file), m_reliable(sure) {}
+
+ const QString & file() const { return m_file; }
+ void setFile(const QString & file) { m_file = file; }
+
+ bool reliable() const { return m_reliable; }
+ void setReliable(bool sure) { m_reliable = sure; }
+
+private:
+ QString m_file;
+ bool m_reliable;
+};
+
+class LatexOutputFilter : public OutputFilter
+{
+ public:
+ LatexOutputFilter(LatexOutputInfoArray* LatexOutputInfoArray, KileDocument::Extensions *extensions);
+ ~LatexOutputFilter();
+
+ virtual bool Run(const QString & logfile);
+ void sendProblems();
+ void updateInfoLists(const QString &texfilename, int selrow, int docrow);
+
+ enum {Start = 0, FileName, FileNameHeuristic, Error, Warning, BadBox, LineNumber};
+
+ protected:
+ /**
+ Parses the given line for the start of new files or the end of
+ old files.
+ */
+ void updateFileStack(const QString &strLine, short & dwCookie);
+ void updateFileStackHeuristic(const QString &strLine, short & dwCookie);
+
+ /**
+ Forwards the currently parsed item to the item list.
+ */
+ void flushCurrentItem();
+
+ // overridings
+ public:
+ /** Return number of errors etc. found in log-file. */
+ void getErrorCount(int *errors, int *warnings, int *badboxes);
+ void clearErrorCount() { m_nErrors=m_nWarnings=m_nBadBoxes=0 ; }
+
+ protected:
+ virtual bool OnPreCreate();
+ virtual short parseLine(const QString & strLine, short dwCookie);
+
+ bool detectError(const QString & strLine, short &dwCookie);
+ bool detectWarning(const QString & strLine, short &dwCookie);
+ bool detectBadBox(const QString & strLine, short &dwCookie);
+ bool detectLaTeXLineNumber(QString & warning, short & dwCookie, int len);
+ bool detectBadBoxLineNumber(QString & strLine, short & dwCookie, int len);
+
+ bool fileExists(const QString & name);
+
+ private:
+
+ // types
+ protected:
+ /**
+ These constants are describing, which item types is currently
+ parsed.
+ */
+ enum tagCookies
+ {
+ itmNone = 0,
+ itmError,
+ itmWarning,
+ itmBadBox
+ };
+
+ // attributes
+ public:
+ /** number or errors detected */
+ int m_nErrors;
+
+ /** number of warning detected */
+ int m_nWarnings;
+
+ /** number of bad boxes detected */
+ int m_nBadBoxes;
+
+ int m_nParens;
+ private:
+ /**
+ Stack containing the files parsed by the compiler. The top-most
+ element is the currently parsed file.
+ */
+ QValueStack<LOFStackItem> m_stackFile;
+
+ /** The item currently parsed. */
+ LatexOutputInfo m_currentItem;
+
+ public: // Public attributes
+ /** Pointer to list of Latex output information */
+ LatexOutputInfoArray *m_InfoList;
+
+private:
+ KileDocument::Extensions *m_extensions;
+};
+#endif
diff --git a/src/kile/latexoutputinfo.cpp b/src/kile/latexoutputinfo.cpp
new file mode 100644
index 0000000..a32e2d1
--- /dev/null
+++ b/src/kile/latexoutputinfo.cpp
@@ -0,0 +1,43 @@
+/***************************************************************************
+ begin : Don Sep 18 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : wijnhout@science.uva.nl
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "latexoutputinfo.h"
+
+LatexOutputInfo::LatexOutputInfo()
+{
+}
+
+
+LatexOutputInfo::LatexOutputInfo(const QString & strSrcFile, int nSrcLine, int nOutputLine,
+const QString & strError, int nErrorID)
+{
+ setSource(strSrcFile);
+ setSourceLine(nSrcLine);
+ setOutputLine(nOutputLine);
+ setMessage(strError);
+ setType(nErrorID);
+}
+
+
+/** No descriptions */
+LatexOutputInfo LatexOutputInfo::operator=(const LatexOutputInfo &a)
+{
+ setSource(a.source());
+ setSourceLine(a.sourceLine());
+ setOutputLine(a.outputLine());
+ setMessage(a.message());
+ setType(a.type());
+ return *this;
+}
diff --git a/src/kile/latexoutputinfo.h b/src/kile/latexoutputinfo.h
new file mode 100644
index 0000000..bf65a56
--- /dev/null
+++ b/src/kile/latexoutputinfo.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ begin : Don Sep 18 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : wijnhout@science.uva.nl
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef LATEXOUTPUTINFO_H
+#define LATEXOUTPUTINFO_H
+
+#include "outputinfo.h"
+
+/**A class to keep output info from LaTeX.
+ *@author Thorsten Lck
+ */
+
+class LatexOutputInfo : public OutputInfo
+{
+ public:
+ LatexOutputInfo();
+ LatexOutputInfo(const QString & strSrcFile, int nSrcLine, int nOutputLine, const QString & strError="", int nErrorID=-1);
+ /** No descriptions */
+ LatexOutputInfo operator=(const LatexOutputInfo &a) ;
+
+ public:
+ /**
+ These constants are describing, which item types is currently
+ parsed. (to be set as error code)
+ */
+ enum tagCookies
+ {
+ itmNone = 0,
+ itmError,
+ itmWarning,
+ itmBadBox
+ };
+};
+
+/**Array of OutputInfo
+
+@author Thorsten Lck
+*/
+typedef QValueList<LatexOutputInfo> LatexOutputInfoArray;
+#endif
diff --git a/src/kile/latextoolconfigwidget.ui b/src/kile/latextoolconfigwidget.ui
new file mode 100644
index 0000000..60ee6ad
--- /dev/null
+++ b/src/kile/latextoolconfigwidget.ui
@@ -0,0 +1,57 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>LaTeXToolConfigWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>LaTeXToolConfigWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>603</width>
+ <height>86</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_ckRootDoc</cstring>
+ </property>
+ <property name="text">
+ <string>Check if &amp;root document is a LaTeX root before running LaTeX on it</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_ckJump</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Jump to first error in case running LaTeX failed</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_ckAutoRun</cstring>
+ </property>
+ <property name="text">
+ <string>Automatically run Asymptote, BibTeX, MakeIndex and rerun LaTeX &amp;when necessary</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/kile/librarytoolconfigwidget.ui b/src/kile/librarytoolconfigwidget.ui
new file mode 100644
index 0000000..e7a84d9
--- /dev/null
+++ b/src/kile/librarytoolconfigwidget.ui
@@ -0,0 +1,104 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>LibraryToolConfigWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>LibraryToolConfigWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>382</width>
+ <height>115</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_lbOptions</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Options:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_leOptions</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>m_leLibrary</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>m_leLibClass</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>m_leOptions</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>m_lbLibClass</cstring>
+ </property>
+ <property name="text">
+ <string>Library c&amp;lass:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_leLibClass</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_lbLibrary</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Library:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_leLibrary</cstring>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>spacer16</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/kile/main.cpp b/src/kile/main.cpp
new file mode 100644
index 0000000..b73325c
--- /dev/null
+++ b/src/kile/main.cpp
@@ -0,0 +1,157 @@
+/***************************************************************************
+ begin : sam jui 13 09:50:06 CEST 2002
+ copyright : (C) 2002 - 2003 by Pascal Brachet, 2003-2005 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qdir.h>
+#include <qfile.h>
+
+#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+#include <kstartupinfo.h>
+#include <dcopclient.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kinstance.h>
+#include <kurl.h>
+#include "kiledebug.h"
+
+#include "kileapplication.h"
+#include "kile.h"
+#include "kileversion.h"
+#include "kiledebug.h"
+
+
+static KCmdLineOptions options[] =
+{
+ { "line <line>", I18N_NOOP( "Jump to line" ), "0" },
+ { "new", I18N_NOOP( "Start a new Kile mainwindow" ), 0 },
+ { "+[file]", I18N_NOOP( "File to open" ), 0 },
+ KCmdLineLastOption
+};
+
+bool isProject(const QString &path)
+{
+ return path.right(7) == ".kilepr";
+}
+
+/**
+ * Complete a relative paths to absolute ones.
+ * Also accepts URLs of the form file:relativepath.
+ **/
+QString completePath(const QString &path)
+{
+ QString fullpath(path);
+
+ KILE_DEBUG() << "==complete path is " << path << endl;
+ if ( path.left(1) != "/" )
+ {
+ if ( path.left(5) == "file:" )
+ {
+ KURL url = KURL::fromPathOrURL(path);
+ url.setFileName(completePath(url.path()));
+ fullpath = url.url();
+ }
+ else if ( path.find(QRegExp("^[a-z]+:")) == -1 )
+ fullpath = QDir::currentDirPath() + '/' + path;
+ }
+
+ KILE_DEBUG() << "\t" << fullpath << endl;
+ return fullpath;
+}
+
+int main( int argc, char ** argv )
+{
+ KAboutData aboutData( "kile", "Kile", kileFullVersion.ascii(), I18N_NOOP("KDE Integrated LaTeX Environment"), KAboutData::License_GPL,
+ I18N_NOOP("by the Kile Team (2003 - 2008)"),
+ 0,
+ "http://kile.sourceforge.net");
+ aboutData.addAuthor("Michel Ludwig", I18N_NOOP("project management/developer (scripting & bug fixes)"), "michel.ludwig@kdemail.net");
+ aboutData.addAuthor("Holger Danielsson", I18N_NOOP("former developer"), "holger.danielsson@versanet.de");
+ aboutData.addAuthor("Jeroen Wijnhout",I18N_NOOP("former maintainer/developer"),"Jeroen.Wijnhout@kdemail.net");
+ aboutData.addAuthor("Brachet Pascal",0,"");
+
+ aboutData.addCredit("Thomas Braun", I18N_NOOP("Lots of bug fixes!"));
+ aboutData.addCredit("Simon Martin", I18N_NOOP("KConfig XT, various improvements and bugfixing"));
+ aboutData.addCredit("Roland Schulz", I18N_NOOP("KatePart integration"));
+ aboutData.addCredit("Thorsten Lück", I18N_NOOP("Log Parsing"));
+ aboutData.addCredit("Jan-Marek Glogowski", I18N_NOOP("Find in Files dialog"));
+ aboutData.addCredit("Thomas Basset", I18N_NOOP("Translations"));
+ aboutData.addCredit(I18N_NOOP("Please consult the webpage for up to date translation credits."));
+ aboutData.addCredit("Jonathan Pechta and Federico Zenith", I18N_NOOP("Documentation"));
+
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KCmdLineArgs::addCmdLineOptions( options );
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+ bool running = false;
+
+ DCOPClient *client=0L;
+ QCString appID = "";
+ client = new DCOPClient ();
+ client->attach();
+ QCStringList apps = client->registeredApplications();
+
+ for ( QCStringList::Iterator it = apps.begin(); it != apps.end(); ++it )
+ {
+ if ((*it).contains ("kile") > 0)
+ {
+ appID = (*it);
+ running = true;
+ break;
+ }
+ }
+
+ if ( !running || args->isSet("new") )
+ {
+ KileApplication a;
+ a.dcopClient()->registerAs("kile", false);
+ bool restore = (args->count() == 0);
+ Kile * mw = new Kile(restore);
+ a.setMainWidget(mw);
+
+ for ( int i = 0; i < args->count(); ++i)
+ {
+ if ( isProject(args->arg(i)) )
+ mw->openProject(completePath(QFile::decodeName(args->arg(i))));
+ else
+ mw->openDocument(completePath(QFile::decodeName(args->arg(i))));
+ }
+
+ QString line = args->getOption("line");
+ if (line != "0") mw->setLine(line);
+
+ args->clear();
+ return a.exec();
+ }
+ else
+ {
+ for ( int i = 0; i < args->count(); ++i )
+ {
+ if ( isProject(args->arg(i)) )
+ client->send (appID, "Kile", "openProject(QString)", completePath(QFile::decodeName(args->arg(i))));
+ else
+ client->send (appID, "Kile", "openDocument(QString)", completePath(QFile::decodeName(args->arg(i))));
+ }
+
+ QString line = args->getOption("line");
+ if (line != "0") client->send (appID, "Kile", "setLine(QString)", line);
+
+ KStartupInfo::appStarted();
+ QByteArray empty;
+ client->send (appID, "Kile", "setActive()", empty);
+ }
+
+ return 0;
+}
+
diff --git a/src/kile/managetemplatesdialog.cpp b/src/kile/managetemplatesdialog.cpp
new file mode 100644
index 0000000..c6b4502
--- /dev/null
+++ b/src/kile/managetemplatesdialog.cpp
@@ -0,0 +1,283 @@
+/*****************************************************************************************
+ begin : Sun Apr 27 2003
+ copyright : (C) 2003 by Jeroen Wijnhout (wijnhout@science.uva.nl)
+ 2007 by Michel Ludwig (michel.ludwig@kdemail.net)
+ *****************************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "managetemplatesdialog.h"
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qtooltip.h>
+
+#include <kapp.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include <kiconloader.h>
+#include <kpushbutton.h>
+#include <kicondialog.h>
+#include <kmessagebox.h>
+#include "kiledebug.h"
+#include <kio/netaccess.h>
+
+#include "kileextensions.h"
+#include "kileinfo.h"
+#include "templates.h"
+
+class TemplateListViewItem : public QListViewItem {
+ public:
+ TemplateListViewItem(QListView* listView, QListViewItem* previousItem, const QString& mode, const KileTemplate::Info& info) : QListViewItem(listView, previousItem, mode, info.name, KileInfo::documentTypeToString(info.type)), m_info(info) {
+ }
+
+ virtual ~TemplateListViewItem() {
+ }
+
+ KileTemplate::Info getTemplateInfo() {
+ return m_info;
+ }
+
+ protected:
+ KileTemplate::Info m_info;
+};
+
+// dialog to create a template
+ManageTemplatesDialog::ManageTemplatesDialog(KileTemplate::Manager *templateManager, const KURL& sourceURL, const QString &caption, QWidget *parent, const char *name ) : KDialogBase(parent,name,true,caption,KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true), m_templateManager(templateManager), m_sourceURL(sourceURL) {
+
+ m_templateType = KileDocument::Extensions().determineDocumentType(sourceURL);
+
+ QWidget *page = new QWidget(this , "managetemplates_mainwidget");
+ setMainWidget(page);
+ QVBoxLayout *topLayout = new QVBoxLayout(page, 0, spacingHint());
+
+ QHBoxLayout *nameLayout = new QHBoxLayout(topLayout, spacingHint());
+ nameLayout->addWidget(new QLabel(i18n("Name:"),page));
+
+ QString fileName = m_sourceURL.fileName();
+ //remove the extension
+ int dotPos = fileName.findRev('.');
+ if(dotPos >= 0) {
+ fileName = fileName.mid(0, dotPos);
+ }
+ m_nameEdit = new KLineEdit(fileName, page);
+ nameLayout->addWidget(m_nameEdit);
+
+ nameLayout->addWidget(new QLabel(i18n("Type: %1").arg(KileInfo::documentTypeToString(m_templateType)), page));
+
+ QHBoxLayout *iconLayout = new QHBoxLayout(topLayout, spacingHint());
+ iconLayout->addWidget(new QLabel(i18n("Icon:"), page));
+
+ m_iconEdit = new KLineEdit(KGlobal::dirs()->findResource("appdata", "pics/type_Default.png"), page);
+ iconLayout->addWidget(m_iconEdit);
+
+ KPushButton *iconbut = new KPushButton(i18n("Select..."),page);
+ iconLayout->addWidget(iconbut);
+
+ m_templateList = new KListView(page);
+ m_templateList->setSorting(-1);
+ m_templateList->addColumn(i18n("marked", "M"));
+ m_templateList->addColumn(i18n("Existing Templates"));
+ m_templateList->addColumn(i18n("Document Type"));
+ m_templateList->setColumnWidthMode(0, QListView::Manual);
+ m_templateList->setFullWidth(true);
+ m_templateList->setAllColumnsShowFocus(true);
+
+ populateTemplateListView(m_templateType);
+
+ topLayout->addWidget(m_templateList);
+
+ QHBoxLayout *controlLayout = new QHBoxLayout(topLayout, spacingHint());
+ m_showAllTypesCheckBox = new QCheckBox(i18n("Show all the templates"), page);
+ m_showAllTypesCheckBox->setChecked(false);
+ connect(m_showAllTypesCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateTemplateListView(bool)));
+ controlLayout->addWidget(m_showAllTypesCheckBox);
+
+ controlLayout->addStretch();
+
+ KPushButton *clearSelectionButton = new KPushButton(page);
+ clearSelectionButton->setPixmap(SmallIcon("clear_left.png"));
+ QToolTip::add(clearSelectionButton, i18n("Clear Selection"));
+ connect(clearSelectionButton, SIGNAL(clicked()),this, SLOT(clearSelection()));
+ controlLayout->addWidget(clearSelectionButton);
+
+ topLayout->addWidget( new QLabel(i18n("Select an existing template if you want to overwrite it with your new template.\nNote that you cannot overwrite templates marked with an asterisk:\nif you do select such a template, a new template with the same name\nwill be created in a location you have write access to."),page));
+
+ connect(m_templateList, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelectedTemplate(QListViewItem*)));
+ connect(iconbut, SIGNAL(clicked()),this, SLOT(slotSelectIcon()));
+ connect(this, SIGNAL(aboutToClose()), this, SLOT(addTemplate()));
+}
+
+// dialog to remove a template
+ManageTemplatesDialog::ManageTemplatesDialog(KileTemplate::Manager *templateManager, const QString &caption, QWidget *parent, const char *name ) : KDialogBase(parent,name,true,caption,KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true), m_templateManager(templateManager), m_templateType(KileDocument::Undefined), m_showAllTypesCheckBox(NULL)
+{
+ QWidget *page = new QWidget(this, "managetemplates_mainwidget");
+ setMainWidget(page);
+ QVBoxLayout *topLayout = new QVBoxLayout(page, 0, spacingHint());
+
+ m_templateList = new KListView(page);
+ m_templateList->setSorting(-1);
+ m_templateList->addColumn(i18n("marked", "M"));
+ m_templateList->addColumn(i18n("Existing Templates"));
+ m_templateList->addColumn(i18n("Document Type"));
+ m_templateList->setColumnWidthMode(0, QListView::Manual);
+ m_templateList->setFullWidth(true);
+ m_templateList->setAllColumnsShowFocus(true);
+
+ populateTemplateListView(KileDocument::Undefined);
+
+ topLayout->addWidget(m_templateList);
+ topLayout->addWidget( new QLabel(i18n("Please select the template that you want to remove.\nNote that you cannot delete templates marked with an asterisk (for which you lack the necessary deletion permissions)."),page));
+
+ connect(this, SIGNAL(aboutToClose()), this, SLOT(removeTemplate()));
+}
+
+ManageTemplatesDialog::~ManageTemplatesDialog(){
+}
+
+void ManageTemplatesDialog::updateTemplateListView(bool showAllTypes) {
+ populateTemplateListView((showAllTypes ? KileDocument::Undefined : m_templateType));
+}
+
+void ManageTemplatesDialog::clearSelection() {
+ m_templateList->clearSelection();
+}
+
+void ManageTemplatesDialog::slotOk() {
+ emit aboutToClose();
+}
+
+void ManageTemplatesDialog::populateTemplateListView(KileDocument::Type type) {
+ m_templateManager->scanForTemplates();
+ KileTemplate::TemplateList templateList = m_templateManager->getTemplates(type);
+ QString mode;
+ QListViewItem* previousItem = NULL;
+
+ m_templateList->clear();
+ for (KileTemplate::TemplateListIterator i = templateList.begin(); i != templateList.end(); ++i)
+ {
+ KileTemplate::Info info = *i;
+ QFileInfo iconFileInfo(info.icon);
+ mode = (QFileInfo(info.path).isWritable() && (!iconFileInfo.exists() || iconFileInfo.isWritable())) ? " " : "*";
+ if((type == KileDocument::Undefined) || (info.type == type)) {
+ previousItem = new TemplateListViewItem(m_templateList, previousItem, mode, info);
+ }
+ }
+}
+
+void ManageTemplatesDialog::slotSelectedTemplate(QListViewItem *item) {
+ TemplateListViewItem *templateItem = dynamic_cast<TemplateListViewItem*>(item);
+ if(templateItem) {
+ KileTemplate::Info info = templateItem->getTemplateInfo();
+ m_nameEdit->setText(info.name);
+ m_iconEdit->setText(info.icon);
+ }
+}
+
+void ManageTemplatesDialog::slotSelectIcon() {
+ KIconDialog *dlg = new KIconDialog();
+ QString res = dlg->openDialog();
+ KIconLoader kil;
+
+ if (!res.isNull() ) {
+ m_iconEdit->setText(kil.iconPath(res,-KIcon::SizeLarge, false));
+ }
+}
+
+void ManageTemplatesDialog::addTemplate() {
+
+ QString templateName = (m_nameEdit->text()).stripWhiteSpace();
+
+ if(templateName.isEmpty()) {
+ KMessageBox::error(this, i18n("Sorry, but the template name that you have entered is invalid.\nPlease enter a new name."));
+ return;
+ }
+
+ QString icon = (m_iconEdit->text()).stripWhiteSpace();
+ KURL iconURL = KURL::fromPathOrURL(icon);
+
+ if (icon.isEmpty()) {
+ KMessageBox::error(this, i18n("Please choose an icon first."));
+ return;
+ }
+
+ if (!KIO::NetAccess::exists(iconURL, true, kapp->mainWidget())) {
+ KMessageBox::error(this, i18n("Sorry, but the icon file: %1\ndoes not seem to exist. Please choose a new icon.").arg(icon));
+ return;
+ }
+
+ if (!KIO::NetAccess::exists(m_sourceURL, true, kapp->mainWidget())) {
+ KMessageBox::error(this, i18n("Sorry, but the file: %1\ndoes not seem to exist. Maybe you forgot to save the file?").arg(m_sourceURL.prettyURL()));
+ return;
+ }
+
+ QListViewItem* item = m_templateList->selectedItem();
+
+ if(!item && m_templateManager->searchForTemplate(templateName, m_templateType)) {
+ KMessageBox::error(this, i18n("Sorry, but a template named \"%1\" already exists.\nPlease remove it first.").arg(templateName));
+ return;
+ }
+
+ bool returnValue;
+ if(item) {
+ TemplateListViewItem *templateItem = dynamic_cast<TemplateListViewItem*>(item);
+ Q_ASSERT(templateItem);
+ KileTemplate::Info templateInfo = templateItem->getTemplateInfo();
+ if (KMessageBox::warningYesNo(this, i18n("You are about to replace the template \"%1\"; are you sure?").arg(templateInfo.name)) == KMessageBox::No) {
+ reject();
+ return;
+ }
+ returnValue = m_templateManager->replace(templateInfo, m_sourceURL, templateName, iconURL);
+ }
+ else {
+ returnValue = m_templateManager->add(m_sourceURL, templateName, iconURL);
+ }
+ if (!returnValue) {
+ KMessageBox::error(this, i18n("Failed to create the template."));
+ reject();
+ return;
+ }
+ accept();
+}
+
+bool ManageTemplatesDialog::removeTemplate()
+{
+ QListViewItem* item = m_templateList->selectedItem();
+ if(!item) {
+ KMessageBox::information(this, i18n("Please select a template that should be removed."));
+ return true;
+ }
+
+ TemplateListViewItem *templateItem = dynamic_cast<TemplateListViewItem*>(item);
+ Q_ASSERT(templateItem);
+
+ KileTemplate::Info templateInfo = templateItem->getTemplateInfo();
+
+ if (!(KIO::NetAccess::exists(KURL::fromPathOrURL(templateInfo.path), false, kapp->mainWidget()) && (KIO::NetAccess::exists(KURL::fromPathOrURL(templateInfo.icon), false, kapp->mainWidget()) || !QFileInfo(templateInfo.icon).exists()))) {
+ KMessageBox::error(this, i18n("Sorry, but you do not have the necessary permissions to remove the selected template."));
+ return false;
+ }
+
+ if (KMessageBox::warningYesNo(this, i18n("You are about to remove the template \"%1\"; are you sure?").arg(templateInfo.name)) == KMessageBox::No) {
+ return false;
+ }
+
+ if (!m_templateManager->remove(templateInfo))
+ {
+ KMessageBox::error(this, i18n("Sorry, but the template could not be removed."));
+ reject();
+ return false;
+ }
+ accept();
+ return true;
+}
+
+#include "managetemplatesdialog.moc"
diff --git a/src/kile/managetemplatesdialog.h b/src/kile/managetemplatesdialog.h
new file mode 100644
index 0000000..c3c8f81
--- /dev/null
+++ b/src/kile/managetemplatesdialog.h
@@ -0,0 +1,77 @@
+/****************************************************************************************
+ begin : Sun Apr 27 2003
+ copyright : (C) 2003 by Jeroen Wijnhout (wijnhout@science.uva.nl)
+ 2007 by Michel Ludwig (michel.ludwig@kdemail.net)
+ ****************************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef MANAGETEMPLATESDIALOG_H
+#define MANAGETEMPLATESDIALOG_H
+
+#include <qcheckbox.h>
+#include <qfileinfo.h>
+#include <qstring.h>
+
+#include <klistview.h>
+#include <kdialogbase.h>
+#include <klineedit.h>
+#include <kurl.h>
+
+#include "kileconstants.h"
+
+namespace KileTemplate { class Manager; class Info; }
+
+/**
+ *@author Jeroen Wijnhout
+ */
+
+
+
+class ManageTemplatesDialog : public KDialogBase {
+ Q_OBJECT
+public:
+ ManageTemplatesDialog(KileTemplate::Manager *templateManager, const KURL& sourceURL, const QString &caption,QWidget *parent=0, const char *name=0);
+ ManageTemplatesDialog(KileTemplate::Manager *templateManager, const QString &caption,QWidget *parent=0, const char *name=0);
+ virtual ~ManageTemplatesDialog();
+
+public slots:
+ void slotSelectedTemplate(QListViewItem *item);
+ void slotSelectIcon();
+ void addTemplate();
+ bool removeTemplate();
+
+signals:
+ void aboutToClose();
+
+protected slots:
+ void updateTemplateListView(bool showAllTypes);
+ void clearSelection();
+ virtual void slotOk();
+
+protected:
+ KileTemplate::Manager* m_templateManager;
+ KLineEdit *m_nameEdit, *m_iconEdit;
+ KListView *m_templateList;
+ KileDocument::Type m_templateType;
+ QCheckBox *m_showAllTypesCheckBox;
+ KURL m_sourceURL;
+
+ /**
+ * Fills the template list view with template entries.
+ *
+ * @param type The type of the templates that should be displayed. You can pass "KileDocument::Undefined" to
+ * display every template.
+ **/
+ void populateTemplateListView(KileDocument::Type type);
+
+};
+
+#endif
diff --git a/src/kile/mathenvdialog.cpp b/src/kile/mathenvdialog.cpp
new file mode 100644
index 0000000..4e52bca
--- /dev/null
+++ b/src/kile/mathenvdialog.cpp
@@ -0,0 +1,373 @@
+/***************************************************************************
+ mathenvdialog.cpp
+----------------------------------------------------------------------------
+ date : Dec 06 2005
+ version : 0.21
+ copyright : (C) 2005 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "mathenvdialog.h"
+#include "codecompletion.h"
+#include "kileedit.h"
+
+#include <qlayout.h>
+#include <qstringlist.h>
+#include <qvaluelist.h>
+#include <qwhatsthis.h>
+
+#include <klocale.h>
+#include "kiledebug.h"
+
+namespace KileDialog
+{
+
+MathEnvironmentDialog::MathEnvironmentDialog(QWidget *parent, KConfig *config, KileInfo *ki, KileDocument::LatexCommands *commands)
+ : Wizard(config,parent), m_ki(ki), m_latexCommands(commands)
+{
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+ setCaption(i18n("Math Environments"));
+
+ QVBoxLayout *vbox = new QVBoxLayout(page,8,8);
+
+ // environment groupbox
+ QButtonGroup *envgroup = new QButtonGroup( i18n("Environment"),page);
+ envgroup->setColumnLayout(0, Qt::Vertical );
+ envgroup->layout()->setSpacing( 6 );
+ envgroup->layout()->setMargin( 11 );
+
+ m_lbEnvironment = new QLabel(i18n("&Name:"),envgroup);
+ m_lbStarred = new QLabel(i18n("Without n&umbering:"),envgroup);
+ m_lbRows = new QLabel(i18n("Number of &rows:"),envgroup);
+ m_lbCols = new QLabel(i18n("Number of c&ols:"),envgroup);
+ m_lbSpace = new QLabel(i18n("Space command\nto &separate groups:"), envgroup);
+ m_lbTabulator = new QLabel(i18n("Standard &tabulator:"), envgroup);
+ m_lbDisplaymath = new QLabel(i18n("Display&math mode:"), envgroup);
+ m_lbBullets = new QLabel(i18n("Use &bullets:"), envgroup);
+
+ QFrame *frame = new QFrame(envgroup);
+ frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ frame->setLineWidth(1);
+
+ m_coEnvironment = new QComboBox(envgroup);
+ m_cbStarred = new QCheckBox(envgroup);
+ m_spRows = new QSpinBox(1,99,1,envgroup);
+ m_spRows->setValue(3);
+ m_spCols = new QSpinBox(1,49,1,envgroup);
+ m_spCols->setValue(3);
+ m_edSpace = new KLineEdit("",envgroup);
+ m_coTabulator = new QComboBox(envgroup);
+ m_coDisplaymath = new QComboBox(envgroup);
+ m_cbBullets = new QCheckBox(envgroup);
+
+ QGridLayout *envlayout = new QGridLayout( envgroup->layout() );
+ envlayout->setAlignment( Qt::AlignTop );
+ envlayout->addWidget( m_lbEnvironment, 0,0 );
+ envlayout->addWidget( m_lbStarred, 1,0 );
+ envlayout->addWidget( m_lbRows, 2,0 );
+ envlayout->addWidget( m_lbCols, 3,0 );
+ envlayout->addWidget( m_lbTabulator, 5,0 );
+ envlayout->addWidget( m_lbDisplaymath, 6,0 );
+ envlayout->addWidget( m_coEnvironment, 0,1 );
+ envlayout->addWidget( m_cbStarred, 1,1 );
+ envlayout->addWidget( m_spRows, 2,1 );
+ envlayout->addWidget( m_spCols, 3,1 );
+ envlayout->addWidget( m_coTabulator, 5,1 );
+ envlayout->addWidget( m_coDisplaymath, 6,1 );
+ envlayout->addWidget( m_lbSpace, 3,3 );
+ envlayout->addWidget( m_lbBullets, 5,3 );
+ envlayout->addWidget( m_edSpace, 3,4 );
+ envlayout->addWidget( m_cbBullets, 5,4 );
+ envlayout->addMultiCellWidget(frame,4,4,0,4);
+ envlayout->setRowSpacing(4,30);
+ envlayout->setColSpacing(2,20);
+ envlayout->setColStretch(4,1);
+
+ // add widgets
+ vbox->addWidget( envgroup);
+ vbox->addStretch(1);
+
+ m_lbEnvironment->setBuddy(m_coEnvironment);
+ m_lbStarred->setBuddy(m_cbStarred);
+ m_lbRows->setBuddy(m_spRows);
+ m_lbCols->setBuddy(m_spCols);
+ m_lbSpace->setBuddy(m_edSpace);
+ m_lbTabulator->setBuddy(m_coTabulator);
+ m_lbDisplaymath->setBuddy(m_coDisplaymath);
+ m_lbBullets->setBuddy(m_cbBullets);
+
+ // initialize dialog
+ m_coDisplaymath->insertItem(QString::null);
+ m_coDisplaymath->insertItem("displaymath");
+ m_coDisplaymath->insertItem("\\[");
+ m_coDisplaymath->insertItem("equation");
+ m_coDisplaymath->insertItem("equation*");
+
+ // install environments
+ initEnvironments();
+ m_coEnvironment->setCurrentText("align");
+ slotEnvironmentChanged( m_coEnvironment->currentItem() );
+
+ // signals and slots
+ connect(m_coEnvironment, SIGNAL(activated(int)), this, SLOT(slotEnvironmentChanged(int)));
+ connect(m_spCols, SIGNAL(valueChanged(int)), this, SLOT(slotSpinboxValueChanged(int)));
+
+ QWhatsThis::add(m_coEnvironment,i18n("Choose an environment."));
+ QWhatsThis::add(m_cbStarred,i18n("Use the starred version of this environment."));
+ QWhatsThis::add(m_spRows,i18n("Choose the number of table rows."));
+ QWhatsThis::add(m_spCols,i18n("Choose the number of table columns or alignment groups."));
+ QWhatsThis::add(m_edSpace,i18n("Define an extra LaTeX command to separate alignment groups."));
+ QWhatsThis::add(m_coTabulator,i18n("Choose one of some predefined tabulators."));
+ QWhatsThis::add(m_coDisplaymath,i18n("Some environments are only valid in math mode. You can surround them with one of these display math modes."));
+ QWhatsThis::add(m_cbBullets,i18n("Insert bullets in each cell. Alt+Ctrl+Right and Alt+Ctrl+Left will move very quick from one cell to another."));
+}
+
+void MathEnvironmentDialog::initEnvironments()
+{
+ // read all math environments and insert them into the combobox
+ QStringList list;
+ QStringList::ConstIterator it;
+ m_latexCommands->commandList(list,(uint)(KileDocument::CmdAttrAmsmath|KileDocument::CmdAttrMath),false);
+ for ( it=list.begin(); it != list.end(); ++it )
+ {
+ m_coEnvironment->insertItem(*it);
+ }
+}
+
+bool MathEnvironmentDialog::isGroupsParameterEnv()
+{
+ return ( m_parameter == "{n}" );
+}
+
+bool MathEnvironmentDialog::isParameterEnv()
+{
+ return ( m_parameter.find("{") >= 0 );
+}
+
+////////////////////////////// determine the whole tag //////////////////////////////
+
+void MathEnvironmentDialog::slotEnvironmentChanged(int index)
+{
+ KILE_DEBUG() << "environment changed: " << m_coEnvironment->text(index) << endl;
+ m_envname = m_coEnvironment->text(index);
+
+ // look for environment parameter in dictionary
+ KileDocument::LatexCmdAttributes attr;
+ if ( m_latexCommands->commandAttributes(m_envname,attr) )
+ {
+ m_starred = attr.starred;
+ m_mathmode = attr.mathmode;
+ m_columns = ( attr.tabulator == "&" );
+ m_groups = ( attr.tabulator == "&=" );
+ m_fixedcolumns = ( attr.tabulator == "&=&" );
+ m_tabulator = attr.tabulator;
+ m_parameter = attr.parameter;
+ }
+
+ // set starred version
+ m_cbStarred->setChecked(false);
+ m_lbStarred->setEnabled(m_starred);
+ m_cbStarred->setEnabled(m_starred);
+
+ // determine column/group entries
+ QString labeltext = i18n("Number of cols:");
+ bool spinstate = false;
+ int minvalue = 1;
+ int maxvalue = 1;
+ int value = 1;
+
+ if ( m_columns )
+ {
+ spinstate = true;
+ if ( m_envname != "cases" ) // 1,49,3
+ {
+ maxvalue = 49;
+ value = 3;
+ }
+ else
+ {
+ minvalue = 2; // 2,2,2
+ maxvalue = 2;
+ value = 2;
+ }
+ } else if ( m_groups )
+ {
+ spinstate = true;
+ labeltext = i18n("Number of groups:");
+ maxvalue = 19; // 1,19,1
+ } else if ( m_fixedcolumns )
+ {
+ spinstate = true;
+ minvalue = 3; // 3,3,3
+ maxvalue = 3;
+ value = 3;
+ } else if ( m_envname == "split" )
+ {
+ spinstate = true;
+ maxvalue = 2; // 1,2,1
+ }
+
+ // set column/group entries
+ m_lbCols->setText(labeltext);
+ m_spCols->setMinValue(minvalue);
+ m_spCols->setMaxValue(maxvalue);
+ m_spCols->setValue(value);
+
+ m_lbCols->setEnabled(spinstate);
+ m_spCols->setEnabled(spinstate);
+ slotSpinboxValueChanged(m_spCols->value());
+
+ // set tabulator entries
+ m_coTabulator->clear();
+ QStringList tablist;
+ if ( m_tabulator == "&=&" )
+ tablist << "&=&" << "& &" << "&<&" << "&<=&" << "&>&" << "&>=&"
+ << "&\\ne&" << "&\\approx&" << "&\\equiv&" << "&\\conq&" ;
+ else if ( m_tabulator == "&=" )
+ tablist << "&=" << "& " << "&<" << "&<=" << "&>" << "&>="
+ << "&\\ne" << "&\\approx" << "&\\equiv" << "&\\conq" ;
+ else if ( ! m_tabulator.isEmpty() )
+ tablist << "&";
+ bool tabstate = ( tablist.count() > 0 );
+ m_lbTabulator->setEnabled(tabstate);
+ m_coTabulator->setEnabled(tabstate);
+ if ( tabstate )
+ m_coTabulator->insertStringList(tablist);
+
+ // set displaymathmode entries
+ m_lbDisplaymath->setEnabled(m_mathmode);
+ m_coDisplaymath->setEnabled(m_mathmode);
+}
+
+void MathEnvironmentDialog::slotSpinboxValueChanged(int index)
+{
+ bool state = ( index>1 && m_groups && isGroupsParameterEnv() );
+ m_lbSpace->setEnabled(state);
+ m_edSpace->setEnabled(state);
+}
+
+void MathEnvironmentDialog::slotOk()
+{
+ // environment
+ QString envname = ( m_cbStarred->isChecked() ) ? m_envname + '*' : m_envname;
+ QString indent = m_ki->editorExtension()->autoIndentEnvironment();
+
+ // use bullets?
+ QString bullet = ( m_cbBullets->isChecked() ) ? s_bullet : QString::null;
+
+ // normal tabulator
+ QString tab = m_coTabulator->currentText();
+ tab.replace("<=","\\le");
+ tab.replace(">=","\\ge");
+ QString tabulator = bullet + ' ' + tab + ' ';
+
+ // number of rows
+ int numrows = m_spRows->value();
+
+ // get number of groups/columns and tabulator to separate these
+ QString topgrouptabulator,grouptabulator;
+ int numgroups;
+ bool aligngroups;
+ if ( m_groups )
+ {
+ aligngroups = true;
+ numgroups = ( m_tabulator != "&" ) ? m_spCols->value() : 1;
+ if ( m_edSpace->isEnabled() )
+ {
+ QString spaces;
+ topgrouptabulator = " &" + m_edSpace->text() + " ";
+ grouptabulator = " & " + spaces.fill(' ', m_edSpace->text().length());
+ }
+ else
+ {
+ topgrouptabulator = " & ";
+ grouptabulator = " & ";
+ }
+ }
+ else
+ {
+ aligngroups = false;
+ if ( ! m_fixedcolumns )
+ numgroups = ( m_columns ) ? m_spCols->value()-1 : 0;
+ else
+ numgroups = 1;
+ }
+
+ // get displaymath mode
+ QString displaymathbegin = QString::null;
+ QString displaymathend = QString::null;
+ if ( m_coDisplaymath->isEnabled() )
+ {
+ QString mathmode = m_coDisplaymath->currentText();
+ if ( ! mathmode.isEmpty() )
+ {
+ if ( mathmode == "\\[" )
+ {
+ displaymathbegin = "\\[\n";
+ displaymathend = "\\]\n";
+ }
+ else
+ {
+ displaymathbegin = QString("\\begin{%1}\n").arg(mathmode);
+ displaymathend = QString("\\end{%1}\n").arg(mathmode);
+ }
+ }
+ }
+
+ // build tag
+ m_td.tagBegin = displaymathbegin;
+
+ QString parameter;
+ if ( isGroupsParameterEnv() )
+ parameter = QString("{%2}").arg(numgroups);
+ else if ( isParameterEnv() )
+ parameter = '{' + bullet + '}';
+
+ // open environment
+ m_td.tagBegin += QString("\\begin{%1}").arg(envname) + parameter + '\n';
+
+ for ( int row=0; row<numrows; ++row )
+ {
+ m_td.tagBegin += indent;
+ for ( int col=0; col<numgroups; ++col )
+ {
+ m_td.tagBegin += tabulator;
+ // is there more than one group or column?
+ if ( aligngroups && col<numgroups-1 )
+ {
+ if ( row == 0 )
+ m_td.tagBegin += bullet + topgrouptabulator;
+ else
+ m_td.tagBegin += bullet + grouptabulator;
+ }
+ }
+ // last row without CR
+ if ( row < numrows-1 )
+ m_td.tagBegin += bullet + " \\\\\n";
+ else
+ m_td.tagBegin += bullet;
+ }
+
+ // close environment
+ m_td.tagEnd = QString("\n\\end{%1}\n").arg(envname);
+ m_td.tagEnd += displaymathend;
+
+ m_td.dy = ( displaymathbegin.isEmpty() ) ? 1 : 2;
+ m_td.dx = indent.length();
+
+ accept();
+}
+
+}
+
+#include "mathenvdialog.moc"
diff --git a/src/kile/mathenvdialog.h b/src/kile/mathenvdialog.h
new file mode 100644
index 0000000..23611d3
--- /dev/null
+++ b/src/kile/mathenvdialog.h
@@ -0,0 +1,82 @@
+/***************************************************************************
+ mathenvdialog.h
+----------------------------------------------------------------------------
+ date : Dec 06 2005
+ version : 0.21
+ copyright : (C) 2005 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef MATHENVDIALOG_H
+#define MATHENVDIALOG_H
+
+#include "kileinfo.h"
+#include "kilewizard.h"
+#include "latexcmd.h"
+
+#include <klineedit.h>
+
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qspinbox.h>
+#include <qbuttongroup.h>
+#include <qmap.h>
+#include <qvaluelist.h>
+
+namespace KileDialog
+{
+
+class MathEnvironmentDialog : public Wizard
+{
+ Q_OBJECT
+
+public:
+ MathEnvironmentDialog(QWidget *parent, KConfig *config, KileInfo *ki, KileDocument::LatexCommands *commands);
+ ~MathEnvironmentDialog() {}
+
+public slots:
+ void slotOk();
+
+private slots:
+ void slotEnvironmentChanged(int index);
+ void slotSpinboxValueChanged(int index);
+
+private:
+ KileInfo *m_ki;
+ KileDocument::LatexCommands *m_latexCommands;
+
+ QComboBox *m_coEnvironment, *m_coTabulator, *m_coDisplaymath;
+ QCheckBox *m_cbStarred, *m_cbBullets;
+ QSpinBox *m_spRows, *m_spCols;
+ QLabel *m_lbRows, *m_lbCols, *m_lbSpace ;
+ QLabel *m_lbTabulator, *m_lbDisplaymath, *m_lbStarred;
+ QLabel *m_lbEnvironment, *m_lbBullets;
+ KLineEdit *m_edSpace;
+
+ QString m_envname;
+ bool m_starred;
+ bool m_groups;
+ bool m_columns;
+ bool m_fixedcolumns;
+ bool m_mathmode;
+ QString m_tabulator;
+ QString m_parameter;
+
+ void initEnvironments();
+ bool isParameterEnv();
+ bool isGroupsParameterEnv();
+};
+
+}
+
+#endif
diff --git a/src/kile/newdocumentwidget.ui b/src/kile/newdocumentwidget.ui
new file mode 100644
index 0000000..14832b2
--- /dev/null
+++ b/src/kile/newdocumentwidget.ui
@@ -0,0 +1,126 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>NewDocumentWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>NewDocumentWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>428</width>
+ <height>358</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Document Type</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Please select the type of document you want to create:</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>documentTypeComboBox</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Template</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Please select the template that should be used:</string>
+ </property>
+ </widget>
+ <widget class="TemplateIconView">
+ <property name="name">
+ <cstring>templateIconView</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>quickStartWizardCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Start the Quick Start wizard when creating an empty LaTeX file</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>TemplateIconView</class>
+ <header location="local">templates.h</header>
+ <sizehint>
+ <width>-1</width>
+ <height>-1</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>7</hordata>
+ <verdata>7</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </customwidget>
+</customwidgets>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/kile/newfilewizard.cpp b/src/kile/newfilewizard.cpp
new file mode 100644
index 0000000..656cdff
--- /dev/null
+++ b/src/kile/newfilewizard.cpp
@@ -0,0 +1,169 @@
+/*****************************************************************************************
+ begin : Sat Apr 26 2003
+ copyright : (C) 2003 by Jeroen Wijnhout (wijnhout@science.uva.nl)
+ 2005 by Holger Danielsson (holger.danielsson@t-online.de)
+ 2006, 2007 by Michel Ludwig (michel.ludwig@kdemail.net)
+******************************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "newfilewizard.h"
+
+#include <qcombobox.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qmap.h>
+
+#include <klocale.h>
+#include "kiledebug.h"
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kmessagebox.h>
+#include <kiconloader.h>
+
+#include "newdocumentwidget.h"
+
+#define LATEX_TYPE 0
+#define BIBTEX_TYPE 1
+#define SCRIPT_TYPE 2
+
+NewFileWizard::NewFileWizard(KileTemplate::Manager *templateManager, QWidget *parent, const char *name )
+ : KDialogBase(parent,name,true,i18n("New File"),KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true), m_templateManager(templateManager), m_currentlyDisplayedType(-1)
+{
+ // first read config
+ m_config = kapp->config();
+ m_config->setGroup("NewFileWizard");
+ bool wizard = m_config->readBoolEntry("UseWizardWhenCreatingEmptyFile", false);
+ int w = m_config->readNumEntry("width", -1);
+ if ( w == -1 ) w = width();
+ int h = m_config->readNumEntry("height", -1);
+ if ( h == -1 ) h = height();
+
+ m_newDocumentWidget = new NewDocumentWidget(this);
+ connect(m_newDocumentWidget->templateIconView, SIGNAL(doubleClicked(QIconViewItem *)), SLOT(slotOk()));
+ m_templateManager->scanForTemplates();
+ m_newDocumentWidget->templateIconView->setTemplateManager(m_templateManager);
+ m_newDocumentWidget->templateIconView->fillWithTemplates(KileDocument::LaTeX);
+
+ connect(m_newDocumentWidget->documentTypeComboBox, SIGNAL(activated(int)), this, SLOT(slotActivated(int)));
+ connect(m_newDocumentWidget->templateIconView, SIGNAL(classFileSearchFinished()), this, SLOT(restoreSelectedIcon()));
+
+ setMainWidget(m_newDocumentWidget);
+
+ m_newDocumentWidget->documentTypeComboBox->insertItem(i18n("LaTeX Document"), LATEX_TYPE);
+ m_newDocumentWidget->documentTypeComboBox->insertItem(i18n("BibTeX Document"), BIBTEX_TYPE);
+ m_newDocumentWidget->documentTypeComboBox->insertItem(i18n("Kile Script"), SCRIPT_TYPE);
+
+ // set config entries
+ m_newDocumentWidget->quickStartWizardCheckBox->setChecked(wizard);
+ resize(w,h);
+
+ // select the LaTeX type
+ m_newDocumentWidget->documentTypeComboBox->setCurrentItem(LATEX_TYPE);
+ m_currentlyDisplayedType = LATEX_TYPE;
+ restoreSelectedIcon();
+}
+
+NewFileWizard::~NewFileWizard()
+{
+}
+
+TemplateItem* NewFileWizard::getSelection()const
+{
+ for(QIconViewItem *item = m_newDocumentWidget->templateIconView->firstItem(); item; item = item->nextItem()) {
+ if(item->isSelected()) {
+ return static_cast<TemplateItem*>(item);
+ }
+ }
+ return NULL;
+}
+
+bool NewFileWizard::useWizard()
+{
+ // check (among other things) whether we want to create a LaTeX document
+ return ( (m_newDocumentWidget->documentTypeComboBox->currentItem() == 0) && getSelection() && (getSelection()->name() == DEFAULT_EMPTY_CAPTION || getSelection()->name() == DEFAULT_EMPTY_LATEX_CAPTION) && m_newDocumentWidget->quickStartWizardCheckBox->isChecked() );
+}
+
+QString NewFileWizard::getConfigKey(int index)
+{
+ QString configKey = "NewFileWizardSelectedIcon";
+ switch(index) {
+ case LATEX_TYPE:
+ configKey += "LaTeX";
+ break;
+
+ case BIBTEX_TYPE:
+ configKey += "BibTeX";
+ break;
+
+ case SCRIPT_TYPE:
+ configKey += "Script";
+ break;
+ }
+ return configKey;
+}
+
+void NewFileWizard::storeSelectedIcon()
+{
+ if(m_currentlyDisplayedType < 0) {
+ return;
+ }
+ TemplateItem *selectedItem = getSelection();
+ if (selectedItem) {
+ m_config->writeEntry(getConfigKey(m_currentlyDisplayedType), selectedItem->name());
+ }
+}
+
+void NewFileWizard::restoreSelectedIcon()
+{
+ QString selectedIconName = m_config->readEntry(getConfigKey(m_currentlyDisplayedType), DEFAULT_EMPTY_CAPTION);
+ QIconViewItem *item = m_newDocumentWidget->templateIconView->findItem(selectedIconName);
+ if(item) {
+ m_newDocumentWidget->templateIconView->setSelected(item, true);
+ }
+}
+
+void NewFileWizard::slotOk()
+{
+ m_config->setGroup("NewFileWizard");
+ m_config->writeEntry("UseWizardWhenCreatingEmptyFile", m_newDocumentWidget->quickStartWizardCheckBox->isChecked());
+ m_config->writeEntry("width", width());
+ m_config->writeEntry("height", height());
+
+ storeSelectedIcon();
+ accept();
+}
+
+void NewFileWizard::slotActivated(int index)
+{
+ storeSelectedIcon();
+ m_currentlyDisplayedType = index;
+ switch(index) {
+ case LATEX_TYPE:
+ m_newDocumentWidget->templateIconView->fillWithTemplates(KileDocument::LaTeX);
+ break;
+
+ case BIBTEX_TYPE:
+ m_newDocumentWidget->templateIconView->fillWithTemplates(KileDocument::BibTeX);
+ break;
+
+ case SCRIPT_TYPE:
+ m_newDocumentWidget->templateIconView->fillWithTemplates(KileDocument::Script);
+ break;
+ }
+ m_newDocumentWidget->quickStartWizardCheckBox->setEnabled((index == 0));
+
+ // and select an icon
+ restoreSelectedIcon();
+}
+
+#include "newfilewizard.moc"
diff --git a/src/kile/newfilewizard.h b/src/kile/newfilewizard.h
new file mode 100644
index 0000000..006eead
--- /dev/null
+++ b/src/kile/newfilewizard.h
@@ -0,0 +1,62 @@
+/*****************************************************************************************
+ begin : Sat Apr 26 2003
+ copyright : (C) 2003 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
+ 2007 by Michel Ludwig (michel.ludwig@kdemail.net)
+ *****************************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef NEWFILEWIZARD_H
+#define NEWFILEWIZARD_H
+
+#include <qstring.h>
+#include <qcheckbox.h>
+
+#include <kstandarddirs.h>
+#include <kiconview.h>
+#include <kdialogbase.h>
+#include <klocale.h>
+#include <kprocess.h>
+
+#include "kileconstants.h"
+#include "templates.h"
+
+class NewDocumentWidget;
+
+class NewFileWizard : public KDialogBase
+{
+ Q_OBJECT
+public:
+ NewFileWizard(KileTemplate::Manager *manager, QWidget *parent=0, const char *name=0);
+ ~NewFileWizard();
+
+public:
+ TemplateItem* getSelection() const;
+ bool useWizard();
+
+protected slots:
+ void slotOk();
+ void slotActivated(int index);
+
+ void restoreSelectedIcon();
+
+protected:
+ KileTemplate::Manager *m_templateManager;
+ KConfig *m_config;
+ NewDocumentWidget* m_newDocumentWidget;
+ int m_currentlyDisplayedType; // not a document type, only a local type!
+
+ QString getConfigKey(int index);
+
+ void storeSelectedIcon();
+
+};
+
+#endif
diff --git a/src/kile/newtoolwizard.ui b/src/kile/newtoolwizard.ui
new file mode 100644
index 0000000..97e8a39
--- /dev/null
+++ b/src/kile/newtoolwizard.ui
@@ -0,0 +1,189 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>NewToolWizard</class>
+<widget class="QWizard">
+ <property name="name">
+ <cstring>NewToolWizard</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>449</width>
+ <height>255</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>New Tool</string>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>NamePage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Name</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_lbName</cstring>
+ </property>
+ <property name="text">
+ <string>Type a short descriptive name for the &amp;tool:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_leName</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>m_leName</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>m_spacerName</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>70</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_lbWarning</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>WizardPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Behavior</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>m_cbTools</cstring>
+ </property>
+ </widget>
+ <spacer row="1" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>m_spacerBehaviorLeft</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>111</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="0" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>m_lbBehavior</cstring>
+ </property>
+ <property name="text">
+ <string>Select the default &amp;behavior (class)
+of this tool. It will inherit all properties
+of the tool it is based upon.
+
+For example, selecting "LaTeX" will
+cause your tool to behave just like
+the standard "LaTeX" tool.</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_cbTools</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>m_spacerBehaviorRight</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>71</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+</widget>
+<tabstops>
+ <tabstop>m_leName</tabstop>
+ <tabstop>m_cbTools</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">qstringlist.h</include>
+ <include location="global" impldecl="in implementation">qregexp.h</include>
+ <include location="global" impldecl="in implementation">kglobal.h</include>
+ <include location="local" impldecl="in implementation">kiletoolmanager.h</include>
+ <include location="global" impldecl="in implementation">klocale.h</include>
+ <include location="local" impldecl="in implementation">newtoolwizard.ui.h</include>
+</includes>
+<variables>
+ <variable access="private">QStringList m_toolList;</variable>
+</variables>
+<slots>
+ <slot>showPage( QWidget * pg )</slot>
+ <slot>nameChanged( const QString &amp; name )</slot>
+</slots>
+<functions>
+ <function access="private" specifier="non virtual">init()</function>
+ <function returnType="QString">customTool()</function>
+ <function returnType="QString">toolName()</function>
+ <function returnType="QString">parentTool()</function>
+</functions>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>kcombobox.h</includehint>
+</includehints>
+</UI>
diff --git a/src/kile/newtoolwizard.ui.h b/src/kile/newtoolwizard.ui.h
new file mode 100644
index 0000000..f89b26a
--- /dev/null
+++ b/src/kile/newtoolwizard.ui.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions or slots use
+** Qt Designer which will update this file, preserving your code. Create an
+** init() function in place of a constructor, and a destroy() function in
+** place of a destructor.
+*****************************************************************************/
+
+void NewToolWizard::init()
+{
+ m_toolList = KileTool::toolList(KGlobal::config(), false);
+
+ //setup the Name page (page 0)
+ connect(m_leName, SIGNAL(textChanged(const QString &)), this, SLOT(nameChanged(const QString &)));
+ setNextEnabled(page(0), false);
+ setFinishEnabled(page(0), false);
+ setHelpEnabled(page(0), false);
+
+ //setup the Behavior page (page 1)
+ m_cbTools->insertItem(customTool());
+ m_cbTools->insertStringList(m_toolList);
+ setFinishEnabled(page(1), true);
+ setHelpEnabled(page(1), false);
+}
+
+void NewToolWizard::showPage(QWidget *pg)
+{
+ QWizard::showPage(pg);
+
+ if ( pg == page(0) )
+ m_leName->setFocus();
+ else if ( pg == page(1) )
+ m_cbTools->setFocus();
+}
+
+QString NewToolWizard::customTool()
+{
+ return i18n("<Custom>");
+}
+
+QString NewToolWizard::toolName()
+{
+ return m_leName->text();
+}
+
+QString NewToolWizard::parentTool()
+{
+ return m_cbTools->currentText();
+}
+
+void NewToolWizard::nameChanged(const QString &name)
+{
+ static QRegExp reBracket = QRegExp("\\(|\\)|\\[|\\]");
+ bool ok = true;
+
+ if (m_toolList.contains(name))
+ {
+ m_lbWarning->setText(i18n( "Error: A tool by this name already exists." ));
+ ok = false;
+ }
+ else if (name.find("/") != -1)
+ {
+ m_lbWarning->setText(i18n( "Error: The name may not contain a slash '/'." ));
+ ok = false;
+ }
+ else if ( name.find(reBracket) != -1 )
+ {
+ m_lbWarning->setText(i18n("Error: The name may not contain a (,),[ or ]."));
+ ok = false;
+ }
+ else m_lbWarning->setText("");
+ setNextEnabled(page(0), ok);
+}
diff --git a/src/kile/outputfilter.cpp b/src/kile/outputfilter.cpp
new file mode 100644
index 0000000..6c2108c
--- /dev/null
+++ b/src/kile/outputfilter.cpp
@@ -0,0 +1,94 @@
+/***************************************************************************
+ begin : Die Sep 16 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : wijnhout@science.uva.nl
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "outputfilter.h"
+
+#include <qfile.h>
+#include <qregexp.h>
+#include <qfileinfo.h>
+
+#include "kiledebug.h"
+#include <ktextedit.h>
+#include <klocale.h>
+
+#include "kiletool_enums.h"
+
+using namespace std;
+
+OutputFilter::OutputFilter() :
+ m_log(QString::null)
+{
+}
+
+OutputFilter::~ OutputFilter()
+{
+}
+
+short OutputFilter::parseLine(const QString & /*strLine*/, short /*dwCookie*/)
+{
+ return 0;
+}
+
+
+bool OutputFilter::OnTerminate()
+{
+ return true;
+}
+
+void OutputFilter::setSource(const QString &src)
+{
+ m_source = src;
+ m_srcPath = QFileInfo(src).dirPath();
+}
+
+bool OutputFilter::Run(const QString & logfile)
+{
+ short sCookie = 0;
+ QString s;
+ QFile f(logfile);
+
+ m_log = QString::null;
+ m_nOutputLines = 0;
+
+ if ( f.open(IO_ReadOnly) )
+ {
+ QTextStream t( &f );
+ while ( !t.eof() )
+ {
+// KILE_DEBUG() << "line " << m_nOutputLines << endl;
+ s = t.readLine() + '\n';
+ sCookie = parseLine(s.stripWhiteSpace(), sCookie);
+ ++m_nOutputLines;
+
+ m_log += s;
+ }
+ f.close();
+ }
+ else
+ {
+ emit(problem(KileTool::Warning, i18n("Cannot open log file; did you run LaTeX?")));
+ return false;
+ }
+
+ return OnTerminate();
+}
+
+
+int OutputFilter::GetCurrentOutputLine() const
+{
+ return m_nOutputLines;
+}
+
+#include "outputfilter.moc"
diff --git a/src/kile/outputfilter.h b/src/kile/outputfilter.h
new file mode 100644
index 0000000..6b4c5d9
--- /dev/null
+++ b/src/kile/outputfilter.h
@@ -0,0 +1,72 @@
+/***************************************************************************
+ begin : Die Sep 16 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : wijnhout@science.uva.nl
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef OUTPUTFILTER_H
+#define OUTPUTFILTER_H
+
+#include <qvaluestack.h>
+#include <qstring.h>
+#include <qwidget.h>
+
+#include "outputinfo.h"
+
+/**An object of this class is used to parse the output messages
+of any third-party tool.
+
+@author Thorsten Lck
+ *@author Jeroen Wijnhout
+ */
+
+class KTextEdit;
+
+class OutputFilter : public QObject
+{
+ Q_OBJECT
+
+public:
+ OutputFilter();
+ virtual ~OutputFilter();
+
+protected:
+
+public:
+ virtual bool Run(const QString & logfile);
+
+ //void setLog(const QString &log) { m_log = log; }
+ const QString & log() const { return m_log; }
+
+ void setSource(const QString &src);
+ const QString & source() const { return m_source; }
+ const QString & path() const { return m_srcPath; }
+
+signals:
+ void problem(int, const QString &);
+ void output(const QString &);
+
+protected:
+ virtual short parseLine(const QString & strLine, short dwCookie);
+ virtual bool OnTerminate();
+ /**
+ Returns the zero based index of the currently parsed line in the
+ output file.
+ */
+ int GetCurrentOutputLine() const;
+
+private:
+ /** Number of current line in output file */
+ unsigned int m_nOutputLines;
+ QString m_log, m_source, m_srcPath;
+};
+#endif
diff --git a/src/kile/outputinfo.cpp b/src/kile/outputinfo.cpp
new file mode 100644
index 0000000..e4c72e9
--- /dev/null
+++ b/src/kile/outputinfo.cpp
@@ -0,0 +1,42 @@
+/***************************************************************************
+ begin : Die Sep 16 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : wijnhout@science.uva.nl
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "outputinfo.h"
+
+OutputInfo::OutputInfo()
+{
+ OutputInfo("",-1,-1);
+}
+
+
+OutputInfo::OutputInfo(const QString & strSrcFile, int nSrcLine, int nOutputLine,
+const QString & strError , int nErrorID /*=-1*/) :
+ m_strSrcFile(strSrcFile),
+ m_nSrcLine(nSrcLine),
+ m_strError(strError),
+ m_nOutputLine(nOutputLine),
+ m_nErrorID(nErrorID)
+{
+}
+
+/** Clears all attributes. */
+void OutputInfo::Clear()
+{
+ m_strSrcFile = "";
+ m_nSrcLine = -1;
+ m_nOutputLine = -1;
+ m_strError = "";
+ m_nErrorID = -1;
+}
diff --git a/src/kile/outputinfo.h b/src/kile/outputinfo.h
new file mode 100644
index 0000000..6950cb7
--- /dev/null
+++ b/src/kile/outputinfo.h
@@ -0,0 +1,78 @@
+/***************************************************************************
+ begin : Die Sep 16 2003
+ copyright : (C) 2003 by Jeroen Wijnhout
+ email : wijnhout@science.uva.nl
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef OUTPUTINFO_H
+#define OUTPUTINFO_H
+
+#include <qvaluelist.h>
+#include <qstring.h>
+
+/**Class for output-information of third program (e.g. Latex-Output, C-Compiler output)
+
+@author Thorsten Lck
+ *@author Jeroen Wijnhout
+ */
+
+using namespace std;
+
+class OutputInfo
+{
+ public:
+ OutputInfo();
+ OutputInfo(const QString & strSrcFile, int nSrcLine, int nOutputLine, const QString & strError ="", int nErrorID=-1);
+
+ public:
+ /** Source file where error occurred. */
+ QString source() const { return m_strSrcFile; }
+ /** Source file where error occurred. */
+ void setSource(const QString & src) { m_strSrcFile = src; }
+
+ /** Line number in source file of the current message */
+ int sourceLine() const { return m_nSrcLine; }
+ /** Line number in source file of the current message */
+ void setSourceLine(int line) { m_nSrcLine = line; }
+
+ /** Error message */
+ QString message() const { return m_strError; }
+ /** Error message */
+ void setMessage(const QString & message) { m_strError = message; }
+
+ /** Error code */
+ int type() const { return m_nErrorID; }
+ /** Error code */
+ void setType(int type) { m_nErrorID = type; }
+
+ /** Line number in the output, where error was reported. */
+ int outputLine() const { return m_nOutputLine; }
+ /** Line number in the output, where error was reported. */
+ void setOutputLine(int line) { m_nOutputLine = line; }
+
+ /** Clears all attributes. */
+ void Clear();
+
+private:
+ QString m_strSrcFile, m_file;
+ int m_nSrcLine;
+ QString m_strError;
+ int m_nOutputLine;
+ int m_nErrorID;
+};
+
+/**Array of OutputInfo
+
+@author Thorsten Lck
+*/
+typedef QValueList<OutputInfo> OutputInfoArray;
+#endif
diff --git a/src/kile/pics/CMakeLists.txt b/src/kile/pics/CMakeLists.txt
new file mode 100644
index 0000000..76740c9
--- /dev/null
+++ b/src/kile/pics/CMakeLists.txt
@@ -0,0 +1,4 @@
+
+########### install files ###############
+
+INSTALL( FILES type_Book.tex.kileicon type_Letter.tex.kileicon type_Scrartcl.tex.kileicon kile_splash_base.png type_Default.png type_Project.png type_Scrbook.tex.kileicon kile_splash.png type_Article.tex.kileicon type_Empty.png type_Prosper.tex.kileicon type_Scrlttr2.tex.kileicon type_Beamer.tex.kileicon type_HA-prosper.tex.kileicon type_Report.tex.kileicon type_Scrreprt.tex.kileicon DESTINATION share/apps/kile/pics )
diff --git a/src/kile/pics/Makefile.am b/src/kile/pics/Makefile.am
new file mode 100644
index 0000000..ebfafdc
--- /dev/null
+++ b/src/kile/pics/Makefile.am
@@ -0,0 +1,2 @@
+picsdir = $(kde_datadir)/kile/pics
+pics_DATA=kile_splash.png type_Article.tex.kileicon type_Book.tex.kileicon type_Default.png type_Empty.png type_Letter.tex.kileicon type_Project.png type_Report.tex.kileicon type_Beamer.tex.kileicon type_Scrartcl.tex.kileicon type_Scrreprt.tex.kileicon type_HA-prosper.tex.kileicon type_Scrbook.tex.kileicon type_Prosper.tex.kileicon type_Scrlttr2.tex.kileicon
diff --git a/src/kile/pics/kile_splash.png b/src/kile/pics/kile_splash.png
new file mode 100644
index 0000000..4e32083
--- /dev/null
+++ b/src/kile/pics/kile_splash.png
Binary files differ
diff --git a/src/kile/pics/type_Article.tex.kileicon b/src/kile/pics/type_Article.tex.kileicon
new file mode 100644
index 0000000..e33cd8c
--- /dev/null
+++ b/src/kile/pics/type_Article.tex.kileicon
Binary files differ
diff --git a/src/kile/pics/type_Beamer.tex.kileicon b/src/kile/pics/type_Beamer.tex.kileicon
new file mode 100644
index 0000000..1cbd8b4
--- /dev/null
+++ b/src/kile/pics/type_Beamer.tex.kileicon
Binary files differ
diff --git a/src/kile/pics/type_Book.tex.kileicon b/src/kile/pics/type_Book.tex.kileicon
new file mode 100644
index 0000000..08bfa61
--- /dev/null
+++ b/src/kile/pics/type_Book.tex.kileicon
Binary files differ
diff --git a/src/kile/pics/type_Default.png b/src/kile/pics/type_Default.png
new file mode 100644
index 0000000..e33cd8c
--- /dev/null
+++ b/src/kile/pics/type_Default.png
Binary files differ
diff --git a/src/kile/pics/type_Empty.png b/src/kile/pics/type_Empty.png
new file mode 100644
index 0000000..56659bd
--- /dev/null
+++ b/src/kile/pics/type_Empty.png
Binary files differ
diff --git a/src/kile/pics/type_HA-prosper.tex.kileicon b/src/kile/pics/type_HA-prosper.tex.kileicon
new file mode 100644
index 0000000..74d684d
--- /dev/null
+++ b/src/kile/pics/type_HA-prosper.tex.kileicon
Binary files differ
diff --git a/src/kile/pics/type_Letter.tex.kileicon b/src/kile/pics/type_Letter.tex.kileicon
new file mode 100644
index 0000000..a908818
--- /dev/null
+++ b/src/kile/pics/type_Letter.tex.kileicon
Binary files differ
diff --git a/src/kile/pics/type_Project.png b/src/kile/pics/type_Project.png
new file mode 100644
index 0000000..cc24d94
--- /dev/null
+++ b/src/kile/pics/type_Project.png
Binary files differ
diff --git a/src/kile/pics/type_Prosper.tex.kileicon b/src/kile/pics/type_Prosper.tex.kileicon
new file mode 100644
index 0000000..cd5b7c3
--- /dev/null
+++ b/src/kile/pics/type_Prosper.tex.kileicon
Binary files differ
diff --git a/src/kile/pics/type_Report.tex.kileicon b/src/kile/pics/type_Report.tex.kileicon
new file mode 100644
index 0000000..9911a7d
--- /dev/null
+++ b/src/kile/pics/type_Report.tex.kileicon
Binary files differ
diff --git a/src/kile/pics/type_Scrartcl.tex.kileicon b/src/kile/pics/type_Scrartcl.tex.kileicon
new file mode 100644
index 0000000..dbb9e8f
--- /dev/null
+++ b/src/kile/pics/type_Scrartcl.tex.kileicon
Binary files differ
diff --git a/src/kile/pics/type_Scrbook.tex.kileicon b/src/kile/pics/type_Scrbook.tex.kileicon
new file mode 100644
index 0000000..e9d3059
--- /dev/null
+++ b/src/kile/pics/type_Scrbook.tex.kileicon
Binary files differ
diff --git a/src/kile/pics/type_Scrlttr2.tex.kileicon b/src/kile/pics/type_Scrlttr2.tex.kileicon
new file mode 100644
index 0000000..21ca3b6
--- /dev/null
+++ b/src/kile/pics/type_Scrlttr2.tex.kileicon
Binary files differ
diff --git a/src/kile/pics/type_Scrreprt.tex.kileicon b/src/kile/pics/type_Scrreprt.tex.kileicon
new file mode 100644
index 0000000..25f05cb
--- /dev/null
+++ b/src/kile/pics/type_Scrreprt.tex.kileicon
Binary files differ
diff --git a/src/kile/plaintolatexconverter.cpp b/src/kile/plaintolatexconverter.cpp
new file mode 100644
index 0000000..2072201
--- /dev/null
+++ b/src/kile/plaintolatexconverter.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2004 Simon MARTIN <simartin@users.sourceforge.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library 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 Steet, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "plaintolatexconverter.h"
+
+PlainToLaTeXConverter::PlainToLaTeXConverter(void)
+{
+ // Fill the replacement map
+ //TODO Do it only once!
+ m_replaceMap.insert('$', "\\$");
+ m_replaceMap.insert('%', "\\%");
+ m_replaceMap.insert('^', "\\^");
+ m_replaceMap.insert('&', "\\&");
+ m_replaceMap.insert('_', "\\_");
+ m_replaceMap.insert('#', "\\#");
+ m_replaceMap.insert('{', "\\{");
+ m_replaceMap.insert('}', "\\}");
+ m_replaceMap.insert('~', "$\\sim$");
+}
+
+PlainToLaTeXConverter::~PlainToLaTeXConverter(void) {}
+
+/**
+ * Converts plain text to LaTeX.
+ * @param toConv The string to convert
+ * @return The conversion's result
+ */
+QString PlainToLaTeXConverter::ConvertToLaTeX(const QString& toConv) const
+{
+ QString result(toConv);
+
+ // Replacing what must be...
+ uint sSize = result.length();
+ QMapConstIterator<QChar, QString> mapEnd = m_replaceMap.end();
+ for(uint i = 0 ; i < sSize ; ++i)
+ {
+ QMapConstIterator<QChar, QString> it = m_replaceMap.find(result.at(i));
+
+ if(it != mapEnd) { // The character must be replaced
+ result.replace(i, 1, *it);
+ uint len = (*it).length();
+ if(1 < len) {
+ i += len - 1;
+ sSize += len - 1;
+ }
+ }
+ }
+
+ return result;
+}
diff --git a/src/kile/plaintolatexconverter.h b/src/kile/plaintolatexconverter.h
new file mode 100644
index 0000000..b5e4619
--- /dev/null
+++ b/src/kile/plaintolatexconverter.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2004 Simon MARTIN <simartin@users.sourceforge.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library 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 Steet, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _PLAINTOLATEXCONVERTER_H_
+#define _PLAINTOLATEXCONVERTER_H_
+
+#include <qmap.h>
+#include <qstring.h>
+
+/**
+ * A class that replaces the selection in the document (plain text) by its
+ * "LaTeX version" (ie. "_" -> "\_", "%" -> "\%"...).
+ */
+class PlainToLaTeXConverter
+{
+public:
+ PlainToLaTeXConverter(void);
+ ~PlainToLaTeXConverter(void);
+
+ QString ConvertToLaTeX(const QString&) const;
+
+private:
+ QMap<QChar, QString> m_replaceMap;
+};
+
+#endif /* _PLAINTOLATEXCONVERTER_H_ */
diff --git a/src/kile/postscriptdialog.cpp b/src/kile/postscriptdialog.cpp
new file mode 100644
index 0000000..05d780d
--- /dev/null
+++ b/src/kile/postscriptdialog.cpp
@@ -0,0 +1,562 @@
+/***************************************************************************
+ date : Mar 12 2007
+ version : 0.20
+ copyright : (C) 2005-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// 2007-03-12 dani
+// - use KileDocument::Extensions
+
+#include "postscriptdialog.h"
+
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qcheckbox.h>
+#include <qpushbutton.h>
+#include <qgroupbox.h>
+#include "qvgroupbox.h"
+#include <qlayout.h>
+#include <qpixmap.h>
+#include <qwhatsthis.h>
+#include <qstringlist.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <kiconloader.h>
+#include <ktempfile.h>
+#include <kmessagebox.h>
+#include <kstandarddirs.h>
+#include "kiledebug.h"
+
+#include "kiletool_enums.h"
+
+namespace KileDialog
+{
+
+PostscriptDialog::PostscriptDialog(QWidget *parent,
+ const QString &texfilename,const QString &startdir,
+ const QString &latexextensions,
+ KileWidget::LogMsg *log,KileWidget::Output *output) :
+ KDialogBase( parent,0, true, i18n("Rearrange Postscript File"), User1 | Ok, User1, true ),
+ m_startdir(startdir),
+ m_log(log),
+ m_output(output),
+ m_proc(0)
+{
+ // determine if a psfile already exists
+ QString psfilename;
+ if ( ! texfilename.isEmpty() )
+ {
+ // working with a postscript document, so we try to determine the LaTeX source file
+ QStringList extlist = QStringList::split( " ", latexextensions );
+ for ( QStringList::Iterator it=extlist.begin(); it!=extlist.end(); ++it )
+ {
+ if ( texfilename.find( (*it), -(*it).length() ) >= 0 )
+ {
+ psfilename = texfilename.left(texfilename.length()-(*it).length()) + ".ps";
+ if ( ! QFileInfo(psfilename).exists() )
+ psfilename = QString::null;
+ break;
+ }
+ }
+ }
+
+ // prepare dialog
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+
+ // Layout
+ QVBoxLayout *vbox = new QVBoxLayout(page, 6,6 );
+
+ // groupbox with file selection
+ QVGroupBox* group= new QVGroupBox(i18n("Parameter"),page );
+ QWidget *widget = new QWidget(group);
+ QGridLayout *grid = new QGridLayout( widget, 7,3, 6,6, "");
+ grid->setColStretch(1,1);
+
+ // line 0: QLabel
+ bool pstops = ! KStandardDirs::findExe("pstops").isNull();
+ bool psselect = ! KStandardDirs::findExe("psselect").isNull();
+
+ QString title = i18n("Conversion of ps files is made by 'pstops' and 'psselect'.\nBe sure to call 'dvips' with option '-t a4' and\nhyperref package (if needed) with option 'a4paper'.");
+
+ if ( !pstops || !psselect ) {
+ QString msg = QString::null;
+ if ( ! pstops ) {
+ msg = "'pstops'";
+ if ( ! psselect )
+ msg += " and ";
+ }
+ if ( ! psselect ) {
+ msg += "'psselect'";
+ }
+ title += "\n(Error: " + msg + " not found.)";
+ }
+
+ QLabel *label1 = new QLabel(title,widget);
+ label1->setAlignment(Qt::AlignHCenter);
+ grid->addMultiCellWidget( label1, 0,0, 0,2, Qt::AlignCenter );
+
+ // empty line
+ grid->setRowSpacing(1,10);
+
+ // line 1: QLabel
+ QLabel *label2 = new QLabel(i18n("Input file:"), widget);
+ grid->addWidget( label2, 2,0 );
+
+ // line 1: QLineEdit
+ m_edInfile = new QLineEdit("",widget);
+ m_edInfile->setMinimumWidth(300);
+ m_edInfile->setText(psfilename);
+ grid->addWidget( m_edInfile, 2,1 );
+
+ // line 1: Choose-Box
+ QPushButton *choose_in = new QPushButton("", widget, "infilechooser" );
+ choose_in->setPixmap( SmallIcon("fileopen") );
+ choose_in->setFixedWidth(choose_in->sizeHint().width());
+ grid->addWidget(choose_in,2,2);
+
+ // line 2: QLabel
+ QLabel *label3 = new QLabel(i18n("Output file:"), widget);
+ grid->addWidget( label3, 3,0 );
+
+ // line 2: QLineEdit
+ m_edOutfile = new QLineEdit("",widget);
+ m_edOutfile->setMinimumWidth(300);
+ grid->addWidget( m_edOutfile, 3,1 );
+
+ // line 3: choose box
+ QPushButton *choose_out = new QPushButton("", widget, "outfilechooser" );
+ choose_out->setPixmap( SmallIcon("fileopen") );
+ choose_out->setFixedWidth(choose_out->sizeHint().width());
+ grid->addWidget(choose_out,3,2);
+
+ // line 3: task selection
+ QLabel *label4 = new QLabel(i18n("Task:"), widget);
+ grid->addWidget( label4, 4,0 );
+
+ // line 3: predefined tasks
+ m_cbTask = new QComboBox( false,widget );
+ if ( pstops ) {
+ m_cbTask->insertItem(i18n("1 DIN A5 Page + Empty Page --> DIN A4")); // 0 PS_A5_EMPTY
+ m_cbTask->insertItem(i18n("1 DIN A5 Page + Duplicate --> DIN A4")); // 1 PS_A5_DUPLICATE
+ m_cbTask->insertItem(i18n("2 DIN A5 Pages --> DIN A4")); // 2 PS_2xA5
+ m_cbTask->insertItem(i18n("2 DIN A5L Pages --> DIN A4")); // 3 PS_2xA5L
+ m_cbTask->insertItem(i18n("4 DIN A5 Pages --> DIN A4")); // 4 PS_4xA5
+ m_cbTask->insertItem(i18n("1 DIN A4 Page + Empty Page --> DIN A4")); // 5 PS_A4_EMPTY
+ m_cbTask->insertItem(i18n("1 DIN A4 Page + Duplicate --> DIN A4")); // 6 PS_A4_DUPLICATE
+ m_cbTask->insertItem(i18n("2 DIN A4 Pages --> DIN A4")); // 7 PS_2xA4
+ m_cbTask->insertItem(i18n("2 DIN A4L Pages --> DIN A4")); // 8 PS_2xA4L
+ }
+ if ( psselect ) {
+ m_cbTask->insertItem(i18n("Select Even Pages")); // 9 PS_EVEN
+ m_cbTask->insertItem(i18n("Select Odd Pages")); // 10 PS_ODD
+ m_cbTask->insertItem(i18n("Select Even Pages (reverse order)")); // 11 PS_EVEN_REV
+ m_cbTask->insertItem(i18n("Select Odd Pages (reverse order)")); // 12 PS_ODD_REV
+ m_cbTask->insertItem(i18n("Reverse All Pages")); // 13 PS_REVERSE
+ m_cbTask->insertItem(i18n("Copy All Pages (sorted)")); // 14 PS_COPY_SORTED
+ }
+ if ( pstops ) {
+ m_cbTask->insertItem(i18n("Copy All Pages (unsorted)")); // 15 PS_COPY_UNSORTED
+ m_cbTask->insertItem(i18n("pstops: Choose Parameter")); // 16 PS_PSTOPS_FREE
+ }
+ if ( psselect ) {
+ m_cbTask->insertItem(i18n("psselect: Choose Parameter")); // 17 PS_PSSELECT_FREE
+ }
+ m_cbTask->setMinimumWidth(300+6+choose_out->width());
+ grid->addMultiCellWidget( m_cbTask, 4,4,1,2 );
+
+ // line 4: QLabel (parameter or copies)
+ m_lbParameter = new QLabel(i18n("Parameter:"), widget);
+ grid->addWidget( m_lbParameter, 5,0 );
+
+ // line 4: QLineEdit or QSoinBox
+ m_edParameter = new QLineEdit("",widget);
+ m_edParameter->setMinimumWidth(300);
+ grid->addMultiCellWidget( m_edParameter, 5,5,1,2 );
+ m_spCopies = new QSpinBox(widget);
+ m_spCopies->setValue(1);
+ m_spCopies->setRange(1,99);
+ grid->addMultiCellWidget( m_spCopies, 5,5,1,2 );
+
+ // choose one common task
+ m_cbTask->setCurrentItem(PS_2xA4);
+ comboboxChanged(PS_2xA4);
+
+ // line 5: QLabel
+ QLabel *label6 = new QLabel(i18n("Viewer:"), widget);
+ grid->addWidget( label6, 6,0 );
+
+ // line 5: QCheckBox
+ m_cbView = new QCheckBox(i18n("Show ps file with 'kghostview'"),widget);
+ m_cbView->setChecked(true);
+ grid->addWidget( m_cbView, 6,1 );
+
+ // build Layout
+ vbox->addWidget(group);
+ vbox->addStretch();
+
+ // set an user button to execute the task
+ setButtonText(Ok,i18n("Done"));
+ setButtonText(User1,i18n("Execute"));
+ if ( !pstops && !psselect )
+ enableButton(User1,false);
+
+ QWhatsThis::add(m_cbTask,i18n("Choose one of the 18 operations to convert a postscript file. The last four operations need specific parameters."));
+ QWhatsThis::add(choose_in,i18n("Choose the input file."));
+ QWhatsThis::add(choose_out,i18n("Choose the output file."));
+ QWhatsThis::add(m_edInfile,i18n("Input file, which should be converted."));
+ QWhatsThis::add(m_edOutfile,i18n("The name of the output file. This entry may also be empty, if you only want to view the result without saving it. In this case the viewer checkbox must be checked."));
+ QWhatsThis::add(m_edParameter,i18n("'Select pages' and 'Free Parameter' need some specific parameter, which you can enter here"));
+ QWhatsThis::add(m_spCopies,i18n("When you want to copy pages, you must enter the number of copies"));
+ QWhatsThis::add(m_cbView,i18n("View the result of the conversion process. KGhostview is always taken as an external viewer."));
+
+ // some connections
+ connect( choose_in, SIGNAL( clicked() ), this, SLOT( chooseInfile() ) );
+ connect( choose_out, SIGNAL( clicked() ), this, SLOT( chooseOutfile() ) );
+ connect( m_cbTask,SIGNAL( activated(int) ),this, SLOT( comboboxChanged(int) ) );
+ connect( this, SIGNAL(output(const QString &)), m_output, SLOT(receive(const QString &)) );
+
+ setFocusProxy( m_edInfile );
+
+}
+
+PostscriptDialog::~PostscriptDialog()
+{
+ if ( m_proc )
+ delete m_proc;
+}
+
+void PostscriptDialog::slotUser1()
+{
+ if ( checkParameter() ) {
+ execute();
+ }
+}
+
+void PostscriptDialog::execute()
+{
+ m_tempfile = buildTempfile();
+ if ( m_tempfile != QString::null ) {
+ m_log->clear();
+ QFileInfo from(m_edInfile->text());
+ QFileInfo to(m_edOutfile->text());
+
+ // output for log window
+ QString msg = i18n("rearrange ps file: ") + from.fileName();
+ if ( ! to.fileName().isEmpty() )
+ msg += " ---> " + to.fileName();
+ m_log->printMsg(KileTool::Info,msg,m_program);
+
+ // some output logs
+ m_output->clear();
+ QString s = QString("*****\n")
+ + i18n("***** tool: ") + m_program + ' ' + m_param + '\n'
+ + i18n("***** input file: ") + from.fileName()+ '\n'
+ + i18n("***** output file: ") + to.fileName()+ '\n'
+ + i18n("***** viewer: ") + ((m_cbView->isChecked()) ? i18n("yes") : i18n("no")) + '\n'
+ + "*****\n";
+ emit( output(s) );
+
+ // delete old KShellProcess
+ if ( m_proc )
+ delete m_proc;
+
+ m_proc = new KShellProcess();
+ m_proc->clearArguments();
+ (*m_proc) << QStringList::split(' ',"sh " + m_tempfile);
+
+ connect(m_proc, SIGNAL(receivedStdout(KProcess *,char *,int)),
+ this, SLOT(slotProcessOutput(KProcess *,char *,int)));
+ connect(m_proc, SIGNAL(receivedStderr(KProcess*,char*,int)),
+ this, SLOT(slotProcessOutput(KProcess*,char*,int)) );
+ connect(m_proc, SIGNAL(processExited(KProcess *)),
+ this, SLOT(slotProcessExited(KProcess *)));
+
+ KILE_DEBUG() << "=== PostscriptDialog::runPsutils() ====================" << endl;
+ KILE_DEBUG() << " execute '" << m_tempfile << "'" << endl;
+ //if ( ! proc->start(KProcess::NotifyOnExit, KProcess::NoCommunication) )
+ if ( ! m_proc->start(KProcess::NotifyOnExit, KProcess::AllOutput) )
+ KILE_DEBUG() << "\tstart of shell process failed" << endl;
+ }
+
+}
+
+void PostscriptDialog::slotProcessOutput(KProcess*,char* buf,int len)
+{
+ emit( output(QCString(buf,len+1)) );
+}
+
+
+void PostscriptDialog::slotProcessExited (KProcess *proc)
+{
+ if ( ! proc->normalExit() )
+ showError(i18n("An error occurred, while rearranging the file."));
+
+ QFile::remove(m_tempfile);
+}
+
+QString PostscriptDialog::buildTempfile()
+{
+ // build command
+ m_program = "pstops"; // default
+ m_param = "";
+
+ switch ( m_cbTask->currentItem() ) {
+ case PS_A5_EMPTY: m_param = "1:0L(29.7cm,0cm)";
+ break;
+ case PS_A5_DUPLICATE: m_param = "1:0L(29.7cm,0cm)+0L(29.7cm,14.85cm)";
+ break;
+ case PS_2xA5: m_param = "2:0L(29.7cm,0cm)+1L(29.7cm,14.85cm)";
+ break;
+ case PS_2xA5L: break;
+ case PS_4xA5: m_param = "4:0@0.7(0cm,8.7cm)"
+ "+1@0.7(10.5cm,8.7cm)"
+ "+2@0.7(0cm,-6.15cm)"
+ "+3@0.7(10.5cm,-6.15cm)";
+ break;
+ case PS_A4_EMPTY: m_param = "1:0L@0.7(21cm,0cm)";
+ break;
+ case PS_A4_DUPLICATE: m_param = "1:0L@0.7(21cm,0cm)+0L@0.7(21cm,14.85cm)";
+ break;
+ case PS_2xA4: m_param = "2:0L@0.7(21cm,0cm)+1L@0.7(21cm,14.85cm)";
+ break;
+ case PS_2xA4L: m_param = "2:0R@0.7(0cm,29.7cm)+1R@0.7(0cm,14.85cm)";
+ break;
+ case PS_EVEN: m_program = "psselect";
+ m_param = "-e";
+ break;
+ case PS_ODD: m_program = "psselect";
+ m_param = "-o";
+ break;
+ case PS_EVEN_REV: m_program = "psselect";
+ m_param = "-e -r";
+ break;
+ case PS_ODD_REV: m_program = "psselect";
+ m_param = "-o -r";
+ break;
+ case PS_REVERSE: m_program = "psselect";
+ m_param = "-r";
+ break;
+ case PS_COPY_SORTED: m_program = "psselect";
+ m_param = "-p" + duplicateParameter("1-");
+ break;
+ case PS_COPY_UNSORTED: m_param = "1:" + duplicateParameter("0");
+ break;
+ case PS_PSTOPS_FREE: m_param = m_edParameter->text();
+ break;
+ case PS_PSSELECT_FREE: m_program = "psselect";
+ m_param = m_edParameter->text();
+ break;
+ }
+
+ // create a temporary file
+ KTempFile temp(QString::null,".sh");
+ QString tempname = temp.name();
+
+ QTextStream *stream = temp.textStream();
+ *stream << "#! /bin/sh" << endl;
+
+ // accept only ".ps" or ".ps.gz" as an input file
+ QFileInfo fi( m_edInfile->text() );
+ bool zipped_psfile = ( fi.extension() == "ps.gz" ) ? true : false;
+
+ // there are four possible cases
+ // outfile view
+ // 1) + + pstops/psselect + kghostview
+ // 2) + - pstops/psselect
+ // 3) - + pstops/psselect | kghostview (nur Shell)
+ // 4) - - error (already detected by checkParameter())
+
+ // some files, which are used
+ QString command = m_program + " \"" + m_param + "\"";
+ QString inputfile = "\"" + m_edInfile->text() + "\"";
+ QString outputfile = "\"" + m_edOutfile->text() + "\"";
+ bool viewer = m_cbView->isChecked();
+
+ bool equalfiles = false;
+ if ( inputfile == outputfile ) {
+ outputfile = tempname + ".tmp";
+ equalfiles = true;
+ }
+
+ if ( ! zipped_psfile ) { // unzipped ps files
+ if ( m_edOutfile->text().isEmpty() ) { // pstops/psselect | kghostview
+ *stream << command << " " << inputfile << " | kghostview -" << endl;
+ viewer = false;
+ } else { // pstops/psselect
+ *stream << command << " " << inputfile << " " << outputfile << endl;
+ }
+ } else { // zipped ps files
+ if ( m_edOutfile->text().isEmpty() ) { // pstops/psselect | kghostview
+ *stream << "gunzip -c " << inputfile
+ << " | " << command
+ << " | kghostview -"
+ << endl;
+ viewer = false;
+ } else {
+ *stream << "gunzip -c " << inputfile // pstops/psselect
+ << " | " << command
+ << " > " << outputfile
+ << endl;
+ }
+ }
+
+ // check, if we should stop
+ if ( equalfiles || viewer ) {
+ *stream << "if [ $? != 0 ]; then" << endl;
+ *stream << " exit 1" << endl;
+ *stream << "fi" << endl;
+ }
+
+ // replace the original file
+ if ( equalfiles ) {
+ *stream << "rm " << inputfile << endl;
+ *stream << "mv " << outputfile << " " << inputfile << endl;
+ }
+
+ // viewer
+ if ( viewer ) { // viewer: kghostview
+ *stream << "kghostview" << " " << (( equalfiles ) ? inputfile : outputfile) << endl;
+ }
+
+ // everything is prepared to do the job
+ temp.close();
+
+ return(tempname);
+}
+
+void PostscriptDialog::chooseInfile()
+{
+ QString fn = KFileDialog::getOpenFileName(
+ m_startdir,
+ i18n("*.ps|PS Files\n*.ps.gz|Zipped PS Files"),
+ this,i18n("Select Input File") );
+
+ if ( ! fn.isEmpty() ) {
+ m_edInfile->setText( fn );
+ }
+}
+
+void PostscriptDialog::chooseOutfile()
+{
+ QString fn = KFileDialog::getOpenFileName(
+ m_startdir,
+ i18n("*.ps|PS Files"),
+ this,i18n("Select Name of Output File") );
+
+ if ( ! fn.isEmpty() ) {
+ m_edOutfile->setText( fn );
+ }
+}
+
+QString PostscriptDialog::duplicateParameter(const QString &param)
+{
+ QString s = QString::null;
+ for (int i=0; i<m_spCopies->value(); ++i) {
+ if ( i == 0 )
+ s += param;
+ else
+ s+= ',' + param;
+ }
+
+ return s;
+}
+
+
+bool PostscriptDialog::checkParameter()
+{
+ QString infile = m_edInfile->text();
+ if ( infile.isEmpty() ) {
+ showError( i18n("No input file is given.") );
+ return false;
+ }
+
+ QFileInfo fi( infile );
+ if ( fi.extension()!="ps" && fi.extension()!="ps.gz" ) {
+ showError( i18n("Unknown file format: only '.ps' and '.ps.gz' are accepted for input files.") );
+ return false;
+ }
+
+ if ( ! fi.exists() ) {
+ showError( i18n("This input file does not exist.") );
+ return false;
+ }
+
+ // check parameter
+ int index = m_cbTask->currentItem();
+ if ( m_edParameter->text().isEmpty() ) {
+ if ( index == PS_PSSELECT_FREE ) {
+ showError( i18n("psselect needs some parameters in this mode.") );
+ return false;
+ } else if ( index == PS_PSTOPS_FREE ) {
+ showError( i18n("pstops needs some parameters in this mode.") );
+ return false;
+ }
+ }
+
+ QString outfile = m_edOutfile->text();
+ if ( outfile.isEmpty() && !m_cbView->isChecked() ) {
+ showError( i18n("You need to define an output file or select the viewer.") );
+ return false;
+ }
+
+ if ( ! outfile.isEmpty() ) {
+ QFileInfo fo( outfile );
+ if ( fo.extension() != "ps" ) {
+ showError( i18n("Unknown file format: only '.ps' is accepted as output file.") );
+ return false;
+ }
+
+ if ( infile!=outfile && fo.exists() ) {
+ QString s = i18n("A file named \"%1\" already exists. Are you sure you want to overwrite it?").arg(fo.fileName());
+ if ( KMessageBox::questionYesNo( this,
+ "<center>" + s + "</center>",
+ "Postscript tools" ) == KMessageBox::No ) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+void PostscriptDialog::comboboxChanged(int index)
+{
+ KILE_DEBUG() << index << endl;
+ if ( index==PS_COPY_SORTED || index==PS_COPY_UNSORTED ) {
+ m_lbParameter->setEnabled(true);
+ m_lbParameter->setText(i18n("Copies:"));
+ m_edParameter->hide();
+ m_spCopies->show();
+ m_spCopies->setEnabled(true);
+ } else if ( index==PS_PSSELECT_FREE || index==PS_PSTOPS_FREE ) {
+ m_lbParameter->setEnabled(true);
+ m_lbParameter->setText(i18n("Parameter:"));
+ m_spCopies->hide();
+ m_edParameter->show();
+ m_edParameter->setEnabled(true);
+ } else {
+ m_lbParameter->setEnabled(false);
+ m_edParameter->setEnabled(false);
+ m_spCopies->setEnabled(false);
+ }
+}
+
+void PostscriptDialog::showError(const QString &text)
+{
+ KMessageBox::error( this,i18n("<center>") + text + i18n("</center>"),i18n("Postscript Tools") );
+}
+
+}
+
+#include "postscriptdialog.moc"
diff --git a/src/kile/postscriptdialog.h b/src/kile/postscriptdialog.h
new file mode 100644
index 0000000..05cc68e
--- /dev/null
+++ b/src/kile/postscriptdialog.h
@@ -0,0 +1,105 @@
+/***************************************************************************
+ date : Mar 12 2007
+ version : 0.20
+ copyright : (C) 2005-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef POSTSCRIPTDIALOG_H
+#define POSTSCRIPTDIALOG_H
+
+#include <kdialogbase.h>
+#include <qcombobox.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+#include <qlineedit.h>
+#include <qstring.h>
+#include <kprocess.h>
+
+#include "kilelogwidget.h"
+#include "kileoutputwidget.h"
+
+#define PS_A5_EMPTY 0
+#define PS_A5_DUPLICATE 1
+#define PS_2xA5 2
+#define PS_2xA5L 3
+#define PS_4xA5 4
+#define PS_A4_EMPTY 5
+#define PS_A4_DUPLICATE 6
+#define PS_2xA4 7
+#define PS_2xA4L 8
+#define PS_EVEN 9
+#define PS_ODD 10
+#define PS_EVEN_REV 11
+#define PS_ODD_REV 12
+#define PS_REVERSE 13
+#define PS_COPY_SORTED 14
+#define PS_COPY_UNSORTED 15
+#define PS_PSTOPS_FREE 16
+#define PS_PSSELECT_FREE 17
+
+class KShellProcess;
+
+namespace KileDialog
+{
+
+class PostscriptDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ PostscriptDialog(QWidget *parent,
+ const QString &texfilename,const QString &startdir,
+ const QString &latexextensions,
+ KileWidget::LogMsg *log, KileWidget::Output *output);
+ ~PostscriptDialog();
+
+signals:
+ void output(const QString &);
+
+private slots:
+ void chooseInfile();
+ void chooseOutfile();
+ void comboboxChanged(int index);
+ void slotUser1();
+ void slotProcessOutput(KProcess*,char* buf,int len);
+ void slotProcessExited (KProcess *proc);
+
+private:
+ bool checkParameter();
+ QString buildTempfile();
+ QString duplicateParameter(const QString &param);
+ void showError(const QString &text);
+ void execute();
+
+ QLineEdit *m_edInfile, *m_edOutfile, *m_edParameter;
+ QComboBox *m_cbTask;
+ QCheckBox *m_cbView;
+ QSpinBox *m_spCopies;
+ QLabel *m_lbParameter;
+
+ QString m_startdir;
+ KileWidget::LogMsg *m_log;
+ KileWidget::Output *m_output;
+
+ QString m_tempfile;
+ QString m_program;
+ QString m_param;
+
+ KShellProcess* m_proc;
+
+};
+
+}
+
+
+#endif
diff --git a/src/kile/previewconfigwidget.cpp b/src/kile/previewconfigwidget.cpp
new file mode 100644
index 0000000..3611364
--- /dev/null
+++ b/src/kile/previewconfigwidget.cpp
@@ -0,0 +1,326 @@
+/***************************************************************************
+ date : Sep 05 2006
+ version : 0.32
+ copyright : (C) 2005-2006 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "previewconfigwidget.h"
+
+#include <klocale.h>
+#include "kiledebug.h"
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qstringlist.h>
+#include <qmap.h>
+#include <qvalidator.h>
+
+#include "kileconfig.h"
+
+KileWidgetPreviewConfig::KileWidgetPreviewConfig(KConfig *config, KileTool::QuickPreview *preview, QWidget *parent, const char *name )
+ : QWidget(parent,name),
+ m_config(config),
+ m_preview(preview)
+{
+ // Layout
+ QVBoxLayout *vbox = new QVBoxLayout(this, 5,5 );
+
+ QGroupBox *groupbox = new QGroupBox( i18n("Quick Preview in a separate window"), this, "groupbox" );
+ groupbox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, 0, 0, groupbox->sizePolicy().hasHeightForWidth() ) );
+ groupbox->setColumnLayout(0, Qt::Vertical );
+ groupbox->layout()->setSpacing( 6 );
+ groupbox->layout()->setMargin( 11 );
+ QGridLayout *groupboxLayout = new QGridLayout( groupbox->layout() );
+ groupboxLayout->setAlignment( Qt::AlignTop );
+
+ QLabel *label = new QLabel( i18n("Select a configuration:"), groupbox, "label");
+ m_combobox = new KComboBox(false,groupbox,"combobox" );
+
+ groupboxLayout->addWidget(label,0,0);
+ groupboxLayout->addWidget(m_combobox,0,2);
+ groupboxLayout->setColSpacing(1,8);
+ groupboxLayout->setColStretch(3,1);
+
+ QGroupBox *gbResolution = new QGroupBox( i18n("Quick Preview in bottom bar"), this, "gbresolution" );
+ gbResolution->setColumnLayout(0, Qt::Vertical );
+ gbResolution->layout()->setSpacing( 6 );
+ gbResolution->layout()->setMargin( 11 );
+ QGridLayout *resLayout = new QGridLayout( gbResolution->layout() );
+ resLayout->setAlignment( Qt::AlignTop );
+
+ QLabel *resLabel = new QLabel( i18n("&Resolution:"), gbResolution );
+ m_leDvipngResolution = new KLineEdit( gbResolution, "DvipngResolution" );
+ QLabel *resDpi = new QLabel( i18n("dpi"), gbResolution );
+ QLabel *resAllowed = new QLabel( i18n("(allowed values: 30-1000 dpi)"), gbResolution );
+
+ // set validator
+ QValidator* validator = new QIntValidator(30,1000,this);
+ m_leDvipngResolution->setValidator(validator);
+ resLabel->setBuddy(m_leDvipngResolution);
+
+ QString sep = "&nbsp;&nbsp;&nbsp;&nbsp;";
+ QString title = i18n("Kile supports three kinds of conversion to png images");
+ QString tool1 = i18n("dvi --> png") + sep + i18n("(uses dvipng)");
+ QString tool2 = i18n("dvi --> ps --> png") + sep + i18n("(uses dvips/convert)");
+ QString tool3 = i18n("pdf --> png") + sep + i18n("(uses convert)");
+ QString description = QString("%1:<ul><li>%2<li>%3<li>%4</ul>").arg(title).arg(tool1).arg(tool2).arg(tool3);
+
+ QLabel *labelDescription = new QLabel(description, gbResolution);
+ QLabel *labelDvipng = new QLabel(i18n("dvipng:"), gbResolution);
+ QLabel *labelConvert = new QLabel(i18n("convert:"), gbResolution);
+ m_lbDvipng = new QLabel(gbResolution);
+ m_lbConvert = new QLabel(gbResolution);
+
+ resLayout->addWidget(resLabel,0,0);
+ resLayout->addWidget(m_leDvipngResolution,0,2);
+ resLayout->addWidget(resDpi,0,3);
+ resLayout->addWidget(resAllowed,0,5,Qt::AlignLeft);
+ resLayout->addMultiCellWidget(labelDescription,1,1,0,5);
+ resLayout->addWidget(labelDvipng,2,0);
+ resLayout->addWidget(m_lbDvipng,2,2);
+ resLayout->addWidget(labelConvert,3,0);
+ resLayout->addWidget(m_lbConvert,3,2);
+ resLayout->setColSpacing(1,8);
+ resLayout->setColSpacing(4,24);
+ resLayout->setColStretch(5,1);
+
+ m_gbPreview = new QGroupBox( i18n("Properties"), this, "gbpreview" );
+ m_gbPreview->setColumnLayout(0, Qt::Vertical );
+ m_gbPreview->layout()->setSpacing( 6 );
+ m_gbPreview->layout()->setMargin( 11 );
+ QGridLayout *previewLayout = new QGridLayout( m_gbPreview->layout() );
+ previewLayout->setAlignment( Qt::AlignTop );
+
+ QLabel *labelPreviewWidget = new QLabel(i18n("Show preview in bottom bar:"), m_gbPreview);
+ QLabel *labelPreviewType = new QLabel(i18n("Conversion to image:"), m_gbPreview);
+ QLabel *labelSelection = new QLabel(i18n("Selection:"), m_gbPreview);
+ QLabel *labelEnvironment = new QLabel(i18n("Environment:"), m_gbPreview);
+ QLabel *labelMathgroup = new QLabel(i18n("Mathgroup:"), m_gbPreview);
+ QLabel *labelSubdocument1 = new QLabel(i18n("Subdocument:"), m_gbPreview);
+ QLabel *labelSubdocument2 = new QLabel(i18n("Not available, opens always in a separate window."), m_gbPreview);
+ m_cbSelection = new QCheckBox(m_gbPreview);
+ m_cbEnvironment = new QCheckBox(m_gbPreview);
+ m_cbMathgroup = new QCheckBox(m_gbPreview);
+ m_coSelection = new KComboBox(false,m_gbPreview);
+ m_coEnvironment = new KComboBox(false,m_gbPreview);
+ m_lbMathgroup = new QLabel(i18n("Preview uses always 'dvipng'."), m_gbPreview);
+
+ previewLayout->addMultiCellWidget(labelPreviewWidget,0,0,0,2);
+ previewLayout->addWidget(labelPreviewType,0,4);
+ previewLayout->addWidget(labelSelection,1,0);
+ previewLayout->addWidget(m_cbSelection,1,2);
+ previewLayout->addWidget(m_coSelection,1,4);
+ previewLayout->addWidget(labelEnvironment,2,0);
+ previewLayout->addWidget(m_cbEnvironment,2,2);
+ previewLayout->addWidget(m_coEnvironment,2,4);
+ previewLayout->addWidget(labelMathgroup,3,0);
+ previewLayout->addWidget(m_cbMathgroup,3,2);
+ previewLayout->addMultiCellWidget(m_lbMathgroup,3,3,4,5,Qt::AlignLeft);
+ previewLayout->addWidget(labelSubdocument1,4,0);
+ previewLayout->addMultiCellWidget(labelSubdocument2,4,4,2,5,Qt::AlignLeft);
+ previewLayout->setRowSpacing(0,3*labelPreviewWidget->sizeHint().height()/2);
+ previewLayout->setRowSpacing(3,m_coEnvironment->sizeHint().height());
+ previewLayout->setColSpacing(1,12);
+ previewLayout->setColSpacing(3,40);
+ previewLayout->setColStretch(5,1);
+
+ vbox->addWidget(groupbox);
+ vbox->addWidget(gbResolution);
+ vbox->addWidget(m_gbPreview);
+ vbox->addStretch();
+
+ connect(m_cbEnvironment,SIGNAL(clicked()),this,SLOT(updateConversionTools()));
+ connect(m_cbSelection,SIGNAL(clicked()),this,SLOT(updateConversionTools()));
+ connect(m_cbMathgroup,SIGNAL(clicked()),this,SLOT(updateConversionTools()));
+}
+
+//////////////////// read/write configuration ////////////////////
+
+void KileWidgetPreviewConfig::readConfig(void)
+{
+ setupSeparateWindow();
+ setupBottomBar();
+ setupProperties();
+
+ updateConversionTools();
+}
+
+void KileWidgetPreviewConfig::writeConfig(void)
+{
+ KileConfig::setPreviewTask( m_combobox->currentText() );
+
+ bool ok;
+ QString resolution = m_leDvipngResolution->text();
+ int dpi = resolution.toInt(&ok);
+ if ( ok )
+ {
+ if ( dpi < 30 )
+ resolution = "30";
+ else if ( dpi > 1000 )
+ resolution = "1000";
+ KileConfig::setDvipngResolution( resolution );
+ }
+
+ if ( m_gbPreview->isEnabled() )
+ {
+ KileConfig::setSelPreviewInWidget( m_cbSelection->isChecked() );
+ KileConfig::setEnvPreviewInWidget( m_cbEnvironment->isChecked() );
+ KileConfig::setMathgroupPreviewInWidget( ( m_dvipngInstalled ) ? m_cbMathgroup->isChecked() : false );
+
+ KileConfig::setSelPreviewTool( index2tool(m_coSelection->currentItem()) );
+ KileConfig::setEnvPreviewTool( index2tool(m_coEnvironment->currentItem()) );
+ }
+ else
+ {
+ KileConfig::setEnvPreviewInWidget( false );
+ KileConfig::setSelPreviewInWidget( false );
+ }
+}
+
+void KileWidgetPreviewConfig::setupSeparateWindow()
+{
+ // get all possible tasks for QuickPreview in a separate window
+ QStringList tasklist;
+ m_preview->getTaskList(tasklist);
+
+ // split them into group and combobox entry
+ m_combobox->clear();
+ for ( uint i=0; i<tasklist.count(); ++i )
+ {
+ QStringList list = QStringList::split("=",tasklist[i]);
+ if ( m_config->hasGroup( list[0] ) )
+ {
+ m_combobox->insertItem( list[1] );
+ }
+ }
+
+ // set current task
+ m_combobox->setCurrentText( KileConfig::previewTask() );
+}
+
+void KileWidgetPreviewConfig::setupBottomBar()
+{
+ // setup resolution for QuickPreview in bottom bar
+ m_leDvipngResolution->setText( KileConfig::dvipngResolution() );
+
+ // setup tools
+ m_dvipngInstalled = KileConfig::dvipng();
+ m_convertInstalled = KileConfig::convert();
+
+ m_lbDvipng->setText( ( m_dvipngInstalled ) ? i18n("installed") : i18n("not installed") );
+ m_lbConvert->setText( ( m_convertInstalled ) ? i18n("installed") : i18n("not installed") );
+}
+
+void KileWidgetPreviewConfig::setupProperties()
+{
+ // setup properties for QuickPreview
+ m_cbSelection->setChecked( KileConfig::selPreviewInWidget() );
+ m_cbEnvironment->setChecked( KileConfig::envPreviewInWidget() );
+ m_cbMathgroup->setChecked( KileConfig::mathgroupPreviewInWidget() );
+
+ // setup conversion tools
+ QStringList toollist;
+ if ( m_dvipngInstalled )
+ {
+ toollist << i18n("dvi --> png");
+ }
+ else
+ {
+ m_cbMathgroup->setChecked( false );
+ m_cbMathgroup->setEnabled( false );
+ m_lbMathgroup->setText( i18n("Opens always in a separate window.") );
+ }
+ if ( m_convertInstalled )
+ {
+ toollist << i18n("dvi --> ps --> png");
+ toollist << i18n("pdf --> png");
+ }
+
+ // setup comboboxes
+ if ( installedTools() == 0 )
+ {
+ m_gbPreview->setEnabled(false);
+ }
+ else
+ {
+ m_coSelection->insertStringList(toollist);
+ m_coEnvironment->insertStringList(toollist);
+
+ m_coSelection->setCurrentItem( tool2index(KileConfig::selPreviewTool()) );
+ m_coEnvironment->setCurrentItem( tool2index(KileConfig::envPreviewTool()) );
+ }
+}
+
+//////////////////// manage tools ////////////////////
+
+// Tool is 0 (dvi->png), 1 (dvi->ps->png) or 2 (pdf->png).
+// But this may not be valid, when tools are not installed anymore.
+// So we have to calc a new index for the combobox
+// available = 0: doesn't matter, everything will be disabled
+// available = 1: only dvipng, so we use index 0
+// available = 2: only convert: 0->0, 1->0, 2->1
+// available = 3: dvipng/convert: index is valid
+
+int KileWidgetPreviewConfig::tool2index(int tool)
+{
+ int result = 0;
+
+ int available = installedTools();
+ if ( available == 3 )
+ result = tool;
+ else if ( available==2 && tool>0 )
+ result = tool - 1;
+
+ return result;
+}
+
+int KileWidgetPreviewConfig::index2tool(int index)
+{
+ int result = 0;
+
+ int available = installedTools();
+ if ( available == 3 )
+ result = index;
+ else if ( available == 2 )
+ result = index + 1;
+
+ return result;
+}
+
+// calc installed tools:
+// - 0 : no tools installed
+// - 1 : dvipng installed
+// - 2 : convert installed
+// - 3 : dvipng/convert installed
+
+int KileWidgetPreviewConfig::installedTools()
+{
+ int tools = 0;
+ if ( m_dvipngInstalled )
+ tools += 1;
+ if ( m_convertInstalled )
+ tools += 2;
+
+ return tools;
+}
+
+void KileWidgetPreviewConfig::updateConversionTools()
+{
+ m_coSelection->setEnabled( m_cbSelection->isChecked() );
+ m_coEnvironment->setEnabled( m_cbEnvironment->isChecked() );
+ if ( m_dvipngInstalled )
+ m_lbMathgroup->setEnabled( m_cbMathgroup->isChecked() );
+}
+
+#include "previewconfigwidget.moc"
diff --git a/src/kile/previewconfigwidget.h b/src/kile/previewconfigwidget.h
new file mode 100644
index 0000000..0bf907c
--- /dev/null
+++ b/src/kile/previewconfigwidget.h
@@ -0,0 +1,67 @@
+/***************************************************************************
+ date : Sep 05 2006
+ version : 0.32
+ copyright : (C) 2005-2006 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef PREVIEWCONFIGWIDGET_H
+#define PREVIEWCONFIGWIDGET_H
+
+#include "quickpreview.h"
+
+#include <qwidget.h>
+#include <qcheckbox.h>
+#include <qgroupbox.h>
+#include <kcombobox.h>
+#include <klineedit.h>
+#include <kconfig.h>
+
+/**
+ *@author Holger Danielsson
+ */
+
+class KileWidgetPreviewConfig : public QWidget
+{
+ Q_OBJECT
+public:
+ KileWidgetPreviewConfig(KConfig *config, KileTool::QuickPreview *preview, QWidget *parent=0, const char *name=0);
+ ~KileWidgetPreviewConfig() {}
+
+ void readConfig(void);
+ void writeConfig(void);
+
+private:
+ KConfig *m_config;
+ KComboBox *m_combobox;
+ KileTool::QuickPreview *m_preview;
+ KLineEdit *m_leDvipngResolution;
+ QLabel *m_lbDvipng, *m_lbConvert, *m_lbMathgroup;
+ QCheckBox *m_cbEnvironment, *m_cbSelection, *m_cbMathgroup;
+ KComboBox *m_coSelection, *m_coEnvironment;
+ QGroupBox *m_gbPreview;
+
+ bool m_dvipngInstalled, m_convertInstalled;
+
+ int tool2index(int tool);
+ int index2tool(int index);
+ int installedTools();
+
+ void setupSeparateWindow();
+ void setupBottomBar();
+ void setupProperties();
+
+private slots:
+ void updateConversionTools();
+};
+
+#endif
diff --git a/src/kile/previewwidget.cpp b/src/kile/previewwidget.cpp
new file mode 100644
index 0000000..a3b41ed
--- /dev/null
+++ b/src/kile/previewwidget.cpp
@@ -0,0 +1,179 @@
+//
+// C++ Implementation: previewwidget
+//
+// Description:
+//
+// Author: Mathias Soeken <msoeken@informatik.uni-bremen.de>, (C) 2006
+// (orginal version of this preview)
+//
+// dani/2006:
+// - signal/slot communication
+// - user defined resolution of the png image
+// - add '%res' to the dictionary of KileTools
+// - install three possible conversion methods: dvipng, dvips/convert for documents
+// with postscript source and convert for source, which needs the pdftex driver
+// - preview configuration dialog
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#include "previewwidget.h"
+
+#include <qimage.h>
+#include <qpainter.h>
+#include <qpalette.h>
+#include <qwidget.h>
+
+#include <klocale.h>
+#include <kate/view.h>
+#include <kate/document.h>
+
+#include "kileconfig.h"
+#include "kileedit.h"
+#include "kileinfo.h"
+#include "kileviewmanager.h"
+#include "kilelogwidget.h"
+#include "kiletool.h"
+#include "kiletool_enums.h"
+#include "quickpreview.h"
+
+namespace KileWidget
+{
+
+PreviewWidget::PreviewWidget(KileInfo *info, QWidget *parent, const char *name)
+ : QWidget(parent,name), m_info(info), m_previewImage(0L), m_running(false)
+{
+ setPalette( QPalette(QColor(0xff,0xff,0xff)) );
+}
+
+
+PreviewWidget::~PreviewWidget()
+{
+ delete m_previewImage;
+}
+
+void PreviewWidget::paintEvent(QPaintEvent*)
+{
+ QPainter p(this);
+ if ( m_previewImage )
+ p.drawImage(3,3,*m_previewImage);
+}
+
+void PreviewWidget::showActivePreview(const QString &text,const QString &textfilename,int startrow,int previewtype)
+{
+ KILE_DEBUG() << "==PreviewWidget::showActivePreview()==========================" << endl;
+ m_info->logWidget()->clear();
+ if ( m_running || m_info->quickPreview()->isRunning() )
+ {
+ showError( i18n("There is already a preview running, which you have to finish to run this one.") );
+ return;
+ }
+
+ // determine the type of conversion
+ int conversiontype;
+ switch ( previewtype )
+ {
+ case KileTool::qpSelection: conversiontype = KileConfig::selPreviewTool(); break;
+ case KileTool::qpEnvironment: conversiontype = KileConfig::envPreviewTool(); break;
+ default: conversiontype = pwDvipng; break;
+ }
+
+
+ // set parameter for these tools
+ QString tasklist,tool,toolcfg,extension;
+ if (conversiontype == pwConvert )
+ {
+ m_conversionTool = "convert";
+ tasklist = "PreviewPDFLaTeX,,,,,png";
+ tool = "Convert";
+ toolcfg = "pdf2png";
+ extension = "pdf";
+ }
+ else if (conversiontype == pwDvipsConvert )
+ {
+ m_conversionTool = "dvips/convert";
+ tasklist = "PreviewLaTeX,DVItoPS,dvi2eps,,,png";
+ tool = "Convert";
+ toolcfg = "eps2png";
+ extension = "eps";
+ }
+ else
+ {
+ m_conversionTool = "dvipng";
+ tasklist = "PreviewLaTeX,,,,,png";
+ tool = "DVItoPNG";
+ toolcfg = QString::null;
+ extension = "dvi";
+ }
+
+ if ( ! m_info->quickPreview()->run(text, textfilename, startrow, tasklist) )
+ return;
+
+ KileTool::Base *pngConverter = m_info->toolFactory()->create(tool);
+ if ( ! pngConverter )
+ {
+ showError( QString(i18n("Could not run '%1' for QuickPreview.").arg(tool)) );
+ return;
+ }
+ pngConverter->setSource(m_info->quickPreview()->getPreviewFile(extension));
+
+ // First, we have to disconnect the old done() signal, because this is
+ // passed immediately to the toolmanager, whichs destroys the tool. This
+ // means, that all connections, which are done later, will never been called.
+ disconnect(pngConverter, SIGNAL(done(Base*,int)), m_info->toolManager(), SLOT(done(Base*,int)));
+
+ // Now we make some new connections, which are called in this sequence:
+ // 1) when the tool is finished, the preview will be shown
+ // 2) then the done() signal can be passed to the toolmanager,
+ // which destroys the tool
+ connect(pngConverter, SIGNAL(done (Base*,int)), this, SLOT(drawImage()));
+ connect(pngConverter, SIGNAL(done(Base*,int)), m_info->toolManager(), SLOT(done(Base*,int)));
+
+ // Finally we will send a signal, which will pass the focus from the log window
+ // to the formula preview (dvipng --> toolmanager --> kile)
+ //
+ // Remark:
+ // It's also possible to use only (!) the destroyed() signal. This must be sent
+ // to the toolmanager, which passes it over to the kile object. This object can
+ // call drawImage() and after it, we have to set the focus to the preview widget.
+ // This can only be done from the kile object, which explains this indirect way.
+ //
+ // But i (dani) prefer the chosen way above, because
+ // - we can distinguish between drawImage() and focusPreview(), which may be
+ // important some time
+ // - it is more complicated
+ connect(pngConverter, SIGNAL(destroyed()), m_info->toolManager(), SIGNAL(previewDone()));
+ connect(pngConverter, SIGNAL(destroyed()), this, SLOT(toolDestroyed()));
+
+ // Now we are ready to start the process...
+ if ( m_info->toolManager()->run(pngConverter,toolcfg) == KileTool::Running )
+ m_running = true;
+}
+
+void PreviewWidget::drawImage()
+{
+ KILE_DEBUG() << "\tconversion tool '" << m_conversionTool << "' done, processing file (by dani)" << endl;
+ if ( ! m_previewImage )
+ delete m_previewImage;
+
+ m_previewImage = new QImage (m_info->quickPreview()->getPreviewFile ("png"));
+ setFixedSize( m_previewImage->width()+6,m_previewImage->height()+6 );
+
+ repaint ();
+}
+
+void PreviewWidget::toolDestroyed()
+{
+ KILE_DEBUG() << "\tQuickPreview: tool destroyed" << endl;
+ m_running = false;
+}
+
+void PreviewWidget::showError(const QString &text)
+{
+ m_info->logWidget()->printMsg( KileTool::Error, text, i18n("QuickPreview") );
+}
+
+}
+
+#include "previewwidget.moc"
diff --git a/src/kile/previewwidget.h b/src/kile/previewwidget.h
new file mode 100644
index 0000000..5eeb1b0
--- /dev/null
+++ b/src/kile/previewwidget.h
@@ -0,0 +1,102 @@
+//
+// C++ Interface: previewwidget
+//
+// Description:
+//
+//
+// Author: Mathias Soeken <msoeken@informatik.uni-bremen.de>, (C) 2006
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef PREVIEWWIDGET_H
+#define PREVIEWWIDGET_H
+
+#include <qwidget.h>
+
+class QImage;
+class QPaintEvent;
+
+class KileInfo;
+
+namespace KileTool
+{
+ class Base;
+}
+
+namespace KileWidget
+{
+
+/**
+ * Widget which can display PNG images from Math LaTeX
+ * Code
+ *
+ * This is used to be inserted in the bottom bar of the kile
+ * main widget. When putting the cursor in a mathgroup, the LaTeX
+ * source should be extracted and rendered in this widget.
+ *
+ * This widget uses one new Tool: DVItoPNG which converts
+ * a dvi file to an png image, which is fitted to the size
+ * of the formula).
+ *
+ * You could use this widget to implement a formula editor in Kile,
+ * where the editor is the editor, but with this widget you can see
+ * the result in a appropriate size just in time.
+ *
+ * @author Mathias Soeken <msoeken@informatik.uni-bremen.de>
+ */
+
+class PreviewWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ PreviewWidget(KileInfo *info, QWidget *parent = 0, const char *name = 0);
+ ~PreviewWidget();
+
+ /**
+ * Trys to paint the current mathgroup of
+ * the current document.
+ *
+ * If a document is open and the cursor is
+ * inside a mathgroup, a PNG is generated
+ * containing this mathgroup.
+ *
+ * This PNG image is then displayed on the
+ * widget.
+ */
+ void showActivePreview(const QString &text,const QString &textfilename,int startrow,int previewtype);
+
+private:
+ enum { pwDvipng=0, pwDvipsConvert, pwConvert };
+
+ KileInfo *m_info;
+ QImage *m_previewImage;
+ bool m_running;
+ QString m_conversionTool;
+
+protected:
+ void paintEvent (QPaintEvent*);
+ void showError(const QString &text);
+
+public slots:
+ /**
+ * Notify, if the DVItoPNG tool is done.
+ *
+ * Because the tool runs async. we
+ * must wait, if the process is done.
+ *
+ * Then we try to generate a image of the
+ * temporary PNG filename and display it on
+ * the widget.
+ *
+ * The size of the widget is also adjusted
+ * to the size of the widget.
+ */
+ void drawImage();
+ void toolDestroyed();
+};
+
+}
+
+#endif
diff --git a/src/kile/processtoolconfigwidget.ui b/src/kile/processtoolconfigwidget.ui
new file mode 100644
index 0000000..840a444
--- /dev/null
+++ b/src/kile/processtoolconfigwidget.ui
@@ -0,0 +1,98 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ProcessToolConfigWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ProcessToolConfigWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>383</width>
+ <height>79</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>m_leCommand</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>m_leOptions</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>m_lbOptions</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Options:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_leOptions</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_lbCommand</cstring>
+ </property>
+ <property name="text">
+ <string>Co&amp;mmand:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_leCommand</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>spacer17</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<layoutdefaults spacing="11" margin="11"/>
+</UI>
diff --git a/src/kile/quickdocumentdialog.cpp b/src/kile/quickdocumentdialog.cpp
new file mode 100644
index 0000000..caff295
--- /dev/null
+++ b/src/kile/quickdocumentdialog.cpp
@@ -0,0 +1,2330 @@
+/***************************************************************************
+date : Sep 15 2004
+version : 0.23
+copyright : Thomas Fischer <t-fisch@users.sourceforge.net>
+ restructured, improved and completed by Holger Danielsson
+ (C) 2004 by Holger Danielsson
+email : holger.danielsson@t-online.de
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "quickdocumentdialog.h"
+
+#include <qstringlist.h>
+#include <qtabwidget.h>
+#include <qlayout.h>
+#include <qwidget.h>
+#include <qcheckbox.h>
+#include <qlabel.h>
+#include <qlistbox.h>
+#include <qpainter.h>
+#include <qpalette.h>
+#include <qstyle.h>
+#include <qlistview.h>
+#include <qwhatsthis.h>
+#include <qregexp.h>
+
+#include <kcombobox.h>
+#include <klocale.h>
+#include <kconfig.h>
+#include <klineedit.h>
+#include <kiconloader.h>
+#include <kpushbutton.h>
+#include <kmessagebox.h>
+#include "kiledebug.h"
+
+#include "kileconfig.h"
+
+
+namespace KileDialog
+{
+enum {
+ qd_Base=1,
+ qd_Article=2,
+ qd_BookReport=4,
+ qd_KomaArticle=8,
+ qd_KomaBookReport=16,
+ qd_KomaAbstract=32,
+ qd_Prosper=64,
+ qd_Beamer=128
+};
+
+// list with index numbers for the stringlist with all information of a document class
+enum {
+ qd_Fontsizes,
+ qd_Papersizes,
+ qd_DefaultOptions,
+ qd_SelectedOptions,
+ qd_OptionsStart
+};
+
+//////////////////// ListBoxSeparator ////////////////////
+
+class ListBoxSeparator : public QListBoxItem
+{
+public:
+ ListBoxSeparator(int h);
+protected:
+ virtual void paint( QPainter * );
+ virtual int width( const QListBox* ) const { return listBox()->width(); }
+ virtual int height( const QListBox* ) const { return m_height; }
+private:
+ int m_height;
+};
+
+ListBoxSeparator::ListBoxSeparator(int h) : QListBoxItem(), m_height(h)
+{
+ // setText("-"); // not necessary, use QString::null
+ setCustomHighlighting( true );
+ setSelectable(false); // doesn't work here, so set it again after creating item
+}
+
+void ListBoxSeparator::paint(QPainter *painter)
+{
+// QRect r( 0, 0, width(listBox()), height(listBox()) );
+ painter->setPen(Qt::gray);
+ painter->drawLine(0,m_height/2+1,listBox()->width()-10,m_height/2+1);
+}
+
+//////////////////// EditableCheckListItem ////////////////////
+
+class EditableCheckListItem : public QCheckListItem
+{
+public:
+ EditableCheckListItem(QCheckListItem *parent, const QString &text);
+
+ virtual void paintCell(QPainter *p, const QColorGroup &cg,
+ int column, int width, int alignment );
+};
+
+EditableCheckListItem::EditableCheckListItem(QCheckListItem *parent, const QString &text)
+ : QCheckListItem(parent,text,QCheckListItem::CheckBox)
+{
+}
+
+void EditableCheckListItem::paintCell( QPainter *p, const QColorGroup &cg,
+ int column, int width, int alignment )
+{
+ if ( column == 1) {
+ QColorGroup colorgroup( cg );
+
+ QListViewItem *item = dynamic_cast<QListViewItem*>(this);
+ if ( item && (item->text(1)==i18n("<default>") || item->text(1)==i18n("<empty>")) ) {
+ colorgroup.setColor( QColorGroup::Text, Qt::gray );
+ colorgroup.setColor( QColorGroup::HighlightedText, Qt::gray );
+ }
+ QCheckListItem::paintCell( p, colorgroup, column, width, Qt::AlignHCenter );
+ } else {
+ QCheckListItem::paintCell( p, cg, column, width, alignment );
+ }
+}
+
+//////////////////// QuickDocument class ////////////////////
+
+QuickDocument::QuickDocument(KConfig *config, QWidget *parent, const char *name, const QString &caption) : Wizard(config, parent,name,caption)
+{
+ KILE_DEBUG() << "==QuickDocument::setupGUI()============" << endl;
+ QTabWidget *tabWidget = new QTabWidget( this );
+ setMainWidget(tabWidget);
+
+ tabWidget->addTab( setupClassOptions(tabWidget), i18n("Cla&ss Options"));
+ tabWidget->addTab( setupPackages(tabWidget), i18n("&Packages"));
+ tabWidget->addTab( setupProperties(tabWidget), i18n("&Document Properties"));
+
+ // read config file
+ readConfig();
+
+}
+
+QuickDocument::~QuickDocument()
+{}
+
+//////////////////// GUI ////////////////////
+
+QWidget *QuickDocument::setupClassOptions(QTabWidget *tab)
+{
+ KILE_DEBUG() << "\tsetupClassOptions" << endl;
+ QLabel *label;
+
+ QWidget *classOptions = new QWidget( tab );
+ QGridLayout *gl = new QGridLayout(classOptions, 6,4, marginHint(), spacingHint());
+ gl->setColStretch(1,1);
+
+ // Document classes
+ m_cbDocumentClass = new KComboBox(classOptions);
+ m_cbDocumentClass->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
+ m_cbDocumentClass->setDuplicatesEnabled(false);
+// m_cbDocumentClass->listBox()->setVariableHeight(true);
+ gl->addWidget(m_cbDocumentClass,0,1);
+ connect(m_cbDocumentClass, SIGNAL(activated(int)), this, SLOT(slotDocumentClassChanged(int)));
+
+ label = new QLabel(i18n("Doc&ument class:"), classOptions);
+ gl->addWidget(label,0,0);
+ label->setBuddy(m_cbDocumentClass); label->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
+
+ m_btnDocumentClassAdd = new KPushButton(SmallIcon("edit_add"), "", classOptions);
+ QWhatsThis::add(m_btnDocumentClassAdd, i18n("Add current text to this list"));
+ gl->addWidget(m_btnDocumentClassAdd,0,2);
+ connect(m_btnDocumentClassAdd, SIGNAL(clicked()), this, SLOT(slotDocumentClassAdd()));
+
+ m_btnDocumentClassDelete = new KPushButton(SmallIcon("eraser"), "", classOptions);
+ QWhatsThis::add(m_btnDocumentClassDelete, i18n("Remove current element from this list"));
+ gl->addWidget(m_btnDocumentClassDelete,0,3);
+ connect(m_btnDocumentClassDelete, SIGNAL(clicked()), this, SLOT(slotDocumentClassDelete()));
+
+ // Fontsize
+ m_cbTypefaceSize = new KComboBox(classOptions);
+ m_cbTypefaceSize->setDuplicatesEnabled(false);
+ gl->addWidget(m_cbTypefaceSize,1,1);
+
+ label = new QLabel(i18n("&Typeface size:"), classOptions);
+ label->setBuddy(m_cbTypefaceSize);
+ label->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
+ gl->addWidget(label,1,0);
+
+ m_btnTypefaceSizeAdd = new KPushButton(SmallIcon("edit_add"), "", classOptions);
+ QWhatsThis::add(m_btnTypefaceSizeAdd, i18n("Add current text to this list"));
+ gl->addWidget(m_btnTypefaceSizeAdd,1,2);
+ connect(m_btnTypefaceSizeAdd, SIGNAL(clicked()), this, SLOT(slotTypefaceSizeAdd()));
+
+ m_btnTypefaceSizeDelete = new KPushButton(SmallIcon("eraser"), "", classOptions);
+ QWhatsThis::add(m_btnTypefaceSizeDelete, i18n("Remove current element from this list"));
+ gl->addWidget(m_btnTypefaceSizeDelete,1,3);
+ connect(m_btnTypefaceSizeDelete, SIGNAL(clicked()), this, SLOT(slotTypefaceSizeDelete()));
+
+ // Papersize
+ m_cbPaperSize = new KComboBox(classOptions);
+ m_cbPaperSize->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
+ m_cbPaperSize->setDuplicatesEnabled(false);
+ gl->addWidget(m_cbPaperSize,2,1);
+
+ m_lbPaperSize = new QLabel(i18n("Paper si&ze:"), classOptions);
+ m_lbPaperSize->setBuddy(m_cbPaperSize);
+ m_lbPaperSize->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
+ gl->addWidget(m_lbPaperSize,2,0);
+
+ m_btnPaperSizeAdd = new KPushButton(SmallIcon("edit_add"), "", classOptions);
+ QWhatsThis::add(m_btnPaperSizeAdd, i18n("Add current text to this list"));
+ gl->addWidget(m_btnPaperSizeAdd,2,2);
+ connect(m_btnPaperSizeAdd, SIGNAL(clicked()), this, SLOT(slotPaperSizeAdd()));
+
+ m_btnPaperSizeDelete = new KPushButton(SmallIcon("eraser"), "", classOptions);
+ QWhatsThis::add(m_btnPaperSizeDelete, i18n("Remove current element from this list"));
+ gl->addWidget(m_btnPaperSizeDelete,2,3);
+ connect(m_btnPaperSizeDelete, SIGNAL(clicked()), this, SLOT(slotPaperSizeDelete()));
+
+ // Encoding
+ m_cbEncoding = new KComboBox(classOptions);
+ m_cbEncoding->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
+ m_cbEncoding->setDuplicatesEnabled(false);
+ gl->addWidget(m_cbEncoding,3,1);
+
+ label = new QLabel(i18n("E&ncoding:"), classOptions);
+ label->setBuddy(m_cbEncoding);
+ label->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
+ gl->addWidget(label,3,0);
+
+ // Class Options
+ m_lvClassOptions = new QListView(classOptions);
+ m_lvClassOptions->addColumn(i18n("Option"));
+ m_lvClassOptions->addColumn(i18n("Description"));
+ m_lvClassOptions->setAllColumnsShowFocus(true);
+ gl->addMultiCellWidget(m_lvClassOptions, 4,4, 1,3);
+ connect(m_lvClassOptions, SIGNAL(selectionChanged()),
+ this, SLOT(slotEnableButtons()));
+ connect(m_lvClassOptions, SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),
+ this, SLOT(slotOptionDoubleClicked(QListViewItem *,const QPoint &,int)));
+
+ label = new QLabel(i18n("Cl&ass options:"), classOptions);
+ label->setBuddy(m_lvClassOptions);
+ label->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding);
+ label->setAlignment(Qt::AlignTop);
+ gl->addWidget(label,4,0);
+
+ // button
+ QWidget *frame = new QWidget(classOptions);
+ QHBoxLayout *hl = new QHBoxLayout(frame, 0, spacingHint());
+ //hl->addStretch(1);
+ gl->addMultiCellWidget(frame, 5,5, 1,3, Qt::AlignCenter);
+
+ m_btnClassOptionsAdd = new KPushButton(SmallIcon("edit_add"), i18n("&Add..."), frame);
+ QWhatsThis::add(m_btnClassOptionsAdd, i18n("Add a new class option"));
+ hl->addWidget(m_btnClassOptionsAdd);
+ connect(m_btnClassOptionsAdd, SIGNAL(clicked()), this, SLOT(slotClassOptionAdd()));
+
+ m_btnClassOptionsEdit = new KPushButton(SmallIcon("edit"), i18n("Ed&it..."), frame);
+ QWhatsThis::add(m_btnClassOptionsEdit, i18n("Edit the current class option"));
+ hl->addWidget(m_btnClassOptionsEdit);
+ connect(m_btnClassOptionsEdit, SIGNAL(clicked()), this, SLOT(slotClassOptionEdit()));
+
+ m_btnClassOptionsDelete = new KPushButton(SmallIcon("eraser"), i18n("De&lete"), frame);
+ QWhatsThis::add(m_btnClassOptionsDelete, i18n("Remove the current class option"));
+ hl->addWidget(m_btnClassOptionsDelete);
+ connect(m_btnClassOptionsDelete, SIGNAL(clicked()), this, SLOT(slotClassOptionDelete()));
+
+ return classOptions;
+}
+
+QWidget *QuickDocument::setupPackages(QTabWidget *tab)
+{
+ KILE_DEBUG() << "\tsetupPackages" << endl;
+
+ QWidget *packages = new QWidget( tab );
+ QVBoxLayout *vl = new QVBoxLayout(packages, marginHint(), spacingHint());
+
+ QLabel *label = new QLabel(i18n("LaTe&X packages:"), packages);
+ vl->addWidget(label);
+ m_lvPackages = new QListView(packages);
+ vl->addWidget(m_lvPackages);
+ m_lvPackages->setRootIsDecorated(true);
+ m_lvPackages->addColumn(i18n("Package"));
+ m_lvPackages->addColumn(i18n("Value"));
+ m_lvPackages->addColumn(i18n("Description"));
+ m_lvPackages->setAllColumnsShowFocus(true);
+ label->setBuddy(m_lvPackages);
+ connect(m_lvPackages, SIGNAL(clicked(QListViewItem *)),
+ this, SLOT(slotCheckParent(QListViewItem *)));
+ connect(m_lvPackages, SIGNAL(spacePressed(QListViewItem *)),
+ this, SLOT(slotCheckParent(QListViewItem *)));
+ connect(m_lvPackages, SIGNAL(selectionChanged()),
+ this, SLOT(slotEnableButtons()));
+ connect(m_lvPackages, SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),
+ this, SLOT(slotPackageDoubleClicked(QListViewItem *,const QPoint &,int)));
+
+ QWidget *frame = new QWidget(packages);
+ vl->addWidget(frame);
+ QHBoxLayout *hl = new QHBoxLayout(frame, 0, spacingHint());
+ hl->addStretch(1);
+
+ m_btnPackagesAdd = new KPushButton(SmallIcon("edit_add"), "&Add Package...", frame);
+ QWhatsThis::add(m_btnPackagesAdd, i18n("Add a new package"));
+ connect(m_btnPackagesAdd, SIGNAL(clicked()), this, SLOT(slotPackageAdd()));
+ hl->addWidget(m_btnPackagesAdd);
+ m_btnPackagesAddOption = new KPushButton(SmallIcon("edit_add"), i18n("Add Op&tion..."), frame);
+ QWhatsThis::add(m_btnPackagesAddOption, i18n("Add a new package option"));
+ connect(m_btnPackagesAddOption, SIGNAL(clicked()), this, SLOT(slotPackageAddOption()));
+ hl->addWidget(m_btnPackagesAddOption);
+ m_btnPackagesEdit = new KPushButton(SmallIcon("edit"), "Ed&it...", frame);
+ QWhatsThis::add(m_btnPackagesEdit, i18n("Edit the current package option"));
+ connect(m_btnPackagesEdit, SIGNAL(clicked()), this, SLOT(slotPackageEdit()));
+ hl->addWidget(m_btnPackagesEdit);
+ m_btnPackagesDelete = new KPushButton(SmallIcon("eraser"), i18n("De&lete"), frame);
+ QWhatsThis::add(m_btnPackagesDelete, i18n("Remove the current package option"));
+ connect(m_btnPackagesDelete, SIGNAL(clicked()), this, SLOT(slotPackageDelete()));
+ hl->addWidget(m_btnPackagesDelete);
+ m_btnPackagesReset = new KPushButton(SmallIcon("reload"), i18n("&Reset to Defaults"), frame);
+ QWhatsThis::add(m_btnPackagesReset, i18n("Reset to the default list of packages"));
+ connect(m_btnPackagesReset, SIGNAL(clicked()), this, SLOT(slotPackageReset()));
+ hl->addWidget(m_btnPackagesReset);
+ hl->addStretch(1);
+
+ return packages;
+}
+
+QWidget *QuickDocument::setupProperties(QTabWidget *tab)
+{
+ KILE_DEBUG() << "\tsetupProperties" << endl;
+ QLabel *label;
+
+ QWidget *personalInfo = new QWidget( tab );
+ QGridLayout *gl = new QGridLayout(personalInfo, 4,2, marginHint(),spacingHint());
+ gl->setRowStretch(gl->numRows()-1, 1);
+
+ m_leAuthor = new KLineEdit(personalInfo);
+ gl->addWidget(m_leAuthor, 0, 1);
+ label = new QLabel(i18n("&Author:"), personalInfo);
+ gl->addWidget(label, 0, 0);
+ label->setBuddy(m_leAuthor);
+
+ m_leTitle = new KLineEdit(personalInfo);
+ gl->addWidget(m_leTitle, 1, 1);
+ label = new QLabel(i18n("&Title:"), personalInfo);
+ gl->addWidget(label, 1, 0);
+ label->setBuddy(m_leTitle);
+
+ m_leDate = new KLineEdit(personalInfo);
+ gl->addWidget(m_leDate, 2, 1);
+ label = new QLabel(i18n("Dat&e:"), personalInfo);
+ gl->addWidget(label, 2, 0);
+ label->setBuddy(m_leDate);
+
+ // set current date
+ m_leDate->setText( KGlobal::locale()->formatDate(QDate::currentDate(), true) );
+ // For KDE4:
+ //m_leDate->setText( KGlobal::locale()->formatDate(QDate::currentDate(), KLocale::ShortDate) );
+
+ return personalInfo;
+}
+
+//////////////////// read configuration ////////////////////
+
+void QuickDocument::readConfig()
+{
+ KILE_DEBUG() << "==QuickDocument::readConfig()============" << endl;
+
+ // read config for document class
+ readDocumentClassConfig();
+ // init the current document class
+ initDocumentClass();
+
+ // read config for packages
+ readPackagesConfig();
+ initHyperref();
+
+ // read author
+ m_leAuthor->setText(KileConfig::author());
+
+}
+
+//////////////////// write configuration ////////////////////
+
+void QuickDocument::writeConfig()
+{
+ KILE_DEBUG() << "==QuickDocument::writeConfig()============" << endl;
+
+ // write document class to config file
+ writeDocumentClassConfig();
+
+ // write packages to config file
+ writePackagesConfig();
+
+ // set author
+ KileConfig::setAuthor(m_leAuthor->text());
+}
+
+////////////////////////////// document class tab //////////////////////////////
+
+void QuickDocument::readDocumentClassConfig()
+{
+ KILE_DEBUG() << "\tread config: document class" << endl;
+
+ // read standard options
+ m_userClasslist = KileConfig::userClasses();
+ m_currentClass = KileConfig::documentClass();
+ m_currentEncoding = KileConfig::encoding();
+
+ // init standard classes
+ QString stdFontsize = "10pt,11pt,12pt";
+ QString stdPapersize = "a4paper,a5paper,b5paper,executivepaper,legalpaper,letterpaper";
+ QString beamerThemes = "bars;boxes;classic;lined;plain;sidebar;sidebar (dark);sidebar (tab);"
+ "sidebar (dark,tab);shadow;split;tree;tree (bar)";
+
+ initStandardClass( "article",stdFontsize,stdPapersize,
+ "10pt,letterpaper,oneside,onecolumn,final",
+ KileConfig::optionsArticle() );
+ initStandardClass( "book",stdFontsize,stdPapersize,
+ "10pt,letterpaper,twoside,onecolumn,final,openright",
+ KileConfig::optionsBook() );
+ initStandardClass( "letter",stdFontsize,stdPapersize,
+ "10pt,letterpaper,oneside,onecolumn,final",
+ KileConfig::optionsLetter() );
+ initStandardClass( "report",stdFontsize,stdPapersize,
+ "10pt,letterpaper,oneside,onecolumn,final,openany",
+ KileConfig::optionsReport() );
+ initStandardClass( "scrartcl",stdFontsize,stdPapersize,
+ "11pt,a4paper,abstractoff,bigheadings,final,headnosepline,"
+ "footnosepline,listsindent,onelinecaption,notitlepage,onecolumn,"
+ "oneside,openany,parindent,tablecaptionbelow,tocindent",
+ KileConfig::optionsScrartcl() );
+ initStandardClass( "scrbook",stdFontsize,stdPapersize,
+ "11pt,a4paper,bigheadings,final,headnosepline,footnosepline,"
+ "listsindent,nochapterprefix,onelinecaption,onecolumn,"
+ "openright,parindent,tablecaptionbelow,titlepage,tocindent,twoside",
+ KileConfig::optionsScrbook() );
+ initStandardClass( "scrreprt",stdFontsize,stdPapersize,
+ "11pt,a4paper,abstractoff,bigheadings,final,headnosepline,"
+ "footnosepline,listsindent,nochapterprefix,onelinecaption,onecolumn,"
+ "oneside,openany,parindent,tablecaptionbelow,titlepage,tocindent",
+ KileConfig::optionsScrreprt() );
+ initStandardClass( "prosper",QString::null,QString::null,
+ "final,slideBW,total,nocolorBG,ps,noaccumulate,ps2pdf",
+ KileConfig::optionsProsper() );
+ initStandardClass( "beamer","8pt,9pt,10pt,11pt,12pt,14pt,17pt,20pt",beamerThemes,
+ "11pt,blue,notes=show,sans,slidescentered",
+ KileConfig::optionsBeamer() );
+
+ // init all user classes
+ for ( uint i=0; i<m_userClasslist.count(); ++i )
+ {
+ KILE_DEBUG() << "\tinit user class: " << m_userClasslist[i] << endl;
+ QStringList list;
+ // read dour default entries for this user class
+ m_config->setGroup( QString("QuickDocument/")+m_userClasslist[i] );
+ list.append( m_config->readEntry("fontsizesList") );
+ list.append( m_config->readEntry("pagesizesList") );
+ list.append( m_config->readEntry("defaultOptions") );
+ list.append( m_config->readEntry("selectedOptions") );
+ // now read all user defined options
+ QStringList options = QStringList::split(",", m_config->readEntry("options") );
+ for ( uint j=0; j<options.count(); ++j ) {
+ list.append( options[j] + " => " + m_config->readEntry(options[j]) );
+ }
+
+ // save all information of this class into the documentClass-dictionary
+ m_dictDocumentClasses[ m_userClasslist[i] ] = list;
+ }
+
+ // set classes combobox (standard and user defined classes)
+ fillDocumentClassCombobox();
+
+ // set encoding combobox
+ fillCombobox(m_cbEncoding,
+ "ansinew,applemac,ascii,cp1252,cp1250,cp1251,cp1257,cp437,cp437de,cp850,cp858,"
+ "cp852,cp865,decmulti,koi8-r,latin1,latin2,latin3,latin4,latin5,latin9,latin10,next,utf8,utf8x,utf-8,utfcyr",
+ m_currentEncoding);
+}
+
+void QuickDocument::fillDocumentClassCombobox()
+{
+ QString stdClasses = "article,book,letter,report,-,scrartcl,scrbook,scrreprt,-";
+ QString stdUserClasses = "beamer,prosper";
+
+ // set classes combobox (standard and user defined classes)
+ QStringList classlist = QStringList::split(",",stdUserClasses);
+ for ( uint i=0; i< m_userClasslist.count(); ++i )
+ classlist.append( m_userClasslist[i] );
+ classlist.sort();
+ fillCombobox(m_cbDocumentClass,stdClasses + ',' + classlist.join(","),m_currentClass);
+}
+
+void QuickDocument::writeDocumentClassConfig()
+{
+ KILE_DEBUG() << "\twrite config: document class" << endl;
+
+ // first delete all marked document classes
+ for ( uint i=0; i<m_deleteDocumentClasses.count(); ++i ) {
+ KILE_DEBUG() << "\tdelete class: " << m_deleteDocumentClasses[i] << endl;
+ m_config->deleteGroup( QString("QuickDocument/")+m_deleteDocumentClasses[i] );
+ }
+
+ // write document classes and encoding
+ QStringList userclasses;
+ for ( int i=0; i<m_cbDocumentClass->count(); ++i) {
+ if ( !m_cbDocumentClass->text(i).isEmpty() && !isStandardClass(m_cbDocumentClass->text(i)) ) {
+ userclasses.append( m_cbDocumentClass->text(i) );
+ }
+ }
+ KileConfig::setUserClasses(userclasses);
+ KileConfig::setDocumentClass(m_cbDocumentClass->currentText());
+ KileConfig::setEncoding(m_cbEncoding->currentText());
+
+ // write checked options of standard classes
+ KILE_DEBUG() << "\twrite standard classes" << endl;
+ KileConfig::setOptionsArticle( m_dictDocumentClasses["article"][qd_SelectedOptions] );
+ KileConfig::setOptionsBook( m_dictDocumentClasses["book"][qd_SelectedOptions] );
+ KileConfig::setOptionsLetter( m_dictDocumentClasses["letter"][qd_SelectedOptions] );
+ KileConfig::setOptionsReport( m_dictDocumentClasses["report"][qd_SelectedOptions] );
+ KileConfig::setOptionsScrartcl( m_dictDocumentClasses["scrartcl"][qd_SelectedOptions] );
+ KileConfig::setOptionsScrbook( m_dictDocumentClasses["scrbook"][qd_SelectedOptions] );
+ KileConfig::setOptionsScrreprt( m_dictDocumentClasses["scrreprt"][qd_SelectedOptions] );
+ KileConfig::setOptionsProsper( m_dictDocumentClasses["prosper"][qd_SelectedOptions] );
+ KileConfig::setOptionsBeamer( m_dictDocumentClasses["beamer"][qd_SelectedOptions] );
+
+ // write config of user packages
+ QRegExp reg("(\\S+)\\s+=>\\s+(.*)");
+ for ( uint i=0; i< userclasses.count(); ++i ) {
+ // get the stringlist with all information
+ KILE_DEBUG() << "\twrite user class: " << userclasses[i] << endl;
+ QStringList list = m_dictDocumentClasses[ userclasses[i] ];
+
+ // write the config group and the default entries
+ m_config->setGroup( QString("QuickDocument/")+userclasses[i] );
+ m_config->writeEntry("fontsizesList",list[qd_Fontsizes]);
+ m_config->writeEntry("pagesizesList",list[qd_Papersizes]);
+ m_config->writeEntry("defaultOptions",list[qd_DefaultOptions]);
+ m_config->writeEntry("selectedOptions",list[qd_SelectedOptions]);
+
+ // write user defined options
+ QString options;
+ for ( uint j=qd_OptionsStart; j<list.count(); ++j ) {
+ int pos = reg.search( list[j] );
+ if ( pos != -1 ) {
+ m_config->writeEntry( reg.cap(1),reg.cap(2) );
+ if ( ! options.isEmpty() )
+ options += ',';
+ options += reg.cap(1);
+ }
+ }
+ m_config->writeEntry("options",options);
+ }
+}
+
+void QuickDocument::initDocumentClass()
+{
+ KILE_DEBUG() << "==QuickDocument::initDocumentClass()============" << endl;
+ KILE_DEBUG() << "\tset class: " << m_currentClass << endl;
+
+ // get the stringlist of this class with all information
+ QStringList classlist = m_dictDocumentClasses[m_currentClass];
+
+ // First of all, we have to set the defaultOptions-dictionary and the
+ // selectedOptions-dictionary for this class, before inserting options
+ // into the listview. The function setClassOptions() will look
+ // into both dictionaries to do some extra work.
+ setDefaultClassOptions( classlist[qd_DefaultOptions] );
+ setSelectedClassOptions( classlist[qd_SelectedOptions] );
+
+ // set comboboxes for fontsizes and papersizes
+ fillCombobox(m_cbTypefaceSize,classlist[qd_Fontsizes],m_currentFontsize);
+ fillCombobox(m_cbPaperSize,classlist[qd_Papersizes],m_currentPapersize);
+
+ // now we are ready to set the class options
+ if ( isStandardClass(m_currentClass) ) {
+ QStringList optionlist;
+ initStandardOptions(m_currentClass,optionlist);
+ setClassOptions(optionlist,0);
+ } else {
+ setClassOptions(classlist,qd_OptionsStart);
+ }
+
+ // there is no papersize with class beamer, but a theme
+ if ( m_currentClass == "beamer" )
+ m_lbPaperSize->setText( i18n("&Theme:") );
+ else
+ m_lbPaperSize->setText( i18n("Paper si&ze:") );
+
+ // enable/disable buttons to add or delete entries
+ slotEnableButtons();
+}
+
+void QuickDocument::initStandardClass(const QString &classname,
+ const QString &fontsize, const QString &papersize,
+ const QString &defaultoptions, const QString &selectedoptions)
+{
+ KILE_DEBUG() << "\tinit standard class: " << classname << endl;
+
+ // remember that this is a standard class
+ m_dictStandardClasses[ classname ] = true;
+
+ // save all entries
+ QStringList list;
+ list << fontsize << papersize << defaultoptions << selectedoptions;
+
+ // save in documentClass-dictionary
+ m_dictDocumentClasses[ classname ] = list;
+}
+
+// build all option for the current standard class
+void QuickDocument::initStandardOptions(const QString &classname,QStringList &optionlist)
+{
+ // build the bitcode for all options of this class
+ int options;
+ if ( classname == "article" )
+ options = qd_Base + qd_Article;
+ else if ( classname == "book" )
+ options = qd_Base + qd_Article + qd_BookReport;
+ else if ( classname == "letter" )
+ options = qd_Base;
+ else if ( classname == "report" )
+ options = qd_Base + qd_Article + qd_BookReport;
+ else if ( classname == "scrartcl" )
+ options = qd_Base + qd_Article + qd_KomaArticle + qd_KomaAbstract;
+ else if ( classname == "scrbook" )
+ options = qd_Base + qd_Article + qd_BookReport + qd_KomaArticle + qd_KomaBookReport;
+ else if ( classname == "scrreprt" )
+ options = qd_Base + qd_Article + qd_BookReport + qd_KomaArticle + qd_KomaAbstract + qd_KomaBookReport;
+ else if ( classname == "prosper" )
+ options = qd_Prosper;
+ else if ( classname == "beamer" )
+ options = qd_Beamer;
+ else
+ return;
+
+ // insert all options into the list
+ if ( options & qd_Base ) {
+ optionlist
+ << QString("landscape => ") + i18n("Sets the document's orientation to landscape")
+ << QString("oneside => ") + i18n("Margins are set for single side output")
+ << QString("twoside => ") + i18n("Left and right pages differ in page margins")
+ << QString("draft => ") + i18n("Marks \"overfull hboxes\" on the output with black boxes")
+ << QString("final => ") + i18n("No special marks for \"overfull hboxes\" on the output")
+ << QString("leqno => ") + i18n("Puts formula numbers on the left side")
+ << QString("fleqn => ") + i18n("Aligns formulas on the left side")
+ ;
+ }
+
+ if ( options & qd_Article ) {
+ optionlist
+ << QString("titlepage => ") + i18n("Puts title and abstract on an extra page")
+ << QString("notitlepage => ") + i18n("Puts title and abstract on the same page as the text")
+ << QString("onecolumn => ") + i18n("Puts the text in one column")
+ << QString("twocolumn => ") + i18n("Puts the text in two columns")
+ << QString("openbib => ") + i18n("Formats the bibliography in open style")
+ ;
+ }
+
+ if ( options & qd_BookReport ) {
+ optionlist
+ << QString("openany => ") + i18n("Chapters may start on top of every page")
+ << QString("openright => ") + i18n("Chapters may only start on top of right pages")
+ ;
+ }
+
+ if ( options & qd_KomaArticle ) {
+ optionlist
+ << QString("headinclude => ") + i18n("Cause the header to be counted as text")
+ << QString("headexclude => ") + i18n("Cause the header to be counted as border")
+ << QString("footinclude => ") + i18n("Cause the footer to be counted as text")
+ << QString("footexclude => ") + i18n("Cause the footer to be counted as border")
+ << QString("mpinclude => ") + i18n("Cause the margin-note to be counted to the text body")
+ << QString("mpexclude => ") + i18n("The normal margin is used for the margin-note area")
+ << QString("dvips => ") + i18n("Writes the paper size as a special into the DVI-file")
+ << QString("pdftex => ") + i18n("Writes the paper size into the pdftex page register")
+ << QString("pagesize => ") + i18n("Uses the correct mechanism with PDF- or DVI-file")
+ << QString("cleardoubleempty => ") + i18n("Enables the default for an empty left page")
+ << QString("cleardoubleplain => ") + i18n("An empty left page will set with the plain-pagestyle")
+ << QString("cleardoublestandard => ") + i18n("An empty left page will set with the empty-pagestyle")
+ << QString("headsepline => ") + i18n("Use a line to separate the header from the text body")
+ << QString("headnosepline => ") + i18n("Use no line to separate the header from the text body")
+ << QString("footsepline => ") + i18n("Use a line to separate the footer from the text body")
+ << QString("footnosepline => ") + i18n("Use no line to separate the footer from the text body")
+ << QString("parskip => ") + i18n("Normal paragraph spacing of one line")
+ << QString("parskip- => ") + i18n("Normal spacing, at least 1/3 of the last line is free")
+ << QString("parskip+ => ") + i18n("Normal spacing, at least 1/4 of the last line is free")
+ << QString("parskip* => ") + i18n("Normal spacing, no special provision for the last line")
+ << QString("halfparskip => ") + i18n("Paragraph spacing of half a line")
+ << QString("halfparskip- => ") + i18n("Spacing 1/2 line, at least 1/3 of the last line is free")
+ << QString("halfparskip+ => ") + i18n("Spacing 1/2 line, at least 1/4 of the last line is free")
+ << QString("halfparskip* => ") + i18n("Spacing 1/2 line, no special provision for the last line")
+ << QString("parindent => ") + i18n("No spacing between paragraphs, indent the first line by 1 em")
+ << QString("onelinecaption => ") + i18n("One-line captions are centered, multi-line left-justified")
+ << QString("noonelinecaption => ") + i18n("No special handling of one-line captions")
+ << QString("bigheading => ") + i18n("Normal great title font sizes")
+ << QString("normalheadings => ") + i18n("Small font sizes for titles")
+ << QString("smallheadings => ") + i18n("Even smaller font sizes for titles")
+ << QString("liststotoc => ") + i18n("Include lists of figures and tables in the TOC")
+ << QString("bibtotoc => ") + i18n("Include the bibliography in the TOC")
+ << QString("idxtotoc => ") + i18n("Include the index in the TOC")
+ << QString("liststotocnumbered => ") + i18n("Number the lists of figures and tables in the TOC")
+ << QString("bibtotocnumbered => ") + i18n("Number the bibliography in the TOC")
+ << QString("tocleft => ") + i18n("All numbers and titles are set in a left-justified column")
+ << QString("tocindent => ") + i18n("Different sectional units have different indentations")
+ << QString("listsleft => ") + i18n("All numbers and captions are set in a left-justified column")
+ << QString("listsindent => ") + i18n("All Numbers uses a fixed space")
+ << QString("pointednumbers => ") + i18n("Numbering of sectional units have a point at the end")
+ << QString("pointlessnumbers => ") + i18n("Numbering of sectional units have no point at the end")
+ << QString("tablecaptionabove => ") + i18n("Caption command acts like \\captionabove")
+ << QString("tablecaptionbelow => ") + i18n("Caption command acts like \\captionbelow")
+ << QString("origlongtable => ") + i18n("Captions of the longtable package should not be redefined")
+ ;
+ }
+
+ if ( options & qd_KomaBookReport ) {
+ optionlist
+ << QString("chapterprefix => ") + i18n("Use a separate line for the chapter number")
+ << QString("nochapterprefix => ") + i18n("Use the same line for the chapter number and title")
+ << QString("appendixprefix => ") + i18n("Use a separate line for the appendix name")
+ << QString("noappendixprefix => ") + i18n("No separate line for the appendix name")
+ ;
+ }
+
+ if ( options & qd_KomaAbstract ) {
+ optionlist
+ << QString("abstracton => ") + i18n("Include the abstract's title")
+ << QString("abstractoff => ") + i18n("Exclude the abstract's title")
+ ;
+ }
+
+ if ( options & qd_Prosper ) {
+ optionlist
+ << QString("draft => ") + i18n("The file is compiled in draft mode")
+ << QString("final => ") + i18n("The file is compiled in final mode")
+ << QString("slideColor => ") + i18n("Slides will use many colors")
+ << QString("slideBW => ") + i18n("Slides will use a restricted set of colors")
+ << QString("total => ") + i18n("Display the number of the current slide and the total number")
+ << QString("nototal => ") + i18n("Display only the number of the current slide")
+ << QString("nocolorBG => ") + i18n("The background of the slide is always white")
+ << QString("colorBG => ") + i18n("The color of the background depends on the current style")
+ << QString("ps => ") + i18n("The LaTeX file is compiled to produce a PostScript file")
+ << QString("pdf => ") + i18n("The LaTeX file is compiled to produce a PDF file")
+ << QString("accumulate => ") + i18n("Some macros interpret their argument in ps mode")
+ << QString("noaccumulate => ") + i18n("Some macros do not interpret their argument in ps mode")
+ << QString("distiller => ") + i18n("The PS file is to be translated into a PDF file using Adobe Distiller")
+ << QString("YandY => ") + i18n("The LaTeX file is to be processed with YandY LaTeX")
+ << QString("ps2pdf => ") + i18n("The PS file is to be translated into a PDF file using ps2pdf")
+ << QString("vtex => ") + i18n("The LaTeX file is to be processed with MicroPress VTeX")
+ << QString("noFooter => ") + i18n("Do not add any caption at the bottom of the slides")
+ ;
+ }
+
+ if ( options & qd_Beamer ) {
+ optionlist
+ << QString("slidestop => ") + i18n("Place text of slides at the (vertical) top of the slides")
+ << QString("slidescentered => ") + i18n("Place text of slides at the (vertical) center of the slides")
+ << QString("draft => ") + i18n("Headlines, footlines, and sidebars are replaced by gray rectangles")
+ << QString("compress => ") + i18n("Make all navigation bars as small as possible")
+ << QString("usepdftitle=false => ") + i18n("Suppresses generation of some entries in the pdf information")
+ << QString("notheorems => ") + i18n("Switches off the definition of default blocks like theorem")
+ << QString("noamsthm => ") + i18n("Does not load amsthm and amsmath")
+ << QString("CJK => ") + i18n("Needed when using the CJK package for Asian fonts")
+ << QString("sans => ") + i18n("Use a sans-serif font during the presentation")
+ << QString("serif => ") + i18n("Use a serif font during the presentation")
+ << QString("mathsans => ") + i18n("Override the math font to be a sans-serif font")
+ << QString("mathserif => ") + i18n("Override the math font to be a serif font")
+ << QString("professionalfont => ") + i18n("Deactivate internal font replacements for math text")
+ << QString("handout => ") + i18n("Create a PDF handout")
+ << QString("trans => ") + i18n("For PDF transparency")
+ << QString("blue => ") + i18n("All structure elements are typeset in blue")
+ << QString("red => ") + i18n("All structure elements are typeset in red")
+ << QString("blackandwhite => ") + i18n("All structure elements are typeset in black and white")
+ << QString("brown => ") + i18n("All structure elements are typeset in brown")
+ << QString("notes=hide => ") + i18n(" Notes are not shown")
+ << QString("notes=show => ") + i18n(" Include notes in the output file")
+ << QString("notes=only => ") + i18n(" Include only notes and suppress frames")
+ ;
+ }
+}
+
+// check for a standard class
+bool QuickDocument::isStandardClass(const QString &classname)
+{
+ return m_dictStandardClasses.contains(classname);
+}
+
+// check for a default option
+bool QuickDocument::isDefaultClassOption(const QString &option)
+{
+ return m_currentDefaultOptions.contains(option);
+}
+
+// check for an user option
+bool QuickDocument::isSelectedClassOption(const QString &option)
+{
+ return m_currentSelectedOptions.contains(option);
+}
+
+// insert all default options of the current class into the defaultOptions-dictionary
+void QuickDocument::setDefaultClassOptions(const QString &defaultoptions)
+{
+ QStringList list = QStringList::split(",",defaultoptions);
+ m_currentDefaultOptions.clear();
+ for ( uint i=0; i<list.count(); ++i ) {
+ if ( ! list[i].isEmpty() )
+ m_currentDefaultOptions[ list[i] ] = true;
+ }
+}
+
+// insert all checked options of the current class into the selectedOptions-dictionary
+void QuickDocument::setSelectedClassOptions(const QString &selectedoptions)
+{
+ KILE_DEBUG() << "\tset options: " << selectedoptions << endl;
+
+ QStringList list = QStringList::split(",",selectedoptions);
+ uint nlist = list.count();
+
+ m_currentFontsize = ( nlist >= 1 ) ? list[0] : "";
+ m_currentPapersize = ( nlist >= 2 ) ? list[1] : "";
+
+ m_currentSelectedOptions.clear();
+ for ( uint i=0; i<nlist; ++i ) {
+ if ( ! list[i].isEmpty() )
+ m_currentSelectedOptions[ list[i] ] = true;
+ }
+}
+
+// show all options of the current class
+// - split this string into option and description (option => description)
+// - if the option is in the defaultOptions-dictionary, add 'default'
+// - if the option is in the selectedOptions-dictionary, set the 'checked' symbol
+void QuickDocument::setClassOptions(const QStringList &list, uint start)
+{
+ QRegExp reg("(\\S+)\\s+=>\\s+(.*)");
+
+ m_lvClassOptions->clear();
+ for (uint i=start; i<list.count(); ++i) {
+ int pos = reg.search( list[i] );
+ if ( pos != -1 ) {
+ QCheckListItem *cli = new QCheckListItem(m_lvClassOptions, reg.cap(1), QCheckListItem::CheckBox);
+
+ // see if it is a default option
+ if ( isDefaultClassOption(reg.cap(1)) )
+ cli->setText(1, reg.cap(2)+" [default]");
+ else
+ cli->setText(1, reg.cap(2));
+
+ // check it if this option is set by th user
+ if ( isSelectedClassOption(reg.cap(1)) )
+ cli->setOn(true);
+ }
+ }
+}
+
+// get all options of the current class as a comma separated list
+// - first entry: always the current fontsize
+// - second entry: always the current papersize
+// - followed by all other checked options
+QString QuickDocument::getClassOptions()
+{
+ QString fontsize = stripDefault( m_cbTypefaceSize->currentText() );
+ QString papersize = stripDefault( m_cbPaperSize->currentText() );
+
+ QString options = fontsize + ',' + papersize;
+
+ for (QListViewItem *cur = m_lvClassOptions->firstChild(); cur; cur=cur->nextSibling()) {
+ QCheckListItem *cli = dynamic_cast<QCheckListItem*>(cur);
+ if (cli && cli->isOn()) {
+ options += ',' + cur->text(0);
+ }
+ }
+
+ return options;
+}
+
+// Some changes were made in the listview: add, edit oder delete entries.
+// This means that the defaultOptions-dictionary, the selectedOptions-dictionary
+// and the list of all options may be . So the documentClass-dictionary,
+// the defaultOptions-dictionary and the selectedOptions-dictionary must be updated.
+void QuickDocument::updateClassOptions()
+{
+ KILE_DEBUG() << "==QuickDocument::updateClassOptions()============" << endl;
+ KILE_DEBUG() << "\tclass: " << m_currentClass << endl;
+
+ QString defaultoptions;
+ QStringList newlist;
+ QStringList oldlist = m_dictDocumentClasses[m_currentClass];
+
+ // read the first four static entries
+ newlist << oldlist[qd_Fontsizes];
+ newlist << oldlist[qd_Papersizes];
+ newlist << QString::null; // dummy entry: will be changed
+ newlist << getClassOptions();
+
+ // read all options
+ for (QListViewItem *cur = m_lvClassOptions->firstChild(); cur; cur=cur->nextSibling()) {
+ QCheckListItem *cli = dynamic_cast<QCheckListItem*>(cur);
+ if ( cli ) {
+ QString description = cur->text(1);
+ if ( description.right(10) == " [default]" ) {
+ description = stripDefault(description);
+ if ( ! defaultoptions.isEmpty() )
+ defaultoptions += ',';
+ defaultoptions += cur->text(0);
+ }
+ newlist += cur->text(0) + " => " + description;
+ }
+ }
+
+ // update list entry with defaultoptions
+ newlist[qd_DefaultOptions] = defaultoptions;
+
+ // insert this changed list into the documentClass-dictionary
+ m_dictDocumentClasses[m_currentClass] = newlist;
+
+ // update other dictionaries
+ setDefaultClassOptions(newlist[qd_DefaultOptions]);
+ setSelectedClassOptions(newlist[qd_SelectedOptions]);
+}
+
+
+// Insert all entries from a comma separated list into a combobox.
+// If this entry matches a given text, this entry will be activated.
+void QuickDocument::fillCombobox(KComboBox *combo, const QString &cslist, const QString &seltext)
+{
+ bool documentclasscombo = ( combo == m_cbDocumentClass );
+ QListBox *listbox = combo->listBox();
+
+ QString sep = ( m_currentClass=="beamer" && combo==m_cbPaperSize ) ? ";" : ",";
+ QStringList list = QStringList::split(sep,cslist);
+ if ( ! documentclasscombo )
+ list.sort();
+
+ combo->clear();
+ for (uint i=0; i<list.count(); ++i) {
+ if ( !documentclasscombo && isDefaultClassOption(list[i]) )
+ combo->insertItem( QString(list[i]) + " [default]" );
+ else if ( list[i] != "-" )
+ combo->insertItem( list[i] );
+ else
+ {
+ ListBoxSeparator *separator = new ListBoxSeparator(listbox->item(0)->height(listbox));
+ listbox->insertItem(separator);
+ // doesn't work in constructor, so set it again here
+ separator->setSelectable(false);
+ }
+
+ // should this entry be selected?
+ if ( !seltext.isEmpty() && list[i]==seltext )
+ combo->setCurrentItem(i);
+ }
+}
+
+// Add some entries from a comma separated list to a sorted combobox.
+// The new entries must match a regular expression or will be denied.
+bool QuickDocument::addComboboxEntries(KComboBox *combo, const QString &title,const QString &entry)
+{
+ // read current comboxbox entries
+ QStringList combolist;
+ for (int i=0; i<combo->count(); ++i)
+ combolist += combo->text(i);
+
+ // add new entries (one or a comma separated list)
+ QStringList list = QStringList::split(",",entry);
+ for ( uint i=0; i<list.count(); ++i ) {
+ QString s = list[i].stripWhiteSpace();
+ // entries must match a regular expression
+ if ( combolist.findIndex(s) != -1 )
+ KMessageBox::error( this, i18n("%1 '%2' already exists.").arg(title).arg(s) );
+ else {
+ combolist += s;
+ KILE_DEBUG() << "\tinsert new " << title << ": " << s << endl;
+ }
+ }
+
+ // insert list, if there are more entries than before
+ if ( combolist.count() > (uint)combo->count() ) {
+ fillCombobox(combo,combolist.join(","),list[0]);
+ return true;
+ } else {
+ return false;
+ }
+
+}
+
+QString QuickDocument::getComboxboxList(KComboBox *combo)
+{
+ QStringList list;
+ for ( int i=0; i<combo->count(); ++i ) {
+ list += combo->text(i);
+ }
+
+ return ( list.count() > 0 ) ? list.join(",") : QString::null;
+}
+
+// strip an optional default-tag from the string
+QString QuickDocument::stripDefault(const QString &s)
+{
+ return ( s.right(10) == " [default]" ) ? s.left( s.length()-10 ) : s;
+}
+
+////////////////////////////// packages tab //////////////////////////////
+
+void QuickDocument::readPackagesConfig()
+{
+ KILE_DEBUG() << "\tread config: packages" << endl;
+
+ if ( ! readPackagesListview() )
+ initPackages();
+}
+
+// init default values for packages tab
+void QuickDocument::initPackages()
+{
+ KILE_DEBUG() << "read config: init standard packages" << endl;
+ QCheckListItem *cli;
+ QCheckListItem *clichild;
+
+ m_lvPackages->clear();
+ cli = insertListview(m_lvPackages,"amsmath", i18n("Special math environments and commands (AMS)") );
+ cli = insertListview(m_lvPackages,"amsfonts",i18n("Collection of fonts and symbols for math mode (AMS)") );
+ cli = insertListview(m_lvPackages,"amssymb",i18n("Defines symbol names for all math symbols in MSAM and MSBM (AMS)") );
+ cli = insertListview(m_lvPackages,"amsthm",i18n("Improved theorem setup (AMS)"));
+ cli = insertListview(m_lvPackages,"caption",i18n("Extends caption capabilities for figures and tables"));
+
+ cli = insertListview(m_lvPackages,"hyperref",i18n("Hypertext marks in LaTeX") );
+ cli->setOpen(true);
+ clichild = insertListview(cli,"dvips",i18n("Use dvips as hyperref driver") );
+ clichild->setOn(true);
+ clichild = insertListview(cli,"pdftex",i18n("Use pdftex as hyperref driver") );
+ clichild = insertEditableListview(cli,"bookmarks",i18n("Make bookmarks"),"true","true" );
+ clichild = insertEditableListview(cli,"bookmarksnumbered",i18n("Put section numbers in bookmarks"),"false","false" );
+ clichild = insertEditableListview(cli,"bookmarksopen",i18n("Open up bookmark tree"),QString::null,QString::null );
+ clichild = insertEditableListview(cli,"pdfauthor",i18n("Text for PDF Author field"),QString::null,QString::null );
+ clichild = insertEditableListview(cli,"pdfcreator",i18n("Text for PDF Creator field"),i18n("LaTeX with hyperref package"),i18n("LaTeX with hyperref package") );
+ clichild = insertEditableListview(cli,"pdffitwindow",i18n("Resize document window to fit document size"),"false","false" );
+ clichild = insertEditableListview(cli,"pdfkeywords",i18n("Text for PDF Keywords field"),QString::null,QString::null );
+ clichild = insertEditableListview(cli,"pdfproducer",i18n("Text for PDF Producer field"),QString::null,QString::null );
+ clichild = insertEditableListview(cli,"pdfstartview",i18n("Starting view of PDF document"),"/Fit","/Fit" );
+ clichild = insertEditableListview(cli,"pdfsubject",i18n("Text for PDF Subject field"),QString::null,QString::null );
+ clichild = insertEditableListview(cli,"pdftitle",i18n("Text for PDF Title field"),QString::null,QString::null );
+
+ cli = insertListview(m_lvPackages,"mathpazo",i18n("Use Palatino font as roman font (both text and math mode)") );
+ cli = insertListview(m_lvPackages,"mathptmx",i18n("Use Times font as roman font (both text and math mode)") );
+ cli = insertListview(m_lvPackages,"makeidx",i18n("Enable index generation") );
+ cli = insertListview(m_lvPackages,"multicol",i18n("Enables multicolumn environments") );
+ cli = insertListview(m_lvPackages,"pst-all",i18n("Load all pstricks packages") );
+ cli = insertListview(m_lvPackages,"rotating",i18n("Rotates text") );
+ cli = insertListview(m_lvPackages,"subfigure",i18n("Enables subfigures inside figures") );
+ cli = insertListview(m_lvPackages,"upgreek",i18n("Typesetting capital Greek letters") );
+ cli = insertListview(m_lvPackages,"xcolor",i18n("Extending LaTeX's color facilities") );
+
+ cli = insertListview(m_lvPackages,"babel",i18n("Adds language specific support") );
+ cli->setOn(true);
+ cli->setOpen(true);
+ clichild = new QCheckListItem(cli,"acadian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"afrikaans" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"american" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"australian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"austrian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"bahasa" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"basque" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"brazil" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"brazilian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"breton" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"british" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"bulgarian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"canadian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"canadien" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"catalan" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"croatian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"czech" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"danish" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"dutch" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"english" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"esperanto" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"estonian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"finnish" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"francais" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"frenchb" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"french" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"galician" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"german" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"germanb" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"greek" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"polutonikogreek" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"hebrew" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"hungarian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"icelandic" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"interlingua" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"irish" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"italian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"latin" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"lowersorbian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"magyar" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"naustrian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"newzealand" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"ngerman" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"norsk" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"samin" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"nynorsk" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"polish" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"portuges" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"portuguese" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"romanian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"russian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"scottish" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"serbian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"slovak" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"slovene" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"spanish" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"swedish" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"turkish" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"ukrainian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"uppersorbian" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"welsh" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"UKenglish" ,QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli,"USenglish" ,QCheckListItem::CheckBox);
+
+ cli = insertListview(m_lvPackages,"fontenc",i18n("Use a font encoding scheme") );
+ cli->setOn(true);
+ cli->setOpen(true);
+ clichild = new QCheckListItem(cli, "HE8",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "IL2",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "LCH",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "LCY",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "LGR",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "LHE",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "LIT",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "LO1",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "LY1",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "MTT",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "OML",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "OMS",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "OT1",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "OT2",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "OT4",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "PD1",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "PU",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "QX",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "T1",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "T2A",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "T2B",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "T2C",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "T5",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "TS1",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "UT1",QCheckListItem::CheckBox);
+ clichild = new QCheckListItem(cli, "X2",QCheckListItem::CheckBox);
+
+ cli = insertListview(m_lvPackages,"graphicx",i18n("Support for including graphics") );
+ cli->setOn(true);
+ cli->setOpen(true);
+ clichild = insertListview(cli,"dvips",i18n("Specialize on graphic inclusion for dvips") );
+ clichild = insertListview(cli,"pdftex",i18n("Specialize on graphic inclusion for pdftex") );
+ clichild = insertListview(cli,"draft",i18n("Show only frames of graphics") );
+}
+
+// Try to read values from the config file:
+// - main entry: selected,open,empty,empty,description
+// - child entry: selected,editable,defaultvalue,value,description
+
+bool QuickDocument::readPackagesListview()
+{
+ KILE_DEBUG() << "\tread config: packages from config file" << endl;
+
+ QStringList elements = KileConfig::packagesList();
+
+ // clear packages dictionaries and listview
+ m_dictPackagesEditable.clear();
+ m_dictPackagesDefaultvalues.clear();
+ m_lvPackages->clear();
+
+ if ( elements.empty() )
+ return false;
+
+ // regular expression to split the string from the config file
+ QRegExp reg("([^,]*),([^,]*),([^,]*),([^,]*),(.*)");
+
+ m_config->setGroup( "QuickDocument/Packages" );
+ for ( QStringList::Iterator it=elements.begin(); it!=elements.end(); ++it ) {
+ QCheckListItem *cli;
+
+ // look, if this is a main or a child entry
+ KILE_DEBUG() << "\tread config entry: " << *it << endl;
+ int pos = (*it).find('!');
+ if ( pos == -1 ) { // main entry
+ cli = new QCheckListItem(m_lvPackages, *it, QCheckListItem::CheckBox);
+ if ( reg.exactMatch(m_config->readEntry(*it)) ) {
+ if ( reg.cap(1) == "1" ) // selected state (entry 1)
+ cli->setOn(true);
+ if ( reg.cap(2) == "1" ) // open state (entry 2)
+ cli->setOpen(true);
+ cli->setText(2,reg.cap(5)); // description (entry 5)
+ } else {
+ KILE_DEBUG() << "\twrong config entry for package " << cli->text(0) << endl;
+ }
+ } else { // child entry
+ cli = dynamic_cast<QCheckListItem*>(m_lvPackages->findItem((*it).left(pos), 0));
+ if ( cli ) {
+ QCheckListItem *clichild;
+ if ( reg.exactMatch(m_config->readEntry(*it)) ) {
+ if ( reg.cap(2) == "1" ) { // editable state
+ clichild = insertEditableListview(cli,(*it).mid(pos+1),reg.cap(5),reg.cap(4),reg.cap(3) );
+ } else {
+ clichild = new QCheckListItem(cli, (*it).mid(pos+1), QCheckListItem::CheckBox);
+ clichild->setText(2,reg.cap(5)); // description
+ }
+ if ( reg.cap(1) == "1" ) // selected state
+ clichild->setOn(true);
+ } else {
+ KILE_DEBUG() << "\twrong config entry for package option " << cli->text(0) << endl;
+ }
+ } else {
+ KILE_DEBUG() << "\tlistview entry for package " << (*it).left(pos) << " not found" << endl;
+ }
+ }
+ }
+
+ return true;
+}
+
+void QuickDocument::writePackagesConfig()
+{
+ KILE_DEBUG() << "\twrite config: packages" << endl;
+
+ QStringList packagesList;
+
+ m_config->setGroup( "QuickDocument/Packages" );
+ for (QListViewItem *cur=m_lvPackages->firstChild(); cur; cur=cur->nextSibling()) {
+ KILE_DEBUG() << "\twrite config: " << cur->text(0) << endl;
+ // add to packages list
+ packagesList += cur->text(0);
+
+ // determine config entry
+ QString packageentry;
+
+ // look for selected entries
+ QCheckListItem *cli = dynamic_cast<QCheckListItem*>(cur);
+ if ( cli && cli->isOn() )
+ packageentry = "1,";
+ else
+ packageentry = "0,";
+
+ // look if this listitem is opened
+ if ( cli && cli->isOpen() )
+ packageentry += "1,";
+ else
+ packageentry += "0,";
+
+ // two dummy entries and finally the description
+ packageentry += ",," + cur->text(2);
+
+ // write listview entry
+ m_config->writeEntry(cur->text(0),packageentry);
+
+ // look for children
+ for (QListViewItem *curchild=cur->firstChild(); curchild; curchild=curchild->nextSibling()) {
+ // add child to packages list
+ QString option = cur->text(0) + '!' + curchild->text(0);
+ packagesList += option;
+ KILE_DEBUG() << "\twrite config: " << option << endl;
+
+ // determine config entry
+ QString optionentry;
+
+ // look for selected options
+ QCheckListItem *clichild = dynamic_cast<QCheckListItem*>(curchild);
+ if ( clichild && clichild->isOn() )
+ optionentry = "1,";
+ else
+ optionentry = "0,";
+
+ // look, if this child is editable
+ if ( clichild && m_dictPackagesEditable.contains(option) ) {
+ optionentry += "1,";
+ if ( m_dictPackagesDefaultvalues.contains(option) )
+ optionentry += m_dictPackagesDefaultvalues[option] + ',';
+ else
+ optionentry += ',';
+ } else
+ optionentry += "0,,";
+
+ // add a value and a description
+ optionentry += getPackagesValue(curchild->text(1))
+ + ',' + stripPackageDefault(option,curchild->text(2));
+
+ // write listview entry
+ m_config->writeEntry(option,optionentry);
+ }
+ }
+
+ // write the list of all packages
+ KileConfig::setPackagesList(packagesList);
+}
+
+// insert package
+QCheckListItem *QuickDocument::insertListview(QListView *listview,
+ const QString &entry,
+ const QString &description)
+{
+ QCheckListItem *item = new QCheckListItem(listview,entry,QCheckListItem::CheckBox);
+ if ( ! description.isEmpty() )
+ item->setText(2,description);
+
+ return item;
+}
+
+// insert package option (not editable)
+QCheckListItem *QuickDocument::insertListview(QCheckListItem *parent,
+ const QString &entry,
+ const QString &description)
+{
+ QCheckListItem *item = new QCheckListItem(parent,entry,QCheckListItem::CheckBox);
+ if ( ! description.isEmpty() )
+ item->setText(2,description);
+
+ return item;
+}
+
+// insert package option (editable)
+QCheckListItem *QuickDocument::insertEditableListview(QCheckListItem *parent,
+ const QString &entry,const QString &description,
+ const QString value,const QString defaultvalue)
+{
+ QCheckListItem *item = new EditableCheckListItem(parent,entry);
+ QString option = parent->text(0) + '!' + entry;
+ m_dictPackagesEditable[option] = true;
+ if ( ! defaultvalue.isEmpty() )
+ m_dictPackagesDefaultvalues[option] = defaultvalue;
+ setPackagesValue(item,option,value);
+ if ( ! description.isEmpty() )
+ item->setText( 2,addPackageDefault(option,description) );
+
+ return item;
+}
+
+void QuickDocument::setPackagesValue(QListViewItem *item,const QString &option,const QString &val)
+{
+ QString defaultvalue = ( m_dictPackagesDefaultvalues.contains(option) )
+ ? m_dictPackagesDefaultvalues[option] : QString::null;
+ QString value = ( ! val.isEmpty() ) ? val : QString::null;
+
+ if ( value == defaultvalue )
+ item->setText(1,i18n("<default>") );
+ else if ( value.isEmpty() )
+ item->setText(1,i18n("<empty>") );
+ else
+ item->setText(1,value);
+}
+
+QString QuickDocument::getPackagesValue(const QString &value)
+{
+ return ( value==i18n("<default>") || value==i18n("<empty>") ) ? QString::null : value;
+}
+
+
+bool QuickDocument::isListviewEntry(QListView *listview,const QString &entry)
+{
+ for ( QListViewItem *cur=listview->firstChild(); cur; cur=cur->nextSibling() ) {
+ if ( cur->text(0) == entry )
+ return true;
+ }
+
+ return false;
+}
+
+bool QuickDocument::isListviewChild(QListView *listview,const QString &entry, const QString &option)
+{
+ for ( QListViewItem *cur=listview->firstChild(); cur; cur=cur->nextSibling() ) {
+ // look for the main entry
+ if ( cur->text(0) == entry ) {
+ // look for children
+ for (QListViewItem *curchild=cur->firstChild(); curchild; curchild=curchild->nextSibling()) {
+ if ( option == curchild->text(0) )
+ return true;
+ }
+ return false;
+ }
+ }
+
+ return false;
+}
+
+QString QuickDocument::addPackageDefault(const QString &option,const QString &description)
+{
+ return ( m_dictPackagesDefaultvalues.contains(option) )
+ ? description + " [" + m_dictPackagesDefaultvalues[option] + ']'
+ : description + " [ ]";
+}
+
+QString QuickDocument::stripPackageDefault(const QString &option,const QString &description)
+{
+ QRegExp reg("(.*) \\[([^\\[]*)\\]");
+
+ if ( description.right(4) == " [ ]" )
+ return description.left(description.length()-4);
+
+ if ( ! reg.exactMatch(description) )
+ return description;
+
+ return ( reg.cap(2).isEmpty() ||
+ ( m_dictPackagesDefaultvalues.contains(option) && m_dictPackagesDefaultvalues[option]==reg.cap(2) )
+ ) ? reg.cap(1) : description;
+}
+
+////////////////////////////// hyperref tab //////////////////////////////
+
+void QuickDocument::initHyperref()
+{
+ KILE_DEBUG() << "\tread config: init hyperref" << endl;
+
+
+ QString driver = "dvipdf,dvipdfm,dvips,dvipsone,"
+ "dviwindo,hypertex,latex2html,pdftex,"
+ "ps2pdf,tex4ht,textures,vtex";
+ QStringList list = QStringList::split(",",driver);
+
+ m_dictHyperrefDriver.clear();
+ for ( uint i=0; i<list.count(); ++i )
+ m_dictHyperrefDriver[list[i]] = true;
+}
+
+bool QuickDocument::isHyperrefDriver(const QString &name)
+{
+ return m_dictHyperrefDriver.contains(name);
+}
+
+////////////////////////////// check for existing exntries //////////////////////////////
+
+bool QuickDocument::isDocumentClass(const QString &name)
+{
+ for ( int i=0; i<m_cbDocumentClass->count(); ++i ) {
+ if ( m_cbDocumentClass->text(i) == name )
+ return true;
+ }
+ return false;
+}
+
+bool QuickDocument::isDocumentClassOption(const QString &option)
+{
+ return isListviewEntry(m_lvClassOptions,option);
+}
+
+bool QuickDocument::isPackage(const QString &package)
+{
+ return isListviewEntry(m_lvPackages,package);
+}
+
+bool QuickDocument::isPackageOption(const QString &package, const QString &option)
+{
+ return isListviewChild(m_lvPackages,package,option);
+}
+
+
+////////////////////////////// print document template //////////////////////////////
+
+void QuickDocument::printTemplate()
+{
+ KILE_DEBUG() << "==QuickDocument::printTemplate()============" << endl;
+
+ // get current document class
+ QString documentclass = m_cbDocumentClass->currentText();
+ KILE_DEBUG() << "\tdocument class: " << documentclass << endl;
+
+ // build template
+ m_td.tagBegin = "\\documentclass";
+
+ // build options
+ QString options;
+ if ( documentclass != "beamer" ) {
+ if ( !m_cbPaperSize->currentText().isEmpty() )
+ options += stripDefault( m_cbPaperSize->currentText() ) + ',';
+ }
+
+ if ( !m_cbTypefaceSize->currentText().isEmpty() )
+ options += stripDefault( m_cbTypefaceSize->currentText() ) + ',';
+
+ for (QListViewItem *cur=m_lvClassOptions->firstChild(); cur; cur=cur->nextSibling()) {
+ QCheckListItem *cli=dynamic_cast<QCheckListItem*>(cur);
+ if ( cli && cli->isOn() )
+ options += cur->text(0) + ',';
+ }
+
+ if ( ! options.isEmpty() )
+ m_td.tagBegin += '[' + options.left( options.length()-1 ) + ']';
+ m_td.tagBegin += '{' + documentclass + "}\n\n";
+
+
+ QString enc = m_cbEncoding->currentText();
+ if (!enc.isEmpty())
+ {
+ if( enc.find("utf") != -1 )
+ m_td.tagBegin += "\\usepackage{ucs}\n";
+ m_td.tagBegin += "\\usepackage[" + enc + "]{inputenc}\n";
+ }
+ if ( documentclass != "beamer" ) {
+ printPackages();
+ printHyperref();
+ } else {
+ printBeamerTheme();
+ printPackages();
+ }
+
+ if (!m_leAuthor->text().isEmpty())
+ m_td.tagBegin += "\\author{"+m_leAuthor->text()+"}\n";
+ if (!m_leTitle->text().isEmpty())
+ m_td.tagBegin += "\\title{"+m_leTitle->text()+"}\n";
+ if (!m_leDate->text().isEmpty())
+ m_td.tagBegin += "\\date{"+m_leDate->text()+"}\n";
+ m_td.tagBegin += '\n';
+
+ m_td.tagBegin += "\\begin{document}\n%E%C";
+
+ m_td.tagEnd = "\n\\end{document}\n";
+}
+
+void QuickDocument::printPackages()
+{
+ KILE_DEBUG() << "\tpackages" << endl;
+
+ m_currentHyperref = false;
+ m_hyperrefdriver = QString::null;
+ m_hyperrefsetup = QString::null;
+
+ for (QListViewItem *cur=m_lvPackages->firstChild(); cur; cur=cur->nextSibling()) {
+ QCheckListItem *cli = dynamic_cast<QCheckListItem*>(cur);
+ if ( ! cli )
+ continue;
+
+ if ( cur->text(0) == "hyperref" ) { // manage hyperref package
+ m_currentHyperref = cli->isOn();
+ for (QListViewItem *curchild = cur->firstChild(); curchild; curchild=curchild->nextSibling()) {
+ QCheckListItem *clichild = dynamic_cast<QCheckListItem*>(curchild);
+ if (clichild && clichild->isOn() ) { // manage hyperref option
+ if ( isHyperrefDriver(curchild->text(0)) ) { // either hyperref driver
+ if ( ! m_hyperrefdriver.isEmpty() )
+ m_hyperrefdriver += ',';
+ m_hyperrefdriver += curchild->text(0);
+ } else {
+ QString value = curchild->text(1); // or another option
+ if ( value != i18n("<default>") ) {
+ if ( ! m_hyperrefsetup.isEmpty() )
+ m_hyperrefsetup += ',';
+ m_hyperrefsetup += "%\n " + curchild->text(0) + '=' + getPackagesValue(curchild->text(1));
+ }
+ }
+ }
+ }
+ } else if ( cli->isOn() ) { // manage other package options
+ QString packageOptions;
+ for (QListViewItem *curchild = cur->firstChild(); curchild; curchild=curchild->nextSibling()) {
+ QCheckListItem *clichild = dynamic_cast<QCheckListItem*>(curchild);
+ if (clichild && clichild->isOn()) {
+ QString optiontext;
+ if ( m_dictPackagesEditable.contains(cur->text(0) + '!' + curchild->text(0)) ) {
+ QString value = curchild->text(1);
+ if ( value != i18n("<default>") )
+ optiontext = curchild->text(0) + '=' + getPackagesValue(curchild->text(1));
+ } else
+ optiontext = curchild->text(0);
+
+ if ( ! optiontext.isEmpty() ) {
+ if (!packageOptions.isEmpty())
+ packageOptions += ',';
+ packageOptions += optiontext;
+ }
+ }
+ }
+
+ m_td.tagBegin += "\\usepackage";
+ if (!packageOptions.isEmpty())
+ m_td.tagBegin += '[' + packageOptions + ']';
+ m_td.tagBegin += '{' + cur->text(0) + "}\n";
+ }
+ }
+ m_td.tagBegin += '\n';
+}
+
+void QuickDocument::printHyperref()
+{
+ if ( ! m_currentHyperref )
+ return;
+
+ KILE_DEBUG() << "\thyperref" << endl;
+
+ // output hyperref package
+ m_td.tagBegin += "\\usepackage";
+ if ( ! m_hyperrefdriver.isEmpty() )
+ m_td.tagBegin += '[' + m_hyperrefdriver + ']';
+ m_td.tagBegin += "{hyperref}\n";
+
+ // output hyperref options
+ if ( ! m_hyperrefsetup.isEmpty() ) {
+ m_td.tagBegin += "\\hypersetup{" + m_hyperrefsetup + "%\n}\n";
+ }
+
+ m_td.tagBegin += '\n';
+
+
+}
+
+void QuickDocument::printBeamerTheme()
+{
+ KILE_DEBUG() << "\tbeamer theme" << endl;
+
+ QString theme = m_cbPaperSize->currentText();
+ QRegExp reg("(\\w+)\\s+\\((.*)\\)$");
+
+ if ( reg.search(theme) >= 0 ) {
+ QStringList optionlist = QStringList::split(",",reg.cap(2));
+ m_td.tagBegin += "\\usepackage[" + optionlist.join(",") + "]{beamertheme" + reg.cap(1) + "}\n\n";
+ } else {
+ m_td.tagBegin += "\\usepackage{beamertheme" + theme + "}\n\n";
+ }
+}
+
+////////////////////////////// Slots //////////////////////////////
+
+void QuickDocument::slotOk()
+{
+ KILE_DEBUG() << "==QuickDocument::slotOk()============" << endl;
+
+ // get current class options
+ m_currentClass = m_cbDocumentClass->currentText();
+ KILE_DEBUG() << "\tcurrent class: " << m_currentClass << endl;
+
+ // save the checked options
+ m_dictDocumentClasses[m_currentClass][qd_SelectedOptions] = getClassOptions();
+ KILE_DEBUG() << "\tsave options: " << m_dictDocumentClasses[m_currentClass][qd_SelectedOptions] << endl;
+
+ // build template
+ printTemplate();
+
+ // update config file
+ writeConfig();
+
+ accept();
+}
+
+////////////////////////////// slots: document class //////////////////////////////
+
+void QuickDocument::slotDocumentClassAdd()
+{
+ KILE_DEBUG() << "==QuickDocument::slotDocumentClassAdd()============" << endl;
+ QStringList list;
+ list << i18n("Document Class")
+ << "label,edit,label,combobox,checkbox,checkbox"
+ << i18n("Please enter the new document &class:")
+ << QString::null // 3
+ << i18n("&Set all options from this standard class (optional):")
+ << ",article,book,letter,report,scrartcl,scrbook,scrreprt" // 5
+ << i18n("Use standard &fontsizes") // 6
+ << i18n("Use standard &papersizes") // 7
+ ;
+
+ if ( inputDialog(list,qd_CheckNotEmpty | qd_CheckDocumentClass) ) {
+ QString classname = list[3];
+
+ QStringList classlist;
+ if ( list[5].isEmpty() ) { // no base class
+ QString useFontsizes = ( list[6] == "true" )
+ ? "10pt,11pt,12pt" : "";
+ QString usePapersizes = ( list[7] == "true" )
+ ? "a4paper,a5paper,b5paper,executivepaper,legalpaper,letterpaper" : "";
+ KILE_DEBUG() << "\tadd document class: " << classname
+ << " fontsize=" << list[6] << " papersize=" << list[7] << endl;
+
+ // set default entries for the documentClass-dictionary
+ classlist << useFontsizes << usePapersizes << "" << "";
+ } else { // based on a standard class
+ // first get the first four parameters
+ classlist = m_dictDocumentClasses[list[5]];
+ // then add all baseclass options
+ QStringList optionlist;
+ initStandardOptions(list[5],optionlist);
+ for (uint i=0; i<optionlist.count(); ++i)
+ classlist.append(optionlist[i]);
+ }
+
+ // insert the stringlist for this new document class
+ m_dictDocumentClasses[ classname ] = classlist;
+
+ // add the new document class into the userClasslist and the documentClass-combobox
+ m_userClasslist.append(classname);
+ fillDocumentClassCombobox();
+
+ // activate the new document class
+ m_cbDocumentClass->setCurrentText(classname);
+ slotDocumentClassChanged( m_cbDocumentClass->currentItem() );
+ }
+}
+
+void QuickDocument::slotDocumentClassDelete()
+{
+ // get the name of the current class
+ QString documentclass = m_cbDocumentClass->currentText();
+
+ KILE_DEBUG() << "==QuickDocument::slotDocumentClassDelete()============" << endl;
+ if (KMessageBox::warningContinueCancel(this, i18n("Do you want to remove \"%1\" from the document class list?").arg(documentclass), i18n("Remove Document Class"))==KMessageBox::Continue)
+ {
+ KILE_DEBUG() << "\tlazy delete class: " << documentclass << endl;
+
+ // remove this document class from the documentClass-dictionary
+ m_dictDocumentClasses.remove(documentclass);
+
+ // mark this document class for deleting from config file (only with OK-Button)
+ if ( m_deleteDocumentClasses.findIndex(documentclass) == -1 )
+ m_deleteDocumentClasses.append(documentclass);
+
+ // remove it from the list of userclasses
+ m_userClasslist.remove(documentclass);
+
+ // and finally remove it from the combobox
+ int i = m_cbDocumentClass->currentItem();
+ m_cbDocumentClass->removeItem(i);
+ m_cbDocumentClass->setCurrentItem(0);
+
+ // init a new document class
+ m_currentClass = m_cbDocumentClass->currentText();
+ KILE_DEBUG() << "\tchange class: --> " << m_currentClass << endl;
+ initDocumentClass();
+ }
+}
+
+void QuickDocument::slotDocumentClassChanged(int index)
+{
+ KILE_DEBUG() << "==QuickDocument::slotDocumentClassChanged()============" << endl;
+ if ( m_cbDocumentClass->text(index).isNull() ) {
+ KILE_DEBUG() << "\tnull" << endl;
+ return;
+ }
+
+ // get old and new document class
+ QString oldclass = m_currentClass;
+ m_currentClass = m_cbDocumentClass->text(index);
+ KILE_DEBUG() << "\tchange class: " << oldclass << " --> " << m_currentClass << endl;
+
+ // save the checked options
+ m_dictDocumentClasses[oldclass][qd_SelectedOptions] = getClassOptions();
+ KILE_DEBUG() << "\tsave options: " << m_dictDocumentClasses[oldclass][qd_SelectedOptions] << endl;
+
+ // init the new document class
+ initDocumentClass();
+}
+
+void QuickDocument::slotTypefaceSizeAdd()
+{
+ KILE_DEBUG() << "==QuickDocument::slotTypefaceSizeAdd()============" << endl;
+ QStringList list;
+ list << i18n("Add Fontsize")
+ << "label,edit"
+ << i18n("Please enter the &fontsizes (comma-separated list):")
+ << QString::null // 3
+ ;
+
+ if ( inputDialog(list,qd_CheckNotEmpty |qd_CheckFontsize) ) {
+ KILE_DEBUG() << "\tadd fontsize: " << list[3] << endl;
+ addComboboxEntries(m_cbTypefaceSize,"fontsize",list[3]);
+
+ // save the new list of fontsizes
+ m_dictDocumentClasses[m_currentClass][qd_Fontsizes] = getComboxboxList(m_cbTypefaceSize);
+ }
+}
+
+void QuickDocument::slotTypefaceSizeDelete()
+{
+ if (KMessageBox::warningContinueCancel(this, i18n("Do you want to remove \"%1\" from the fontsize list?").arg(m_cbPaperSize->currentText()), i18n("Remove Fontsize"))==KMessageBox::Continue)
+ {
+ int i=m_cbPaperSize->currentItem();
+ m_cbPaperSize->removeItem(i);
+
+ // save the new list of fontsizes
+ m_dictDocumentClasses[m_currentClass][qd_Fontsizes] = getComboxboxList(m_cbTypefaceSize);
+ }
+}
+
+void QuickDocument::slotPaperSizeAdd()
+{
+ KILE_DEBUG() << "==QuickDocument::slotPaperSizeAdd()============" << endl;
+ QStringList list;
+ list << i18n("Add Papersize")
+ << "label,edit"
+ << i18n("Please enter the &papersizes (comma-separated list):")
+ << QString::null // 3
+ ;
+
+ if ( inputDialog(list,qd_CheckNotEmpty |qd_CheckPapersize) ) {
+ KILE_DEBUG() << "\tadd papersize: " << list[3] << endl;
+ addComboboxEntries(m_cbPaperSize,"papersize",list[3]);
+
+ // save the new list of papersizes
+ m_dictDocumentClasses[m_currentClass][qd_Papersizes] = getComboxboxList(m_cbPaperSize);
+ }
+}
+
+void QuickDocument::slotPaperSizeDelete()
+{
+ if (KMessageBox::warningContinueCancel(this, i18n("Do you want to remove \"%1\" from the papersize list?").arg(m_cbPaperSize->currentText()), i18n("Remove Papersize"))==KMessageBox::Continue)
+ {
+ int i=m_cbPaperSize->currentItem();
+ m_cbPaperSize->removeItem(i);
+
+ // save the new list of papersizes
+ m_dictDocumentClasses[m_currentClass][qd_Papersizes] = getComboxboxList(m_cbPaperSize);
+ }
+}
+
+////////////////////////////// slots: document class button //////////////////////////////
+
+void QuickDocument::slotClassOptionAdd()
+{
+ KILE_DEBUG() << "==QuickDocument::slotClassOptionAdd()============" << endl;
+ QStringList list;
+ list << i18n("Add Option")
+ << "label,edit,label,edit,checkbox"
+ << i18n("Name of &option:")
+ << QString::null // 3
+ << i18n("&Description:")
+ << QString::null // 5
+ << i18n("&Select this option") // 6
+ ;
+
+ if ( inputDialog(list,qd_CheckNotEmpty | qd_CheckClassOption) ) {
+ // get results
+ QString option = list[3];
+ QString description = list[5];
+ bool check = ( list[6] == "true" );
+
+ // add class option
+ KILE_DEBUG() << "\tadd option: " << option << " (" << description << ") checked=" << list[6] << endl;
+ QCheckListItem *cli = new QCheckListItem(m_lvClassOptions, option, QCheckListItem::CheckBox);
+ cli->setText(1,description);
+
+ if ( check )
+ cli->setOn(true);
+
+ // update dictionary
+ updateClassOptions();
+ }
+}
+
+void QuickDocument::slotClassOptionEdit()
+{
+ QListViewItem *cur = m_lvClassOptions->selectedItem();
+ if ( ! cur )
+ return;
+
+ KILE_DEBUG() << "==QuickDocument::slotClassOptionEdit()============" << endl;
+ QStringList list;
+ list << i18n("Edit Option")
+ << "label,edit-r,label,edit"
+ << i18n("Name of &option:")
+ << cur->text(0)
+ << i18n("&Description:")
+ << stripDefault(cur->text(1)) // 5
+ ;
+
+ //if ( inputDialog(list,qd_CheckNotEmpty | qd_CheckClassOption) ) {
+ if ( inputDialog(list) ) {
+ // get results
+ //QString option = list[3];
+ QString description = list[5];
+
+ // set changed class option
+ KILE_DEBUG() << "\tedit option: " << cur->text(0) << " (" << description << ")" << endl;
+ //cur->setText(0, option);
+ cur->setText(1, description);
+
+ // update dictionary
+ updateClassOptions();
+ }
+}
+
+void QuickDocument::slotClassOptionDelete()
+{
+ KILE_DEBUG() << "==QuickDocument::slotClassOptionDelete()============" << endl;
+ if (m_lvClassOptions->selectedItem() && (KMessageBox::warningContinueCancel(this, i18n("Do you want to delete this class option?"), i18n("Delete"))==KMessageBox::Continue)) {
+ QListViewItem *cur = m_lvClassOptions->selectedItem();
+
+ KILE_DEBUG() << "\tdelete option: " << cur->text(0) << " (" << cur->text(1) << ")" << endl;
+ m_lvClassOptions->takeItem(m_lvClassOptions->selectedItem());
+
+ // update dictionary
+ updateClassOptions();
+ }
+}
+
+void QuickDocument::slotOptionDoubleClicked(QListViewItem *listViewItem,const QPoint &,int)
+{
+ QCheckListItem *cli = dynamic_cast<QCheckListItem*>(listViewItem);
+ if ( cli ) {
+ if ( ! cli->isOn() ) {
+ cli->setOn(true);
+ }
+ else
+ cli->setOn(false);
+ }
+}
+
+////////////////////////////// slots: packages //////////////////////////////
+
+void QuickDocument::slotPackageAdd()
+{
+ KILE_DEBUG() << "==QuickDocument::slotPackageAdd()============" << endl;
+ QStringList list;
+ list << i18n("Add Package")
+ << "label,edit,label,edit,checkbox"
+ << i18n("&Package:")
+ << QString::null // 3
+ << i18n("&Description:")
+ << QString::null // 5
+ << i18n("&Select this package") // 6
+ ;
+
+ if ( inputDialog(list,qd_CheckNotEmpty | qd_CheckPackage) ) {
+ KILE_DEBUG() << "\tadd package: " << list[3] << " (" << list[5] << ") checked=" << list[6] << endl;
+ QCheckListItem *cli = new QCheckListItem(m_lvPackages, list[3], QCheckListItem::CheckBox);
+ cli->setText(2, list[5]);
+ if ( list[6] == "true" )
+ cli->setOn(true);
+ }
+}
+
+void QuickDocument::slotPackageAddOption()
+{
+ QListViewItem *cur = m_lvPackages->selectedItem();
+ if ( !cur )
+ return;
+
+ KILE_DEBUG() << "==QuickDocument::packageAddOption()============" << endl;
+ QStringList list;
+ list << i18n("Add Option")
+ << "label,edit,checkbox,label,edit,label,edit,label,edit,checkbox"
+ << i18n("&Option:") + " (" + i18n("package:") + ' ' + cur->text(0) + ')'
+ << QString::null // 3
+ << i18n("&Editable") // 4
+ << i18n("De&fault value:")
+ << QString::null // 6
+ << i18n("&Value:")
+ << QString::null // 8
+ << i18n("&Description:")
+ << QString::null // 10
+ << i18n("&Select this option") // 11
+ ;
+
+ if ( !cur->parent() && inputDialog(list,qd_CheckNotEmpty | qd_CheckPackageOption) ) {
+ KILE_DEBUG() << "\tadd option: " << list[3] << " (" << list[10] << ") checked=" << list[11] << endl;
+
+ QCheckListItem *cli;
+ if ( list[4] == "true" ) {
+ cli = insertEditableListview((QCheckListItem *)cur,list[3],list[10],list[8],list[6]);
+ } else {
+ cli = new QCheckListItem(cur, list[3], QCheckListItem::CheckBox);
+ cli->setText(2,list[10]);
+ }
+ if ( list[11] == "true" )
+ cli->setOn(true);
+ cur->setOpen(true);
+ }
+
+}
+
+void QuickDocument::slotPackageEdit()
+{
+ QListViewItem *cur = m_lvPackages->selectedItem();
+ if ( !cur )
+ return;
+
+ KILE_DEBUG() << "==QuickDocument::slotPackageEdit()============" << endl;
+ bool editableOption;
+ QString caption,labelText,optionname;
+
+ if ( cur->parent() ) {
+// checkmode = qd_CheckPackageOption;
+ caption = i18n("Edit Option");
+ labelText = i18n("Op&tion:") + " (" + i18n("package:") + ' ' + cur->parent()->text(0) + ')';
+ optionname = cur->parent()->text(0) + '!' + cur->text(0);
+ editableOption = m_dictPackagesEditable.contains(optionname);
+ } else {
+// checkmode = qd_CheckPackage;
+ caption = i18n("Edit Package");
+ labelText = i18n("&Package:");
+ optionname = QString::null;
+ editableOption = false;
+ }
+
+ // create one of three different dialogs; edit package, edit editable option, edit option
+ QStringList list;
+ list << caption;
+ if ( editableOption ) {
+ QString defaultvalue = ( m_dictPackagesDefaultvalues.contains(optionname) )
+ ? m_dictPackagesDefaultvalues[optionname]
+ : QString::null;
+ QString value = ( cur->text(1) == i18n("<default>") )
+ ? defaultvalue : getPackagesValue(cur->text(1));
+
+ list << "label,edit-r,label,edit-r,label,edit,label,edit"
+ << labelText
+ << cur->text(0) // 3
+ << i18n("De&fault value:")
+ << defaultvalue // 5
+ << i18n("&Value:")
+ << value // 7
+ << i18n("&Description:")
+ << stripPackageDefault(optionname,cur->text(2)) // 9
+ ;
+ } else {
+ list << "label,edit-r,label,edit"
+ << labelText
+ << cur->text(0) // 3
+ << i18n("&Description:")
+ << cur->text(2) // 5
+ ;
+ }
+
+ if ( inputDialog(list) ) {
+ if ( editableOption ) {
+ KILE_DEBUG() << "\tedit package: "
+ << list[3]
+ << " (" << list[7] << ") "
+ << " (" << list[9] << ")"
+ << endl;
+ cur->setText(0, list[3]);
+ setPackagesValue(cur,optionname,list[7]);
+ cur->setText(2, addPackageDefault(optionname,list[9]));
+ } else {
+ KILE_DEBUG() << "\tedit package: " << list[3] << " (" << list[5] << ")" << endl;
+ cur->setText(0, list[3]);
+ cur->setText(2, list[5]);
+ }
+ }
+}
+
+void QuickDocument::slotPackageDelete()
+{
+ QListViewItem *cur = m_lvPackages->selectedItem();
+ if ( !cur )
+ return;
+
+ bool packageoption;
+ QString message,optionname;
+ if ( cur->parent() ) {
+ packageoption = true;
+ message = i18n("Do you want do delete this package option?");
+ optionname = cur->parent()->text(0) + '!' + cur->text(0);
+ } else {
+ packageoption = false;
+ message = i18n("Do you want to delete this package?");
+ optionname = cur->text(0);
+ }
+
+ if (KMessageBox::warningContinueCancel(this, message, i18n("Delete"))==KMessageBox::Continue) {
+ QListViewItem *childcur = cur->firstChild();
+ while (childcur) {
+ QListViewItem *nextchildcur=childcur->nextSibling();
+ delete childcur;
+ childcur = nextchildcur;
+ }
+ delete cur;
+
+ // also delete entries for editable package option
+ if ( packageoption && m_dictPackagesEditable.contains(optionname) ) {
+ m_dictPackagesEditable.remove(optionname);
+ if ( m_dictPackagesDefaultvalues.contains(optionname) )
+ m_dictPackagesDefaultvalues.remove(optionname);
+ }
+ }
+}
+
+void QuickDocument::slotPackageReset()
+{
+ if (KMessageBox::warningContinueCancel(this, i18n("Do you want to reset this package list?"), i18n("Reset Package List"))==KMessageBox::Continue)
+ {
+ KILE_DEBUG() << "\treset packages" << endl;
+
+ initPackages();
+ slotEnableButtons();
+ }
+}
+
+void QuickDocument::slotCheckParent(QListViewItem *listViewItem)
+{
+ QCheckListItem *cli = dynamic_cast<QCheckListItem*>(listViewItem);
+ if (cli && listViewItem->parent() && cli->isOn()) {
+ QCheckListItem *cliparent=dynamic_cast<QCheckListItem*>(listViewItem->parent());
+ if (cliparent)
+ cliparent->setOn(true);
+ }
+}
+
+void QuickDocument::slotPackageDoubleClicked(QListViewItem *listViewItem,const QPoint &,int)
+{
+ if ( listViewItem && listViewItem->parent() ) {
+ QCheckListItem *parentitem = dynamic_cast<QCheckListItem*>(listViewItem->parent());
+ QString option = parentitem->text(0) + '!' + listViewItem->text(0);
+ if ( m_dictPackagesEditable.contains(option) )
+ slotPackageEdit();
+ }
+}
+
+////////////////////////////// button states //////////////////////////////
+
+void QuickDocument::slotEnableButtons()
+{
+ bool enable;
+
+ enable = ( ! isStandardClass(m_currentClass) );
+
+ // add/delete button
+ m_btnDocumentClassDelete->setEnabled(enable);
+ m_btnTypefaceSizeAdd->setEnabled(enable);
+ m_btnTypefaceSizeDelete->setEnabled(enable && m_cbTypefaceSize->count()>0);
+ m_btnPaperSizeAdd->setEnabled(enable);
+ m_btnPaperSizeDelete->setEnabled(enable && m_cbPaperSize->count()>0);
+
+ // class options
+ m_btnClassOptionsAdd->setEnabled(enable);
+ enable = ( enable && (m_lvClassOptions->selectedItem() != NULL) );
+ m_btnClassOptionsEdit->setEnabled(enable);
+ m_btnClassOptionsDelete->setEnabled(enable);
+
+ // packeges
+ QListViewItem *cur = m_lvPackages->selectedItem();
+ if ( cur && cur->text(0)!= "hyperref" ) {
+ m_btnPackagesEdit->setEnabled(true);
+ m_btnPackagesDelete->setEnabled(true);
+ if ( cur->parent() )
+ m_btnPackagesAddOption->setEnabled(false);
+ else
+ m_btnPackagesAddOption->setEnabled(true);
+ } else {
+ m_btnPackagesEdit->setEnabled(false);
+ m_btnPackagesDelete->setEnabled(false);
+ m_btnPackagesAddOption->setEnabled(false);
+ }
+
+}
+
+////////////////////////////// input dialog //////////////////////////////
+
+// A variable input dialog, whose widgets are determind by the entries of a stringlist.
+// Entry 1 is always the label for the main lineedit, entry 2 the main lineedit. All
+// other objects are optionale and their return values are not checked.
+// 0 : caption (input: always)
+// 1 : comma separated list of Qt widgets (label,checkbox,edit,edit-r)
+// 2ff : strings for Qt widgets
+
+bool QuickDocument::inputDialog(QStringList &list, int check)
+{
+ QuickDocumentInputDialog *dialog = new QuickDocumentInputDialog(list,check,this,"inputDialog");
+
+ bool result = false;
+ if ( dialog->exec() ) {
+ dialog->getResults(list);
+ result = true;
+ }
+
+ delete dialog;
+ return result;
+
+}
+
+QuickDocumentInputDialog::QuickDocumentInputDialog(const QStringList &list,int check,
+ QuickDocument *parent,
+ const char *name )
+ : KDialogBase(parent,name,true,list[0],KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true),
+ m_parent(parent),
+ m_check(check)
+{
+
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+ QVBoxLayout *vl = new QVBoxLayout(page, 0, spacingHint());
+
+ int firstlinedit = -1;
+ m_description = QStringList::split(",",list[1]);
+ for ( uint i=0; i<m_description.count(); ++i ) {
+ // create the object
+ if ( m_description[i] == "label" ) {
+ m_objectlist.append( new QLabel(list[i+2],page) );
+ } else if ( m_description[i]=="checkbox" ) {
+ m_objectlist.append( new QCheckBox(list[i+2],page) );
+ } else if ( m_description[i]=="combobox" ) {
+ KComboBox *combobox = new KComboBox(page);
+ combobox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
+ combobox->setDuplicatesEnabled(false);
+ combobox->insertStringList( QStringList::split(",",list[i+2],true) );
+ if ( i>0 && m_description[i-1]=="label" )
+ ((QLabel *)m_objectlist[i-1])->setBuddy(combobox);
+ m_objectlist.append( combobox );
+ } else {
+ m_objectlist.append( new KLineEdit(list[i+2],page) );
+ if ( m_description[i] == "edit-r" )
+ ((KLineEdit *)m_objectlist[i])->setReadOnly(true);
+ else if ( firstlinedit == -1 )
+ firstlinedit = i;
+ if ( i>0 && m_description[i-1]=="label" )
+ ((QLabel *)m_objectlist[i-1])->setBuddy(m_objectlist[i]);
+ }
+
+ // insert the new object into the layout
+ vl->addWidget(m_objectlist[i]);
+ }
+
+ if ( firstlinedit != -1 )
+ m_objectlist[firstlinedit]->setFocus();
+ vl->addStretch(1);
+ page->setMinimumWidth(350);
+}
+
+QuickDocumentInputDialog::~QuickDocumentInputDialog()
+{}
+
+void QuickDocumentInputDialog::getResults(QStringList &list)
+{
+ for ( uint i=0; i<m_description.count(); ++i ) {
+ if ( m_description[i] == "label" ) {
+ list[i+2] = ((QLabel *)m_objectlist[i])->text();
+ } else if ( m_description[i] == "checkbox" ) {
+ list[i+2] = ( ((QCheckBox *)m_objectlist[i])->isOn() ) ? "true" : "false";
+ } else if ( m_description[i] == "combobox" ) {
+ list[i+2] = ((KComboBox *)m_objectlist[i])->currentText();
+ } else {
+ list[i+2] = ((KLineEdit *)m_objectlist[i])->text().simplifyWhiteSpace();
+ }
+ }
+}
+
+// get the package name from string 'Option: (package: name)'
+QString QuickDocumentInputDialog::getPackageName(const QString &text)
+{
+ QRegExp reg( i18n("package:") + " ([^\\)]+)" );
+ return ( reg.search(text) >= 0 ) ? reg.cap(1) : QString::null;
+}
+
+bool QuickDocumentInputDialog::checkListEntries(const QString &title, const QString &textlist,
+ const QString &pattern)
+{
+ // split entries (one or a comma separated list)
+ QStringList list = QStringList::split(",",textlist);
+
+ for ( uint i=0; i<list.count(); ++i ) {
+ QString s = list[i].stripWhiteSpace();
+ // entries must match a regular expression
+ QRegExp reg(pattern);
+ if ( ! reg.exactMatch(s) ) {
+ KMessageBox::error( this, i18n("%1 '%2' is not allowed.").arg(title).arg(s) );
+ return false;
+ }
+ }
+ return true;
+}
+
+// check the main result of the input dialog
+void QuickDocumentInputDialog::slotOk()
+{
+ if ( m_check ) {
+ // get the label and main input string from the first label/linedit
+ QString inputlabel = ((QLabel *)m_objectlist[0])->text();
+ QString input = ((KLineEdit *)m_objectlist[1])->text().simplifyWhiteSpace();
+
+ // should we check for an empty string
+ if ( (m_check & qd_CheckNotEmpty) && input.isEmpty() ) {
+ KMessageBox::error( this, i18n("An empty string is not allowed.") );
+ return;
+ }
+
+ // should we check for an existing document class
+ if ( m_check & qd_CheckDocumentClass ) {
+ if ( m_parent->isDocumentClass(input) ) {
+ KMessageBox::error( this, i18n("This document class already exists.") );
+ return;
+ }
+
+ QRegExp reg("\\w+");
+ if ( ! reg.exactMatch(input) ) {
+ KMessageBox::error( this, i18n("This is not an allowed name for a document class.") );
+ return;
+ }
+ }
+
+ // should we check for an existing document class option
+ if ( (m_check & qd_CheckClassOption) && m_parent->isDocumentClassOption(input) ) {
+ KMessageBox::error( this, i18n("This document class option already exists.") );
+ return;
+ }
+
+ // should we check for an existing package
+ if ( (m_check & qd_CheckPackage) && m_parent->isPackage(input) ) {
+ KMessageBox::error( this, i18n("This package already exists.") );
+ return;
+ }
+
+ // should we check for an existing package option
+ if ( m_check & qd_CheckPackageOption ) {
+ QString package = getPackageName(inputlabel);
+ if ( package.isEmpty() ) {
+ KMessageBox::error( this, i18n("Could not identify the package name.") );
+ return;
+ }
+ if ( m_parent->isPackageOption(package,input) ) {
+ KMessageBox::error( this, i18n("This package option already exists.") );
+ return;
+ }
+ }
+
+ // should we check for a (list of) fontsizes
+ if ( (m_check & qd_CheckFontsize) && !checkListEntries("Fontsize",input,"\\d+pt") ) {
+ return;
+ }
+
+ // should we check for a (list of) papersizes
+ if ( (m_check & qd_CheckPapersize) && !checkListEntries("Papersize",input,"\\w+") ) {
+ return;
+ }
+ }
+
+ accept();
+}
+
+} // namespace
+
+#include "quickdocumentdialog.moc"
+
+
diff --git a/src/kile/quickdocumentdialog.h b/src/kile/quickdocumentdialog.h
new file mode 100644
index 0000000..57bfdf5
--- /dev/null
+++ b/src/kile/quickdocumentdialog.h
@@ -0,0 +1,224 @@
+/***************************************************************************
+date : Sep 12 2004
+version : 0.22
+copyright : Thomas Fischer <t-fisch@users.sourceforge.net>
+ restructured, improved and completed by Holger Danielsson
+ (C) 2004 by Holger Danielsson
+email : holger.danielsson@t-online.de
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KILEDIALOGQUICKDOCHEADER_H
+#define KILEDIALOGQUICKDOCHEADER_H
+
+#include <qmap.h>
+#include <qvaluelist.h>
+#include "kilewizard.h"
+
+class KComboBox;
+class QListView;
+class QCheckListItem;
+class KLineEdit;
+class KPushButton;
+
+namespace KileDialog
+{
+
+// some flags to check the results of the input dialog
+enum {
+ qd_CheckNotEmpty=1,
+ qd_CheckDocumentClass=2,
+ qd_CheckClassOption=4,
+ qd_CheckPackage=8,
+ qd_CheckPackageOption=16,
+ qd_CheckFontsize=32,
+ qd_CheckPapersize=64
+};
+
+class QuickDocument : public Wizard
+{
+ Q_OBJECT
+
+public:
+ QuickDocument(KConfig *, QWidget *parent=0, const char *name=0, const QString &caption = QString::null);
+ ~QuickDocument();
+
+ bool isStandardClass(const QString &classname);
+ bool isDocumentClass(const QString &name);
+ bool isDocumentClassOption(const QString &option);
+ bool isPackage(const QString &package);
+ bool isPackageOption(const QString &package, const QString &option);
+
+public slots:
+ void slotOk();
+
+private:
+ KComboBox *m_cbDocumentClass;
+ KComboBox *m_cbTypefaceSize;
+ KComboBox *m_cbPaperSize;
+ KComboBox *m_cbEncoding;
+ QListView *m_lvClassOptions;
+ QListView *m_lvPackages;
+ KLineEdit *m_leAuthor;
+ KLineEdit *m_leTitle;
+ KLineEdit *m_leDate;
+ QLabel *m_lbPaperSize;
+
+ QString m_currentClass;
+ QString m_currentFontsize;
+ QString m_currentPapersize;
+ QString m_currentEncoding;
+ bool m_currentHyperref;
+ QString m_hyperrefdriver;
+ QString m_hyperrefsetup;
+ QStringList m_userClasslist;
+ QStringList m_deleteDocumentClasses;
+
+ QMap<QString,QStringList> m_dictDocumentClasses;
+ QMap<QString,bool> m_dictStandardClasses;
+ QMap<QString,bool> m_currentDefaultOptions;
+ QMap<QString,bool> m_currentSelectedOptions;
+ QMap<QString,bool> m_dictPackagesEditable;
+ QMap<QString,QString> m_dictPackagesDefaultvalues;
+ QMap<QString,bool> m_dictHyperrefDriver;
+
+ KPushButton *m_btnDocumentClassAdd;
+ KPushButton *m_btnDocumentClassDelete;
+ KPushButton *m_btnTypefaceSizeAdd;
+ KPushButton *m_btnTypefaceSizeDelete;
+ KPushButton *m_btnPaperSizeAdd;
+ KPushButton *m_btnPaperSizeDelete;
+ KPushButton *m_btnEncodingAdd;
+ KPushButton *m_btnEncodingDelete;
+
+ KPushButton *m_btnClassOptionsAdd;
+ KPushButton *m_btnClassOptionsEdit;
+ KPushButton *m_btnClassOptionsDelete;
+ KPushButton *m_btnPackagesAdd;
+ KPushButton *m_btnPackagesAddOption;
+ KPushButton *m_btnPackagesEdit;
+ KPushButton *m_btnPackagesDelete;
+ KPushButton *m_btnPackagesReset;
+
+ // GUI
+ QWidget *setupClassOptions(QTabWidget *tab);
+ QWidget *setupPackages(QTabWidget *tab);
+ QWidget *setupProperties(QTabWidget *tab);
+
+ // read/write config files and init data
+ void readConfig();
+ void readDocumentClassConfig();
+ void readPackagesConfig();
+ void initHyperref();
+ void writeConfig();
+ void writeDocumentClassConfig();
+ void writePackagesConfig();
+
+ // document class tab
+ void initDocumentClass();
+ void initStandardClass(const QString &classname,const QString &fontsize,
+ const QString &papersize,const QString &defaultoptions,
+ const QString &selectedoptions);
+ void initStandardOptions(const QString &classname,QStringList &optionlist);
+ void setDefaultClassOptions(const QString &defaultoptions);
+ void setSelectedClassOptions(const QString &selectedoptions);
+ void setClassOptions(const QStringList &list,uint start);
+ void updateClassOptions();
+ QString getClassOptions();
+ void fillDocumentClassCombobox();
+ void fillCombobox(KComboBox *combo, const QString &cslist,const QString &seltext);
+ bool addComboboxEntries(KComboBox *combo, const QString &title,const QString &entry);
+ QString getComboxboxList(KComboBox *combo);
+
+ bool isDefaultClassOption(const QString &option);
+ bool isSelectedClassOption(const QString &option);
+ QString stripDefault(const QString &s);
+
+ // packages tab
+ void initPackages();
+ bool readPackagesListview();
+ QCheckListItem *insertListview(QListView *listview,
+ const QString &entry,
+ const QString &description);
+ QCheckListItem *insertListview(QCheckListItem *parent,
+ const QString &entry,
+ const QString &description);
+ QCheckListItem *insertEditableListview(QCheckListItem *parent,
+ const QString &entry,const QString &description,
+ const QString value,const QString defaultvalue);
+ bool isListviewEntry(QListView *listview,const QString &entry);
+ void setPackagesValue(QListViewItem *item,const QString &option,const QString &val);
+ QString getPackagesValue(const QString &value);
+
+ bool isListviewChild(QListView *listview,const QString &entry, const QString &option);
+ QString addPackageDefault(const QString &option,const QString &description);
+ QString stripPackageDefault(const QString &option,const QString &description);
+ bool isHyperrefDriver(const QString &name);
+
+ // document template
+ void printTemplate();
+ void printPackages();
+ void printHyperref();
+ void printBeamerTheme();
+
+ // input dialog
+ bool inputDialog(QStringList &list,int check=qd_CheckNotEmpty);
+
+private slots:
+ void slotDocumentClassAdd();
+ void slotDocumentClassDelete();
+ void slotDocumentClassChanged(int index);
+ void slotTypefaceSizeAdd();
+ void slotTypefaceSizeDelete();
+ void slotPaperSizeAdd();
+ void slotPaperSizeDelete();
+ void slotOptionDoubleClicked(QListViewItem *listViewItem,const QPoint &,int);
+ void slotClassOptionAdd();
+ void slotClassOptionEdit();
+ void slotClassOptionDelete();
+
+ void slotCheckParent(QListViewItem *listViewItem);
+ void slotPackageDoubleClicked(QListViewItem *listViewItem,const QPoint &,int);
+ void slotPackageAdd();
+ void slotPackageAddOption();
+ void slotPackageEdit();
+ void slotPackageDelete();
+ void slotPackageReset();
+
+ void slotEnableButtons();
+};
+
+class QuickDocumentInputDialog : public KDialogBase {
+ Q_OBJECT
+public:
+ QuickDocumentInputDialog(const QStringList &list,int check=0,
+ QuickDocument *parent=0, const char *name=0);
+ ~QuickDocumentInputDialog();
+
+ void getResults(QStringList &list);
+
+private:
+ QuickDocument *m_parent;
+ int m_check;
+
+ QStringList m_description;
+ QValueList<QWidget *> m_objectlist;
+
+ QString getPackageName(const QString &text);
+ bool checkListEntries(const QString &title, const QString &textlist,const QString &pattern);
+
+private slots:
+ void slotOk();
+};
+
+} // namespace
+
+#endif
diff --git a/src/kile/quickpreview.cpp b/src/kile/quickpreview.cpp
new file mode 100644
index 0000000..c851361
--- /dev/null
+++ b/src/kile/quickpreview.cpp
@@ -0,0 +1,426 @@
+/***************************************************************************
+ date : Feb 15 2007
+ version : 0.34
+ copyright : (C) 2005-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "quickpreview.h"
+#include "kiletool_enums.h"
+#include "kiledocmanager.h"
+#include "kilelogwidget.h"
+
+#include <qtextstream.h>
+#include <qtextcodec.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+#include <qmap.h>
+
+#include "kiledebug.h"
+#include <ktempdir.h>
+#include <klocale.h>
+#include <kconfig.h>
+#include <kileconfig.h>
+#include <kate/document.h>
+
+namespace KileTool
+{
+
+QuickPreview::QuickPreview(KileInfo *ki) : m_ki(ki), m_tempfile(QString::null), m_running(0)
+{
+ m_taskList << i18n("LaTeX ---> DVI")
+ << i18n("LaTeX ---> DVI (KDVI)")
+ << i18n("LaTeX ---> PS")
+ << i18n("LaTeX ---> PS (KGhostView)")
+ << i18n("PDFLaTeX ---> PDF")
+ << i18n("PDFLaTeX ---> PDF (KGhostView)")
+ << i18n("PDFLaTeX ---> PDF (KPDF)")
+ ;
+}
+
+QuickPreview::~QuickPreview()
+{
+ removeTempFiles(true);
+}
+
+//////////////////// quick preview ////////////////////
+
+// compile and view current selection (singlemode and mastermode)
+
+void QuickPreview::previewSelection(Kate::Document *doc, bool previewInWidgetConfig)
+{
+ if ( doc->hasSelection() )
+ {
+ if ( previewInWidgetConfig && KileConfig::selPreviewInWidget() )
+ {
+ m_ki->previewWidget()->showActivePreview( doc->selection(),m_ki->getName(doc),doc->selStartLine(),KileTool::qpSelection );
+ }
+ else
+ {
+ run( doc->selection(),m_ki->getName(doc),doc->selStartLine() );
+ doc->clearSelection();
+ }
+ }
+ else
+ {
+ showError( i18n("There is no selection to compile.") );
+ }
+}
+
+// compile and view current environment (singlemode and mastermode)
+
+void QuickPreview::previewEnvironment(Kate::Document *doc)
+{
+ uint row,col;
+ QString envname;
+ QString text = m_ki->editorExtension()->getEnvironmentText(row,col,envname);
+ if ( text != QString::null )
+ {
+ if ( m_ki->latexCommands()->isMathModeEnv(envname) )
+ text = '$' + text + '$';
+ else if ( m_ki->latexCommands()->isDisplaymathModeEnv(envname) )
+ text = "\\[" + text + "\\]";
+
+ if ( KileConfig::envPreviewInWidget() )
+ m_ki->previewWidget()->showActivePreview( text,m_ki->getName(doc),row,KileTool::qpEnvironment );
+ else
+ run( text,m_ki->getName(doc),row );
+ }
+ else
+ {
+ showError( i18n("There is no surrounding environment.") );
+ }
+}
+
+// compile and view current subdocument (only mastermode)
+
+void QuickPreview::previewSubdocument(Kate::Document *doc)
+{
+ // this mode is only useful with a master document
+ if ( !m_ki->docManager()->activeProject() && m_ki->getSinglemode() )
+ {
+ showError( i18n("This job is only useful with a master document.") );
+ return;
+ }
+
+ // the current document should not be the master document
+ QString filename = doc->url().path();
+ if ( filename == m_ki->getCompileName() )
+ {
+ showError( i18n("This is not a subdocument, but the master document.") );
+ return;
+ }
+
+ run( doc->text(),m_ki->getName(doc),0 );
+}
+
+// compile and view current mathgroup (singlemode and mastermode)
+
+void QuickPreview::previewMathgroup(Kate::Document *doc)
+{
+ uint row,col;
+ QString text = m_ki->editorExtension()->getMathgroupText(row,col);
+ if ( text != QString::null )
+ {
+ if ( KileConfig::mathgroupPreviewInWidget() )
+ m_ki->previewWidget()->showActivePreview( text,m_ki->getName(doc),row,KileTool::qpMathgroup );
+ else
+ run( text,m_ki->getName(doc),row );
+ }
+ else
+ {
+ showError( i18n("There is no surrounding mathgroup.") );
+ }
+
+}
+
+//////////////////// run quick preview ////////////////////
+
+void QuickPreview::getTaskList(QStringList &tasklist)
+{
+ tasklist.clear();
+ tasklist << "Tool/ViewDVI/Embedded Viewer=" + m_taskList[0]
+ << "Tool/ViewDVI/KDVI Unique=" + m_taskList[1]
+ << "Tool/ViewPS/Embedded Viewer=" + m_taskList[2]
+ << "Tool/ViewPS/KGhostView=" + m_taskList[3]
+ << "Tool/ViewPDF/Embedded Viewer=" + m_taskList[4]
+ << "Tool/ViewPDF/KGhostView=" + m_taskList[5]
+ << "Tool/ViewPDF/KPDF=" + m_taskList[6]
+ ;
+}
+
+bool QuickPreview::isRunning()
+{
+ return ( m_running > 0 );
+}
+
+bool QuickPreview::run(const QString &text,const QString &textfilename,int startrow)
+{
+ // define possible tools
+ QMap <QString,QString> map;
+ map[m_taskList[0]] = "PreviewLaTeX,,,ViewDVI,Embedded Viewer,dvi";
+ map[m_taskList[1]] = "PreviewLaTeX,,,ViewDVI,KDVI Unique,dvi";
+ map[m_taskList[2]] = "PreviewLaTeX,DVItoPS,Default,ViewPS,Embedded Viewer,ps";
+ map[m_taskList[3]] = "PreviewLaTeX,DVItoPS,Default,ViewPS,KGhostView,ps";
+ map[m_taskList[4]] = "PreviewPDFLaTeX,,,ViewPDF,KPDF (embedded),pdf";
+ map[m_taskList[5]] = "PreviewPDFLaTeX,,,ViewPDF,KGhostView,pdf";
+ map[m_taskList[6]] = "PreviewPDFLaTeX,,,ViewPDF,KPDF,pdf";
+
+ QString previewtask = KileConfig::previewTask();
+ if ( ! map.contains(previewtask) )
+ {
+ showError(QString(i18n("Could not run QuickPreview:\nunknown task '%1'").arg(previewtask)));
+ return false;
+ }
+
+ return run (text, textfilename, startrow, map[previewtask]);
+}
+
+bool QuickPreview::run(const QString &text,const QString &textfilename,int startrow,const QString &spreviewlist)
+{
+ KILE_DEBUG() << "==QuickPreview::run()==========================" << endl;
+ m_ki->logWidget()->clear();
+ if ( m_running > 0 )
+ {
+ showError( i18n("There is already a preview running, which you have to finish to run this one.") );
+ return false;
+ }
+
+ // check if there is something to compile
+ if ( text.isEmpty() )
+ {
+ showError(i18n("There is nothing to compile and preview."));
+ return false;
+ }
+
+ // create the name of a temporary file or delete already existing temporary files
+ if ( m_tempfile.isEmpty() )
+ {
+ m_tempfile = KTempDir(QString::null).name() + "preview.tex";
+ KILE_DEBUG() << "\tdefine tempfile: " << m_tempfile << endl;
+ }
+ else
+ {
+ removeTempFiles();
+ }
+
+ // create the temporary file with preamble and text
+ int preamblelines = createTempfile(text);
+ if ( preamblelines == 0 )
+ return false;
+
+ QStringList previewlist = QStringList::split(",",spreviewlist,true);
+
+ // create preview tools
+ KILE_DEBUG() << "\tcreate latex tool for QuickPreview: " << previewlist[pvLatex] << endl;
+ KileTool::PreviewLaTeX *latex = (KileTool::PreviewLaTeX *)m_ki->toolFactory()->create(previewlist[pvLatex],false);
+ if ( !latex )
+ {
+ showError(QString(i18n("Could not run '%1' for QuickPreview.").arg("LaTeX")));
+ return false;
+ }
+
+ KileTool::Base *dvips = 0L;
+ if ( ! previewlist[1].isEmpty() )
+ {
+ QString dvipstool = previewlist[pvDvips] + " (" + previewlist[pvDvipsCfg] + ')';
+ KILE_DEBUG() << "\tcreate dvips tool for QuickPreview: " << previewlist[pvDvips] << endl;
+ dvips = m_ki->toolFactory()->create(previewlist[pvDvips]);
+ if ( !dvips )
+ {
+ showError(QString(i18n("Could not run '%1' for QuickPreview.").arg(dvipstool)));
+ return false;
+ }
+ }
+
+ KileTool::Base *viewer = 0L;
+ if ( !previewlist[pvViewer].isEmpty() )
+ {
+ QString viewertool = previewlist[pvViewer] + " (" + previewlist[pvViewerCfg] + ')';
+ KILE_DEBUG() << "\tcreate viewer for QuickPreview: " << viewertool << endl;
+ viewer = m_ki->toolFactory()->create(previewlist[pvViewer],false);
+ if ( !viewer )
+ {
+ showError(QString(i18n("Could not run '%1' for QuickPreview.").arg(viewertool)));
+ return false;
+ }
+ }
+
+ // set value of texinput path (only for QuickPreview tools)
+ QString texinputpath = KileConfig::teXPaths();
+ QString inputdir = QFileInfo(m_ki->getCompileName()).dirPath(true);
+ if ( ! texinputpath.isEmpty() )
+ inputdir += ':' + texinputpath;
+ KileConfig::setPreviewTeXPaths(inputdir);
+ KILE_DEBUG() << "\tQuickPreview: inputdir is '" << inputdir << "'" << endl;
+
+ // prepare tools: previewlatex
+ QString filepath = m_tempfile.left( m_tempfile.length()-3 );
+ latex->setPreviewInfo(textfilename,startrow,preamblelines+1);
+ latex->setSource(m_tempfile);
+ latex->prepareToRun();
+ latex->setQuickie();
+ if ( m_ki->toolManager()->run(latex) != KileTool::Running )
+ return false;
+
+ connect(latex, SIGNAL(destroyed()), this, SLOT(toolDestroyed()));
+ m_running++;
+
+ // dvips
+ if ( dvips )
+ {
+ dvips->setSource( filepath + "dvi" );
+ dvips->setQuickie();
+ if ( m_ki->toolManager()->run(dvips,previewlist[pvDvipsCfg]) != KileTool::Running )
+ return false;
+
+ connect(dvips, SIGNAL(destroyed()), this, SLOT(toolDestroyed()));
+ m_running++;
+ }
+
+ // viewer
+ if ( viewer )
+ {
+ connect(viewer, SIGNAL(destroyed()), this, SLOT(toolDestroyed()));
+ viewer->setSource( filepath + previewlist[pvExtension] );
+ viewer->setQuickie();
+ if ( m_ki->toolManager()->run(viewer,previewlist[pvViewerCfg]) != KileTool::Running )
+ return false;
+ }
+
+ return true;
+}
+
+void QuickPreview::toolDestroyed()
+{
+ KILE_DEBUG() << "\tQuickPreview: tool destroyed" << endl;
+ if ( m_running > 0 )
+ m_running--;
+}
+
+QString QuickPreview::getPreviewFile(const QString &extension)
+{
+ if (m_tempfile.length () < 3)
+ return QString::null;
+
+ QString filepath = m_tempfile.left(m_tempfile.length () - 3);
+ return filepath + extension;
+}
+
+//////////////////// tempfile ////////////////////
+
+int QuickPreview::createTempfile(const QString &text)
+{
+ // determine main document to read the preamble
+ QString filename = m_ki->getCompileName();
+ if ( filename.isEmpty() )
+ {
+ showError(i18n("Could not determine the main document."));
+ return 0;
+ }
+
+ // open to read
+ QFile fin( filename );
+ if ( !fin.exists() || !fin.open(IO_ReadOnly) )
+ {
+ showError(i18n("Could not read the preamble."));
+ return 0;
+ }
+ KILE_DEBUG() << "\tcreate a temporary file: " << m_tempfile << endl;
+
+ // use a textstream
+ QTextStream preamble(&fin);
+
+ // create the temporary file
+ QFile tempfile(m_tempfile);
+ if ( ! tempfile.open( IO_WriteOnly ) )
+ {
+ showError(i18n("Could not create a temporary file."));
+ return 0;
+ }
+ QTextStream stream( &tempfile );
+
+ // set the encoding according to the original file (tbraun)
+ if(m_ki->activeTextDocument())
+ {
+ QTextCodec *codec = QTextCodec::codecForName(m_ki->activeTextDocument()->encoding().ascii());
+ if ( codec )
+ stream.setCodec(codec);
+ }
+ // write the whole preamble into this temporary file
+ QString textline;
+ int preamblelines = 0;
+ bool begindocumentFound = false;
+ while ( ! preamble.eof() )
+ {
+ textline = preamble.readLine();
+ if ( textline.find("\\begin{document}") >= 0 )
+ {
+ begindocumentFound = true;
+ break;
+ }
+ stream << textline << "\n";
+ preamblelines++;
+ }
+
+ // look if we found '\begin{document}' to finish the preamble
+ if ( ! begindocumentFound )
+ {
+ tempfile.close();
+ showError(i18n("Could not find a '\\begin{document}' command."));
+ return 0;
+ }
+
+ // add the text to compile
+ stream << "\\pagestyle{empty}\n";
+ stream << "\\begin{document}\n";
+ stream << text;
+ stream << "\n\\end{document}\n";
+ tempfile.close();
+
+ return preamblelines;
+}
+
+void QuickPreview::removeTempFiles(bool rmdir)
+{
+ if ( m_tempfile.isEmpty() )
+ return;
+
+ QFileInfo fi(m_tempfile);
+ QString tempdir = fi.dirPath(true) + '/';
+
+ QDir dir = fi.dir(true);
+ if ( dir.exists() )
+ {
+ QStringList list = dir.entryList(fi.baseName()+".*");
+ for ( QStringList::Iterator it=list.begin(); it!=list.end(); ++it )
+ {
+ QFile::remove( tempdir + (*it) );
+ // KILE_DEBUG() << "\tremove temporary file: " << tempdir + (*it) << endl;
+ }
+
+ if ( rmdir )
+ dir.rmdir(tempdir);
+ }
+}
+
+//////////////////// error messages ////////////////////
+
+void QuickPreview::showError(const QString &text)
+{
+ m_ki->logWidget()->printMsg( KileTool::Error, text, i18n("QuickPreview") );
+}
+
+}
+
+#include "quickpreview.moc"
diff --git a/src/kile/quickpreview.h b/src/kile/quickpreview.h
new file mode 100644
index 0000000..eb4172b
--- /dev/null
+++ b/src/kile/quickpreview.h
@@ -0,0 +1,98 @@
+/***************************************************************************
+ date : Feb 15 2007
+ version : 0.34
+ copyright : (C) 2005-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef QUICKPREVIEW_H
+#define QUICKPREVIEW_H
+
+#include "kileinfo.h"
+#include "kiletool.h"
+#include "kileedit.h"
+#include "previewwidget.h"
+
+#include <qobject.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+namespace KileTool
+{
+enum { qpSelection=0, qpEnvironment, qpSubdocument, qpMathgroup };
+
+class QuickPreview : public QObject
+{
+ Q_OBJECT
+
+public:
+ QuickPreview(KileInfo *ki);
+ ~QuickPreview();
+
+ bool run(const QString &text,const QString &textfilename,int startrow);
+ bool isRunning();
+
+ void previewEnvironment(Kate::Document *doc);
+ void previewSelection(Kate::Document *doc, bool previewInWidgetConfig=true);
+ void previewSubdocument(Kate::Document *doc);
+ void previewMathgroup(Kate::Document *doc);
+
+ /**
+ * run (text, textfilename, startrow) works with the
+ * default configuration for QuickPreview. This method
+ * supports a forth parameter to choose the configuration as
+ * comma - separated string as you can see them in run (text, textfilename, startrow)
+ *
+ * It is also possible not to specify a viewer, so the viewer is not
+ * executed.
+ *
+ * @param text Text to preview
+ * @param textfilename Filename of the document
+ * @param startrow Position of preview text in the document
+ * @param spreviewlist user defined configuration, e.g. "PreviewLaTeX,DVItoPS,,,ps" (with no preview)
+ * @return true if method succeeds, else false
+ */
+ bool run (const QString &text, const QString &textfilename, int startrow, const QString &spreviewlist);
+ void getTaskList(QStringList &tasklist);
+
+ /**
+ * QuickPreview uses temporary files for processing the output.
+ * If you want to work with files from QuickPreview, you
+ * can use this method. The method run returns true, and then
+ * you can get the generated ps e.g. with getPreviewFile ("eps");
+ * It works with all extensions which are generated while running
+ * the corresponding tools (e.g. tex, dvi, ps, pdf, ...)
+ *
+ * @param extension defines which file to use
+ * @return The temporary file with extension
+ */
+ QString getPreviewFile(const QString &extension);
+
+private slots:
+ void toolDestroyed();
+
+private:
+ enum { pvLatex=0, pvDvips=1, pvDvipsCfg=2, pvViewer=3, pvViewerCfg=4, pvExtension=5 };
+
+ KileInfo *m_ki;
+ QString m_tempfile;
+ QStringList m_taskList;
+ int m_running;
+
+ int createTempfile(const QString &text);
+ void removeTempFiles(bool rmdir=false);
+ void showError(const QString &text);
+};
+
+}
+
+#endif
diff --git a/src/kile/quicktoolconfigwidget.ui b/src/kile/quicktoolconfigwidget.ui
new file mode 100644
index 0000000..85b1ee3
--- /dev/null
+++ b/src/kile/quicktoolconfigwidget.ui
@@ -0,0 +1,218 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>QuickToolConfigWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>QuickToolConfigWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>407</width>
+ <height>216</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KComboBox" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_cbTools</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_lbTool</cstring>
+ </property>
+ <property name="text">
+ <string>Tool:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="3">
+ <property name="name">
+ <cstring>m_lbConfig</cstring>
+ </property>
+ <property name="text">
+ <string>Configuration:</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="4">
+ <property name="name">
+ <cstring>m_cbConfigs</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_pshbAdd</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_pshbRemove</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="5" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_pshbDown</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Down</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_pshbUp</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Up</string>
+ </property>
+ </widget>
+ <spacer row="3" column="0">
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KListBox" row="1" column="2" rowspan="5" colspan="3">
+ <property name="name">
+ <cstring>m_lstbSeq</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_pshbAdd</sender>
+ <signal>clicked()</signal>
+ <receiver>QuickToolConfigWidget</receiver>
+ <slot>add()</slot>
+ </connection>
+ <connection>
+ <sender>m_pshbRemove</sender>
+ <signal>clicked()</signal>
+ <receiver>QuickToolConfigWidget</receiver>
+ <slot>remove()</slot>
+ </connection>
+ <connection>
+ <sender>m_pshbUp</sender>
+ <signal>clicked()</signal>
+ <receiver>QuickToolConfigWidget</receiver>
+ <slot>up()</slot>
+ </connection>
+ <connection>
+ <sender>m_pshbDown</sender>
+ <signal>clicked()</signal>
+ <receiver>QuickToolConfigWidget</receiver>
+ <slot>down()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in implementation">klocale.h</include>
+ <include location="local" impldecl="in implementation">kiletoolmanager.h</include>
+ <include location="global" impldecl="in implementation">qstring.h</include>
+ <include location="global" impldecl="in implementation">kglobal.h</include>
+ <include location="local" impldecl="in implementation">quicktoolconfigwidget.ui.h</include>
+</includes>
+<variables>
+ <variable access="private">QString m_sequence;</variable>
+</variables>
+<signals>
+ <signal>sequenceChanged(const QString &amp;)</signal>
+</signals>
+<slots>
+ <slot>updateSequence( const QString &amp; sequence )</slot>
+ <slot>updateConfigs( const QString &amp; tool )</slot>
+ <slot access="private" specifier="non virtual">down()</slot>
+ <slot access="private" specifier="non virtual">up()</slot>
+ <slot access="private" specifier="non virtual">remove()</slot>
+ <slot access="private" specifier="non virtual">add()</slot>
+ <slot access="private" specifier="non virtual">changed()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/kile/quicktoolconfigwidget.ui.h b/src/kile/quicktoolconfigwidget.ui.h
new file mode 100644
index 0000000..0b6ff9d
--- /dev/null
+++ b/src/kile/quicktoolconfigwidget.ui.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions or slots use
+** Qt Designer which will update this file, preserving your code. Create an
+** init() function in place of a constructor, and a destroy() function in
+** place of a destructor.
+*****************************************************************************/
+
+void QuickToolConfigWidget::updateSequence(const QString &sequence)
+{
+ QStringList toollist = KileTool::toolList(KGlobal::config(), true);
+ toollist.sort();
+ m_cbTools->clear();
+ m_cbTools->insertStringList(toollist);
+
+ updateConfigs(m_cbTools->currentText());
+ connect(m_cbTools, SIGNAL(activated(const QString &)), this, SLOT(updateConfigs(const QString& )));
+
+ m_sequence=sequence;
+ QStringList list = QStringList::split(",",sequence);
+ QString tl,cfg;
+ m_lstbSeq->clear();
+ for ( uint i=0; i < list.count(); ++i)
+ {
+ KileTool::extract(list[i], tl, cfg);
+ if ( !cfg.isNull() )
+ m_lstbSeq->insertItem(tl+" ("+cfg+")");
+ else
+ m_lstbSeq->insertItem(tl);
+ }
+}
+
+void QuickToolConfigWidget::updateConfigs(const QString &tool)
+{
+ m_cbConfigs->clear();
+ m_cbConfigs->insertItem(i18n("Not Specified"));
+ m_cbConfigs->insertStringList(KileTool::configNames(tool, KGlobal::config()));
+}
+
+void QuickToolConfigWidget::down()
+{
+ int current = m_lstbSeq->currentItem();
+ if ( (current != -1) && (current < ( ((int)m_lstbSeq->count())-1) ))
+ {
+ QString text = m_lstbSeq->text(current+1);
+ m_lstbSeq->changeItem(m_lstbSeq->text(current), current+1);
+ m_lstbSeq->changeItem(text, current);
+ m_lstbSeq->setCurrentItem(current+1);
+ changed();
+ }
+}
+
+void QuickToolConfigWidget::up()
+{
+ int current = m_lstbSeq->currentItem();
+ if ( (current != -1) && (current > 0) )
+ {
+ QString text = m_lstbSeq->text(current-1);
+ m_lstbSeq->changeItem(m_lstbSeq->text(current), current-1);
+ m_lstbSeq->changeItem(text, current);
+ m_lstbSeq->setCurrentItem(current-1);
+ changed();
+ }
+}
+
+void QuickToolConfigWidget::remove()
+{
+ int current = m_lstbSeq->currentItem();
+ if ( current != -1)
+ {
+ m_lstbSeq->removeItem(current);
+ changed();
+ }
+}
+
+void QuickToolConfigWidget::add()
+{
+ QString entry = m_cbTools->currentText();
+ if ( m_cbConfigs->currentText() != i18n("Not Specified") )
+ entry += " (" + m_cbConfigs->currentText() + ")";
+ m_lstbSeq->insertItem(entry);
+ changed();
+}
+
+
+void QuickToolConfigWidget::changed()
+{
+ QString sequence, tool, cfg;
+ for (uint i = 0; i < m_lstbSeq->count(); ++i)
+ {
+ KileTool::extract(m_lstbSeq->text(i), tool, cfg);
+ sequence += KileTool::format(tool,cfg)+",";
+ }
+ if (sequence.endsWith(",") ) sequence = sequence.left(sequence.length()-1);
+ m_sequence = sequence;
+ emit sequenceChanged(m_sequence);
+}
diff --git a/src/kile/scriptingconfigwidget.ui b/src/kile/scriptingconfigwidget.ui
new file mode 100644
index 0000000..3ab3fe3
--- /dev/null
+++ b/src/kile/scriptingconfigwidget.ui
@@ -0,0 +1,219 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KileWidgetScriptingConfig</class>
+<author>Michel Ludwig (michel.ludwig@kdemail.net)</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KileWidgetScriptingConfig</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>340</width>
+ <height>198</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Scripting Support</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_ScriptingEnabled</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Enable &amp;scripting</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>executionTimeLimitGroupBox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Execution Time Limit</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_TimeLimitEnabled</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Limit the execution time of scripts</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Time limit (seconds):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_TimeLimit</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KIntNumInput">
+ <property name="name">
+ <cstring>kcfg_TimeLimit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>kcfg_ScriptingEnabled</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>executionTimeLimitGroupBox</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>kcfg_TimeLimitEnabled</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>kcfg_TimeLimit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>kcfg_TimeLimitEnabled</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">scriptingconfigwidget.ui.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/src/kile/scriptsmanagementwidget.cpp b/src/kile/scriptsmanagementwidget.cpp
new file mode 100644
index 0000000..9360f38
--- /dev/null
+++ b/src/kile/scriptsmanagementwidget.cpp
@@ -0,0 +1,171 @@
+/**************************************************************************
+* Copyright (C) 2006, 2007 by Michel Ludwig (michel.ludwig@kdemail.net) *
+***************************************************************************/
+
+/**************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "scriptsmanagementwidget.h"
+
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qvbox.h>
+
+#include <kiconloader.h>
+#include <kinputdialog.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+#include "editorkeysequencemanager.h"
+#include "kiledocmanager.h"
+#include "kileinfo.h"
+#include "kilejscript.h"
+
+namespace KileWidget {
+
+JScriptListViewItem::JScriptListViewItem(QWidget *managementWidget, KListView *parent, KileJScript::JScript *script, KileInfo *kileInfo) : KListViewItem(parent), m_script(script), m_kileInfo(kileInfo), m_managementWidget(managementWidget) {
+}
+
+JScriptListViewItem::~JScriptListViewItem() {
+}
+
+KileJScript::JScript* JScriptListViewItem::getScript() {
+ return m_script;
+}
+
+QString JScriptListViewItem::text(int column) const {
+ switch(column) {
+ case 0:
+ return m_script->getName();
+ case 1:
+ return m_script->getKeySequence();
+ }
+ return QString();
+}
+
+
+void JScriptListViewItem::setText(int column, const QString & str) {
+ if(column == 1) {
+ QString oldAssignedString = m_script->getKeySequence();
+ if(str.isEmpty()) {
+ // don't reload the list view here as this may cause a segfault (for example on x86_64)
+ QObject::disconnect(m_kileInfo->editorKeySequenceManager(), SIGNAL(watchedKeySequencesChanged()), m_managementWidget, SLOT(updateListView()));
+ m_kileInfo->scriptManager()->removeEditorKeySequence(m_script);
+ QObject::connect(m_kileInfo->editorKeySequenceManager(), SIGNAL(watchedKeySequencesChanged()), m_managementWidget, SLOT(updateListView()));
+ }
+ else if(str == oldAssignedString || (str.isEmpty() && oldAssignedString.isEmpty())) {
+ return;
+ }
+ else {
+ QPair<int, QString> pair = m_kileInfo->editorKeySequenceManager()->checkSequence(str, oldAssignedString);
+ if(pair.first == 0) {
+ // don't reload the list view here as this may cause a segfault (for example on x86_64)
+ QObject::disconnect(m_kileInfo->editorKeySequenceManager(), SIGNAL(watchedKeySequencesChanged()), m_managementWidget, SLOT(updateListView()));
+ m_kileInfo->scriptManager()->setEditorKeySequence(m_script, str);
+ QObject::connect(m_kileInfo->editorKeySequenceManager(), SIGNAL(watchedKeySequencesChanged()), m_managementWidget, SLOT(updateListView()));
+ return; // leaving !
+ }
+ KileEditorKeySequence::Action *action = m_kileInfo->editorKeySequenceManager()->getAction(pair.second);
+ QString description = (action == 0L) ? QString() : action->getDescription();
+ switch(pair.first) {
+ case 1:
+ KMessageBox::sorry(0L, i18n("The sequence \"%1\" is already assigned to the action \"%2\"").arg(str).arg(description), i18n("Sequence Already Assigned"));
+ break;
+ case 2:
+ KMessageBox::sorry(0L, i18n("The sequence \"%1\" is a subsequence of \"%2\", which is already assigned to the action \"%3\"").arg(str).arg(pair.second).arg(description), i18n("Sequence Already Assigned"));
+ break;
+ case 3:
+ KMessageBox::sorry(0L, i18n("The shorter sequence \"%1\" is already assigned to the action \"%2\"").arg(pair.second).arg(description), i18n("Sequence Already Assigned"));
+ break;
+ }
+ }
+ }
+}
+
+ScriptsManagement::ScriptsManagement(KileInfo *kileInfo, QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f), m_kileInfo(kileInfo) {
+ QVBoxLayout *baseLayout = new QVBoxLayout(this);
+
+ m_toolbar = new KToolBar(this, "scriptControlToolBar");
+ m_executeButton = m_toolbar->insertButton(BarIcon("exec"), 0, SIGNAL(clicked(int)), this, SLOT(executeSelectedScript()), true, i18n("Run Selected Script"));
+ m_newButton = m_toolbar->insertButton(BarIcon("scriptnew"), 0, SIGNAL(clicked(int)), m_kileInfo->docManager(), SLOT(createNewJScript()), true, i18n("Create New Script"));
+ m_openButton = m_toolbar->insertButton(BarIcon("scriptopen"), 0, SIGNAL(clicked(int)), this, SLOT(openSelectedScript()), true, i18n("Open Selected Script in Editor"));
+// m_toolbar->insertButton(BarIcon("configure_shortcuts"), 0, SIGNAL(clicked(int)), this, SLOT(configureSelectedShortcut()), true, i18n("Configure Shortcut"));
+// m_toolbar->insertButton(BarIcon("editclear"), 1, SIGNAL(clicked(int)), m_kileInfo->scriptManager(), SLOT(scanJScriptDirectories()), true, i18n("Refresh"));
+ m_refreshButton = m_toolbar->insertButton(BarIcon("reload"), 1, SIGNAL(clicked(int)), m_kileInfo->scriptManager(), SLOT(scanJScriptDirectories()), true, i18n("Refresh List"));
+
+ baseLayout->addWidget(m_toolbar);
+ m_scriptsListView = new KListView(this);
+ m_scriptsListView->addColumn(i18n("Script Name"));
+ m_scriptsListView->addColumn(i18n("Sequence"));
+ m_scriptsListView->setAllColumnsShowFocus(true);
+ m_scriptsListView->setItemsRenameable(true);
+ m_scriptsListView->setRenameable(0, false);
+ m_scriptsListView->setRenameable(1, true);
+
+ connect(m_kileInfo->scriptManager(), SIGNAL(jScriptsChanged()), this, SLOT(updateListView()));
+ connect(m_kileInfo->editorKeySequenceManager(), SIGNAL(watchedKeySequencesChanged()), this, SLOT(updateListView()));
+// connect(m_scriptsListView, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), this, SLOT(executed(QListViewItem*, const QPoint&, int)));
+// connect(m_scriptsListView, SIGNAL(itemRenamed(QListViewItem*, const QString&, int)), this, SLOT(itemRenamed(QListViewItem*, const QString&, int)));
+ connect(m_scriptsListView, SIGNAL(selectionChanged()), this, SLOT(updateButtonPanel()));
+
+ baseLayout->addWidget(m_scriptsListView);
+ updateButtonPanel();
+ updateListView();
+}
+
+ScriptsManagement::~ScriptsManagement() {
+}
+
+
+void ScriptsManagement::updateListView() {
+ m_scriptsListView->clear();
+ const QValueList<KileJScript::JScript*>& scriptList = m_kileInfo->scriptManager()->getJScripts();
+ for(QValueList<KileJScript::JScript*>::const_iterator i = scriptList.begin(); i != scriptList.end(); ++i) {
+ new JScriptListViewItem(this, m_scriptsListView, *i, m_kileInfo);
+ }
+ m_scriptsListView->triggerUpdate();
+}
+
+void ScriptsManagement::openSelectedScript() {
+ QListViewItem *item = m_scriptsListView->selectedItem();
+ if(!item) {
+ return;
+ }
+ JScriptListViewItem *jItem = (JScriptListViewItem*)item;
+ m_kileInfo->docManager()->fileOpen(jItem->getScript()->getFileName());
+}
+
+void ScriptsManagement::executeSelectedScript() {
+ QListViewItem *item = m_scriptsListView->selectedItem();
+ if(!item) {
+ return;
+ }
+ JScriptListViewItem *jItem = (JScriptListViewItem*)item;
+ m_kileInfo->scriptManager()->executeJScript(jItem->getScript());
+}
+
+// void ScriptsManagement::configureSelectedShortcut() {
+// QListViewItem *item = m_scriptsListView->selectedItem();
+// if(!item) {
+// return;
+// }
+// JScriptListViewItem *jItem = (JScriptListViewItem*)item;
+// QString sequence = determineKeySequence();
+// m_kileInfo->scriptManager()->setEditorKeySequence(jItem->getScript(), sequence);
+// }
+
+void ScriptsManagement::updateButtonPanel() {
+ bool b = !(m_scriptsListView->selectedItem() == NULL);
+ m_toolbar->setItemEnabled(m_executeButton, b);
+ m_toolbar->setItemEnabled(m_openButton, b);
+}
+
+}
+
+#include "scriptsmanagementwidget.moc"
diff --git a/src/kile/scriptsmanagementwidget.h b/src/kile/scriptsmanagementwidget.h
new file mode 100644
index 0000000..d8bc657
--- /dev/null
+++ b/src/kile/scriptsmanagementwidget.h
@@ -0,0 +1,101 @@
+/**************************************************************************
+* Copyright (C) 2006 by Michel Ludwig (michel.ludwig@kdemail.net) *
+***************************************************************************/
+
+/**************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef SCRIPTSMANAGEMENTWIDGET_H
+#define SCRIPTSMANAGEMENTWIDGET_H
+
+#include <qtoolbutton.h>
+#include <qwidget.h>
+
+#include <klistview.h>
+#include <ktoolbar.h>
+
+class KileInfo;
+
+namespace KileJScript {
+ class Manager;
+ class JScript;
+};
+
+namespace KileJScript {
+ class Manager;
+};
+
+namespace KileWidget {
+
+ /**
+ * This class represents an entry in the scripts list view.
+ **/
+ class JScriptListViewItem : public KListViewItem {
+ public:
+ JScriptListViewItem(QWidget *managementWidget, KListView *parent, KileJScript::JScript *script, KileInfo *kileInfo);
+ virtual ~JScriptListViewItem();
+
+ KileJScript::JScript* getScript();
+
+ virtual void setText(int column, const QString & text);
+ virtual QString text(int column) const;
+
+ protected:
+ KileJScript::JScript *m_script;
+ KileInfo *m_kileInfo;
+ QWidget *m_managementWidget;
+ };
+
+ /**
+ * This widget is used to handle Kile's scripting functionality.
+ **/
+ class ScriptsManagement : public QWidget {
+ Q_OBJECT
+ public:
+ ScriptsManagement(KileInfo *kileInfo, QWidget *parent = 0, const char *name = 0, WFlags f = 0);
+ ~ScriptsManagement();
+
+// signals:
+
+ public slots:
+ /**
+ * Rebuilds the list view.
+ **/
+ void updateListView();
+
+
+ protected slots:
+ /**
+ * Opens the currently selected script in Kile's editing area.
+ **/
+ void openSelectedScript();
+
+ /**
+ * Executes the currently selected script.
+ **/
+ void executeSelectedScript();
+// void configureSelectedShortcut();
+
+ void updateButtonPanel();
+
+ protected:
+ KileInfo *m_kileInfo;
+ KListView *m_scriptsListView;
+
+ private:
+ int m_newButton;
+ int m_executeButton;
+ int m_openButton;
+ int m_refreshButton;
+ KToolBar *m_toolbar;
+ };
+
+}
+#endif
+
diff --git a/src/kile/structureconfigwidget.ui b/src/kile/structureconfigwidget.ui
new file mode 100644
index 0000000..5f39dca
--- /dev/null
+++ b/src/kile/structureconfigwidget.ui
@@ -0,0 +1,345 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KileWidgetStructureViewConfig</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KileWidgetStructureViewConfig</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>670</width>
+ <height>335</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>Structure View</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Expansion Level</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIntNumInput" row="0" column="2">
+ <property name="name">
+ <cstring>kcfg_DefaultLevel</cstring>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="maxValue">
+ <number>7</number>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Default &amp;value</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_DefaultLevel</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <spacer row="0" column="1">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>200</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="0" column="3">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>60</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>(&amp;1=part, 2=chapter, 3=section, 4=subsection, 5=subsubsection, ...)</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kcfg_DefaultLevel</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>Options</string>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_SvShowLabels</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>23</y>
+ <width>272</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Show &amp;labels</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_SvShowReferences</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>51</y>
+ <width>272</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Show undefined references</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_SvShowSectioningLabels</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>191</y>
+ <width>272</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>No extra section for labels</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_SvShowInputFiles</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>163</y>
+ <width>272</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Show input files</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_SvShowGraphics</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>135</y>
+ <width>272</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Show graphic files</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_SvShowBibitems</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>79</y>
+ <width>272</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Show bibitems</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_SvShowTodo</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>107</y>
+ <width>272</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Show TODO/FIXME</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_SvOpenTodo</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>289</x>
+ <y>107</y>
+ <width>272</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Open TODO/FIXME</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_SvOpenBibitems</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>289</x>
+ <y>79</y>
+ <width>272</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Open bibitems item</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_SvOpenReferences</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>289</x>
+ <y>51</y>
+ <width>272</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Open references item</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_SvOpenLabels</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>289</x>
+ <y>23</y>
+ <width>272</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>&amp;Open labels item</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_SvShowFloats</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>289</x>
+ <y>135</y>
+ <width>340</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Show figure and table en&amp;vironments</string>
+ </property>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/src/kile/symbols/CMakeLists.txt b/src/kile/symbols/CMakeLists.txt
new file mode 100644
index 0000000..dfcf186
--- /dev/null
+++ b/src/kile/symbols/CMakeLists.txt
@@ -0,0 +1,48 @@
+# FILE( GLOB_RECURSE _allFiles * )
+# FOREACH( _file ${_allFiles} )
+# # MESSAGE(STATUS "checking ${_file}")
+# IF( IS_DIRECTORY _file )
+# MESSAGE(STATUS "Installing dir ${_file$}")
+# INSTALL( DIRECTORY _file DESTINATION share/apps/kile/mathsymbols
+# PATTERN ".svn" EXCLUDE
+# PATTERN "Makefile.am" EXCLUDE)
+# ENDIF( IS_DIRECTORY _file )
+# ENDFOREACH( _file )
+
+SET(kile_symbolSubdirs
+ arrows
+ cyrillic
+ delimiters
+ greek
+ misc-math
+ misc-text
+ operators
+ relation
+ special
+)
+
+# for the future:
+# INSTALL( DIRECTORY ${kile_symbolSubdirs} DESTINATION share/apps/kile/mathsymbols
+# PATTERN ".svn" EXCLUDE
+# PATTERN "Makefile.am" EXCLUDE)
+
+FOREACH( _dir ${kile_symbolSubdirs} )
+ ADD_SUBDIRECTORY( ${_dir} )
+ENDFOREACH( _dir )
+
+########### next target ###############
+
+INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${KDE3_INCLUDE_DIR} ${QT_INCLUDE_DIR} )
+INCLUDE( FindKDE3 )
+SET(gesymb_SRCS
+ gesymb.cpp
+ gesymb.h
+)
+KDE3_AUTOMOC(${gesymb_SRCS})
+ADD_EXECUTABLE(gesymb EXCLUDE_FROM_ALL ${gesymb_SRCS} )
+TARGET_LINK_LIBRARIES(gesymb ${QT_AND_KDECORE_LIBS} )
+
+
+########### install files ###############
+
+
diff --git a/src/kile/symbols/Makefile.am b/src/kile/symbols/Makefile.am
new file mode 100644
index 0000000..c10322a
--- /dev/null
+++ b/src/kile/symbols/Makefile.am
@@ -0,0 +1,7 @@
+INCLUDES = $(all_includes)
+
+gesymb_LDFLAGS = $(all_libraries) $(KDE_RPATH) -lqt-mt
+noinst_PROGRAMS = gesymb
+gesymb_SOURCES = gesymb.cpp gesymb.h
+
+SUBDIRS = $(AUTODIRS)
diff --git a/src/kile/symbols/arrows.tex b/src/kile/symbols/arrows.tex
new file mode 100644
index 0000000..aea2ca6
--- /dev/null
+++ b/src/kile/symbols/arrows.tex
@@ -0,0 +1,129 @@
+\documentclass[a4paper,10pt]{article}
+\usepackage{amssymb}
+\usepackage{textcomp}
+
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Author: Thomas Braun
+% begin: Sat 8 april 2006
+% last edit: So 1 april 2007
+% License: GPLv2 or later
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{definitions}
+
+\iffalse
+\newcommand{\begin{neededpkgs}}[2][]{}
+\newcommand{\pkgs}[2][]{}
+\fi
+
+\begin{document}
+
+\mathcommand{\leftarrow}
+\mathcommand{\leftrightarrow}
+\mathcommand{\rightarrow}
+\mathcommand{\mapsto}
+\mathcommand{\longleftarrow}
+\mathcommand{\longleftrightarrow}
+\mathcommand{\longrightarrow}
+\mathcommand{\longmapsto}
+
+\mathcommand{\downarrow}
+\mathcommand{\updownarrow}
+\mathcommand{\uparrow}
+\mathcommand{\nwarrow}
+\mathcommand{\searrow}
+\mathcommand{\nearrow}
+\mathcommand{\swarrow}
+
+\begin{neededpkgs}{textcomp}
+\command{\textdownarrow}
+\command{\textuparrow}
+\command{\textleftarrow}
+\command{\textrightarrow}
+\end{neededpkgs}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\nleftarrow}
+\mathcommand{\nleftrightarrow}
+\mathcommand{\nrightarrow}
+\end{neededpkgs}
+
+\par\bigskip
+
+\mathcommand{\hookleftarrow}
+\mathcommand{\hookrightarrow}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\twoheadleftarrow}
+\mathcommand{\twoheadrightarrow}
+\mathcommand{\leftarrowtail}
+\mathcommand{\rightarrowtail}
+\end{neededpkgs}
+
+\par\bigskip
+
+\mathcommand{\Leftarrow}
+\mathcommand{\Leftrightarrow}
+\mathcommand{\Rightarrow}
+\mathcommand{\Longleftarrow}
+\mathcommand{\Longleftrightarrow}
+\mathcommand{\Longrightarrow}
+\mathcommand{\Updownarrow}
+\mathcommand{\Uparrow}
+\mathcommand{\Downarrow}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\nLeftarrow}
+\mathcommand{\nLeftrightarrow}
+\mathcommand{\nRightarrow}
+\end{neededpkgs}
+
+\par\bigskip
+
+\begin{neededpkgs}{amssymb}
+\mathcommand{\leftleftarrows}
+\mathcommand{\leftrightarrows}
+\mathcommand{\rightleftarrows}
+\mathcommand{\rightrightarrows}
+\mathcommand{\downdownarrows}
+\mathcommand{\upuparrows}
+\end{neededpkgs}
+
+\par\bigskip
+
+\begin{neededpkgs}{amssymb}
+\mathcommand{\circlearrowleft}
+\mathcommand{\circlearrowright}
+\mathcommand{\curvearrowleft}
+\mathcommand{\curvearrowright}
+\mathcommand{\Lsh}
+\mathcommand{\Rsh}
+\mathcommand{\looparrowleft}
+\mathcommand{\looparrowright}
+\end{neededpkgs}
+
+\par\bigskip
+
+\begin{neededpkgs}{amssymb}
+\mathcommand{\dashleftarrow}
+\mathcommand{\dashrightarrow}
+\mathcommand{\leftrightsquigarrow}
+\mathcommand{\rightsquigarrow}
+\mathcommand{\Lleftarrow}
+\end{neededpkgs}
+
+\par\bigskip
+
+\mathcommand{\leftharpoondown}
+\mathcommand{\rightharpoondown}
+\mathcommand{\leftharpoonup}
+\mathcommand{\rightharpoonup}
+\mathcommand{\rightleftharpoons}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\leftrightharpoons}
+\mathcommand{\downharpoonleft}
+\mathcommand{\upharpoonleft}
+\mathcommand{\downharpoonright}
+\mathcommand{\upharpoonright}
+\end{neededpkgs}
+
+\par\bigskip
+
+\end{document}
diff --git a/src/kile/symbols/arrows/CMakeLists.txt b/src/kile/symbols/arrows/CMakeLists.txt
new file mode 100644
index 0000000..287edd2
--- /dev/null
+++ b/src/kile/symbols/arrows/CMakeLists.txt
@@ -0,0 +1,77 @@
+
+SET(symbols
+ img001arrows.png
+ img002arrows.png
+ img003arrows.png
+ img004arrows.png
+ img005arrows.png
+ img006arrows.png
+ img007arrows.png
+ img008arrows.png
+ img009arrows.png
+ img010arrows.png
+ img011arrows.png
+ img012arrows.png
+ img013arrows.png
+ img014arrows.png
+ img015arrows.png
+ img016arrows.png
+ img017arrows.png
+ img018arrows.png
+ img019arrows.png
+ img020arrows.png
+ img021arrows.png
+ img022arrows.png
+ img023arrows.png
+ img024arrows.png
+ img025arrows.png
+ img026arrows.png
+ img027arrows.png
+ img028arrows.png
+ img029arrows.png
+ img030arrows.png
+ img031arrows.png
+ img032arrows.png
+ img033arrows.png
+ img034arrows.png
+ img035arrows.png
+ img036arrows.png
+ img037arrows.png
+ img038arrows.png
+ img039arrows.png
+ img040arrows.png
+ img041arrows.png
+ img042arrows.png
+ img043arrows.png
+ img044arrows.png
+ img045arrows.png
+ img046arrows.png
+ img047arrows.png
+ img048arrows.png
+ img049arrows.png
+ img050arrows.png
+ img051arrows.png
+ img052arrows.png
+ img053arrows.png
+ img054arrows.png
+ img055arrows.png
+ img056arrows.png
+ img057arrows.png
+ img058arrows.png
+ img059arrows.png
+ img060arrows.png
+ img061arrows.png
+ img062arrows.png
+ img063arrows.png
+ img064arrows.png
+ img065arrows.png
+ img066arrows.png
+ img067arrows.png
+ img068arrows.png
+ img069arrows.png
+)
+
+########### install files ###############
+
+INSTALL( FILES ${symbols} DESTINATION share/apps/kile/mathsymbols/arrows )
+
diff --git a/src/kile/symbols/arrows/Makefile.am b/src/kile/symbols/arrows/Makefile.am
new file mode 100644
index 0000000..c3ba1d3
--- /dev/null
+++ b/src/kile/symbols/arrows/Makefile.am
@@ -0,0 +1,71 @@
+picsdir = $(kde_datadir)/kile/mathsymbols/arrows
+
+pics_DATA = img001arrows.png \
+ img002arrows.png \
+ img003arrows.png \
+ img004arrows.png \
+ img005arrows.png \
+ img006arrows.png \
+ img007arrows.png \
+ img008arrows.png \
+ img009arrows.png \
+ img010arrows.png \
+ img011arrows.png \
+ img012arrows.png \
+ img013arrows.png \
+ img014arrows.png \
+ img015arrows.png \
+ img016arrows.png \
+ img017arrows.png \
+ img018arrows.png \
+ img019arrows.png \
+ img020arrows.png \
+ img021arrows.png \
+ img022arrows.png \
+ img023arrows.png \
+ img024arrows.png \
+ img025arrows.png \
+ img026arrows.png \
+ img027arrows.png \
+ img028arrows.png \
+ img029arrows.png \
+ img030arrows.png \
+ img031arrows.png \
+ img032arrows.png \
+ img033arrows.png \
+ img034arrows.png \
+ img035arrows.png \
+ img036arrows.png \
+ img037arrows.png \
+ img038arrows.png \
+ img039arrows.png \
+ img040arrows.png \
+ img041arrows.png \
+ img042arrows.png \
+ img043arrows.png \
+ img044arrows.png \
+ img045arrows.png \
+ img046arrows.png \
+ img047arrows.png \
+ img048arrows.png \
+ img049arrows.png \
+ img050arrows.png \
+ img051arrows.png \
+ img052arrows.png \
+ img053arrows.png \
+ img054arrows.png \
+ img055arrows.png \
+ img056arrows.png \
+ img057arrows.png \
+ img058arrows.png \
+ img059arrows.png \
+ img060arrows.png \
+ img061arrows.png \
+ img062arrows.png \
+ img063arrows.png \
+ img064arrows.png \
+ img065arrows.png \
+ img066arrows.png \
+ img067arrows.png \
+ img068arrows.png \
+ img069arrows.png
diff --git a/src/kile/symbols/arrows/img001arrows.png b/src/kile/symbols/arrows/img001arrows.png
new file mode 100644
index 0000000..3cbeb27
--- /dev/null
+++ b/src/kile/symbols/arrows/img001arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img002arrows.png b/src/kile/symbols/arrows/img002arrows.png
new file mode 100644
index 0000000..2758315
--- /dev/null
+++ b/src/kile/symbols/arrows/img002arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img003arrows.png b/src/kile/symbols/arrows/img003arrows.png
new file mode 100644
index 0000000..95b468d
--- /dev/null
+++ b/src/kile/symbols/arrows/img003arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img004arrows.png b/src/kile/symbols/arrows/img004arrows.png
new file mode 100644
index 0000000..3ce4925
--- /dev/null
+++ b/src/kile/symbols/arrows/img004arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img005arrows.png b/src/kile/symbols/arrows/img005arrows.png
new file mode 100644
index 0000000..da1ab3b
--- /dev/null
+++ b/src/kile/symbols/arrows/img005arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img006arrows.png b/src/kile/symbols/arrows/img006arrows.png
new file mode 100644
index 0000000..a1f20c4
--- /dev/null
+++ b/src/kile/symbols/arrows/img006arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img007arrows.png b/src/kile/symbols/arrows/img007arrows.png
new file mode 100644
index 0000000..4fc901c
--- /dev/null
+++ b/src/kile/symbols/arrows/img007arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img008arrows.png b/src/kile/symbols/arrows/img008arrows.png
new file mode 100644
index 0000000..d7adce5
--- /dev/null
+++ b/src/kile/symbols/arrows/img008arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img009arrows.png b/src/kile/symbols/arrows/img009arrows.png
new file mode 100644
index 0000000..7e8918d
--- /dev/null
+++ b/src/kile/symbols/arrows/img009arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img010arrows.png b/src/kile/symbols/arrows/img010arrows.png
new file mode 100644
index 0000000..a7d6cf1
--- /dev/null
+++ b/src/kile/symbols/arrows/img010arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img011arrows.png b/src/kile/symbols/arrows/img011arrows.png
new file mode 100644
index 0000000..48db054
--- /dev/null
+++ b/src/kile/symbols/arrows/img011arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img012arrows.png b/src/kile/symbols/arrows/img012arrows.png
new file mode 100644
index 0000000..8a5ce9f
--- /dev/null
+++ b/src/kile/symbols/arrows/img012arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img013arrows.png b/src/kile/symbols/arrows/img013arrows.png
new file mode 100644
index 0000000..77aa441
--- /dev/null
+++ b/src/kile/symbols/arrows/img013arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img014arrows.png b/src/kile/symbols/arrows/img014arrows.png
new file mode 100644
index 0000000..8ffca06
--- /dev/null
+++ b/src/kile/symbols/arrows/img014arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img015arrows.png b/src/kile/symbols/arrows/img015arrows.png
new file mode 100644
index 0000000..92e3a84
--- /dev/null
+++ b/src/kile/symbols/arrows/img015arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img016arrows.png b/src/kile/symbols/arrows/img016arrows.png
new file mode 100644
index 0000000..5070402
--- /dev/null
+++ b/src/kile/symbols/arrows/img016arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img017arrows.png b/src/kile/symbols/arrows/img017arrows.png
new file mode 100644
index 0000000..c4ecad3
--- /dev/null
+++ b/src/kile/symbols/arrows/img017arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img018arrows.png b/src/kile/symbols/arrows/img018arrows.png
new file mode 100644
index 0000000..e708ba4
--- /dev/null
+++ b/src/kile/symbols/arrows/img018arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img019arrows.png b/src/kile/symbols/arrows/img019arrows.png
new file mode 100644
index 0000000..320cbec
--- /dev/null
+++ b/src/kile/symbols/arrows/img019arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img020arrows.png b/src/kile/symbols/arrows/img020arrows.png
new file mode 100644
index 0000000..1723d37
--- /dev/null
+++ b/src/kile/symbols/arrows/img020arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img021arrows.png b/src/kile/symbols/arrows/img021arrows.png
new file mode 100644
index 0000000..b39df72
--- /dev/null
+++ b/src/kile/symbols/arrows/img021arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img022arrows.png b/src/kile/symbols/arrows/img022arrows.png
new file mode 100644
index 0000000..5dad494
--- /dev/null
+++ b/src/kile/symbols/arrows/img022arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img023arrows.png b/src/kile/symbols/arrows/img023arrows.png
new file mode 100644
index 0000000..2d5a5cb
--- /dev/null
+++ b/src/kile/symbols/arrows/img023arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img024arrows.png b/src/kile/symbols/arrows/img024arrows.png
new file mode 100644
index 0000000..51bbffa
--- /dev/null
+++ b/src/kile/symbols/arrows/img024arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img025arrows.png b/src/kile/symbols/arrows/img025arrows.png
new file mode 100644
index 0000000..0b04d2a
--- /dev/null
+++ b/src/kile/symbols/arrows/img025arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img026arrows.png b/src/kile/symbols/arrows/img026arrows.png
new file mode 100644
index 0000000..f9eb6a1
--- /dev/null
+++ b/src/kile/symbols/arrows/img026arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img027arrows.png b/src/kile/symbols/arrows/img027arrows.png
new file mode 100644
index 0000000..450ae12
--- /dev/null
+++ b/src/kile/symbols/arrows/img027arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img028arrows.png b/src/kile/symbols/arrows/img028arrows.png
new file mode 100644
index 0000000..8a293f6
--- /dev/null
+++ b/src/kile/symbols/arrows/img028arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img029arrows.png b/src/kile/symbols/arrows/img029arrows.png
new file mode 100644
index 0000000..771580a
--- /dev/null
+++ b/src/kile/symbols/arrows/img029arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img030arrows.png b/src/kile/symbols/arrows/img030arrows.png
new file mode 100644
index 0000000..0a31548
--- /dev/null
+++ b/src/kile/symbols/arrows/img030arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img031arrows.png b/src/kile/symbols/arrows/img031arrows.png
new file mode 100644
index 0000000..97111e0
--- /dev/null
+++ b/src/kile/symbols/arrows/img031arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img032arrows.png b/src/kile/symbols/arrows/img032arrows.png
new file mode 100644
index 0000000..803cda0
--- /dev/null
+++ b/src/kile/symbols/arrows/img032arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img033arrows.png b/src/kile/symbols/arrows/img033arrows.png
new file mode 100644
index 0000000..3722236
--- /dev/null
+++ b/src/kile/symbols/arrows/img033arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img034arrows.png b/src/kile/symbols/arrows/img034arrows.png
new file mode 100644
index 0000000..450a8c3
--- /dev/null
+++ b/src/kile/symbols/arrows/img034arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img035arrows.png b/src/kile/symbols/arrows/img035arrows.png
new file mode 100644
index 0000000..7bb12ec
--- /dev/null
+++ b/src/kile/symbols/arrows/img035arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img036arrows.png b/src/kile/symbols/arrows/img036arrows.png
new file mode 100644
index 0000000..1ce124a
--- /dev/null
+++ b/src/kile/symbols/arrows/img036arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img037arrows.png b/src/kile/symbols/arrows/img037arrows.png
new file mode 100644
index 0000000..3c0b73d
--- /dev/null
+++ b/src/kile/symbols/arrows/img037arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img038arrows.png b/src/kile/symbols/arrows/img038arrows.png
new file mode 100644
index 0000000..46b63b5
--- /dev/null
+++ b/src/kile/symbols/arrows/img038arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img039arrows.png b/src/kile/symbols/arrows/img039arrows.png
new file mode 100644
index 0000000..e13e88a
--- /dev/null
+++ b/src/kile/symbols/arrows/img039arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img040arrows.png b/src/kile/symbols/arrows/img040arrows.png
new file mode 100644
index 0000000..8587171
--- /dev/null
+++ b/src/kile/symbols/arrows/img040arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img041arrows.png b/src/kile/symbols/arrows/img041arrows.png
new file mode 100644
index 0000000..5ae15e5
--- /dev/null
+++ b/src/kile/symbols/arrows/img041arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img042arrows.png b/src/kile/symbols/arrows/img042arrows.png
new file mode 100644
index 0000000..bb03b06
--- /dev/null
+++ b/src/kile/symbols/arrows/img042arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img043arrows.png b/src/kile/symbols/arrows/img043arrows.png
new file mode 100644
index 0000000..1bcb543
--- /dev/null
+++ b/src/kile/symbols/arrows/img043arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img044arrows.png b/src/kile/symbols/arrows/img044arrows.png
new file mode 100644
index 0000000..4cb5888
--- /dev/null
+++ b/src/kile/symbols/arrows/img044arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img045arrows.png b/src/kile/symbols/arrows/img045arrows.png
new file mode 100644
index 0000000..7eab2e9
--- /dev/null
+++ b/src/kile/symbols/arrows/img045arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img046arrows.png b/src/kile/symbols/arrows/img046arrows.png
new file mode 100644
index 0000000..04adff3
--- /dev/null
+++ b/src/kile/symbols/arrows/img046arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img047arrows.png b/src/kile/symbols/arrows/img047arrows.png
new file mode 100644
index 0000000..03ae71c
--- /dev/null
+++ b/src/kile/symbols/arrows/img047arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img048arrows.png b/src/kile/symbols/arrows/img048arrows.png
new file mode 100644
index 0000000..e59c9a6
--- /dev/null
+++ b/src/kile/symbols/arrows/img048arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img049arrows.png b/src/kile/symbols/arrows/img049arrows.png
new file mode 100644
index 0000000..ab04d97
--- /dev/null
+++ b/src/kile/symbols/arrows/img049arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img050arrows.png b/src/kile/symbols/arrows/img050arrows.png
new file mode 100644
index 0000000..b247087
--- /dev/null
+++ b/src/kile/symbols/arrows/img050arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img051arrows.png b/src/kile/symbols/arrows/img051arrows.png
new file mode 100644
index 0000000..adef66f
--- /dev/null
+++ b/src/kile/symbols/arrows/img051arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img052arrows.png b/src/kile/symbols/arrows/img052arrows.png
new file mode 100644
index 0000000..14d4665
--- /dev/null
+++ b/src/kile/symbols/arrows/img052arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img053arrows.png b/src/kile/symbols/arrows/img053arrows.png
new file mode 100644
index 0000000..23580e6
--- /dev/null
+++ b/src/kile/symbols/arrows/img053arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img054arrows.png b/src/kile/symbols/arrows/img054arrows.png
new file mode 100644
index 0000000..6590339
--- /dev/null
+++ b/src/kile/symbols/arrows/img054arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img055arrows.png b/src/kile/symbols/arrows/img055arrows.png
new file mode 100644
index 0000000..052813b
--- /dev/null
+++ b/src/kile/symbols/arrows/img055arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img056arrows.png b/src/kile/symbols/arrows/img056arrows.png
new file mode 100644
index 0000000..8178a7f
--- /dev/null
+++ b/src/kile/symbols/arrows/img056arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img057arrows.png b/src/kile/symbols/arrows/img057arrows.png
new file mode 100644
index 0000000..241d0a7
--- /dev/null
+++ b/src/kile/symbols/arrows/img057arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img058arrows.png b/src/kile/symbols/arrows/img058arrows.png
new file mode 100644
index 0000000..a33e335
--- /dev/null
+++ b/src/kile/symbols/arrows/img058arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img059arrows.png b/src/kile/symbols/arrows/img059arrows.png
new file mode 100644
index 0000000..bb417b1
--- /dev/null
+++ b/src/kile/symbols/arrows/img059arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img060arrows.png b/src/kile/symbols/arrows/img060arrows.png
new file mode 100644
index 0000000..d916049
--- /dev/null
+++ b/src/kile/symbols/arrows/img060arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img061arrows.png b/src/kile/symbols/arrows/img061arrows.png
new file mode 100644
index 0000000..2e0686e
--- /dev/null
+++ b/src/kile/symbols/arrows/img061arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img062arrows.png b/src/kile/symbols/arrows/img062arrows.png
new file mode 100644
index 0000000..6ec92eb
--- /dev/null
+++ b/src/kile/symbols/arrows/img062arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img063arrows.png b/src/kile/symbols/arrows/img063arrows.png
new file mode 100644
index 0000000..47f5512
--- /dev/null
+++ b/src/kile/symbols/arrows/img063arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img064arrows.png b/src/kile/symbols/arrows/img064arrows.png
new file mode 100644
index 0000000..975f325
--- /dev/null
+++ b/src/kile/symbols/arrows/img064arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img065arrows.png b/src/kile/symbols/arrows/img065arrows.png
new file mode 100644
index 0000000..f25821b
--- /dev/null
+++ b/src/kile/symbols/arrows/img065arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img066arrows.png b/src/kile/symbols/arrows/img066arrows.png
new file mode 100644
index 0000000..b23748c
--- /dev/null
+++ b/src/kile/symbols/arrows/img066arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img067arrows.png b/src/kile/symbols/arrows/img067arrows.png
new file mode 100644
index 0000000..8c9839d
--- /dev/null
+++ b/src/kile/symbols/arrows/img067arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img068arrows.png b/src/kile/symbols/arrows/img068arrows.png
new file mode 100644
index 0000000..cb5c508
--- /dev/null
+++ b/src/kile/symbols/arrows/img068arrows.png
Binary files differ
diff --git a/src/kile/symbols/arrows/img069arrows.png b/src/kile/symbols/arrows/img069arrows.png
new file mode 100644
index 0000000..dd13b3c
--- /dev/null
+++ b/src/kile/symbols/arrows/img069arrows.png
Binary files differ
diff --git a/src/kile/symbols/compile-all.sh b/src/kile/symbols/compile-all.sh
new file mode 100755
index 0000000..4782511
--- /dev/null
+++ b/src/kile/symbols/compile-all.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+# internal script for generating all symbols on one shot
+# License: GPLv2 or later
+# Author: Thomas Braun
+#
+names="relation arrows delimiters greek misc-math misc-text operators special cyrillic"
+
+for i in $names
+do
+ rm -f ./$i/*.png
+ ./gesymb $i $i.tex && mv -f img*$i*png $i # && make install
+done
diff --git a/src/kile/symbols/cyrillic.tex b/src/kile/symbols/cyrillic.tex
new file mode 100644
index 0000000..0d3493e
--- /dev/null
+++ b/src/kile/symbols/cyrillic.tex
@@ -0,0 +1,320 @@
+\documentclass[a4paper,12pt]{scrartcl}
+\usepackage{mathtext}
+\usepackage[T2A,T2B,T2C,T1]{fontenc}
+\usepackage[ukrainian,russian,ngerman]{babel}
+\usepackage[koi8-r]{inputenc}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Author: Thomas Braun
+% begin: Mon June 19 2005
+% last edit:
+% License: GPLv2 or later
+%
+% (probably all) cyrillic letters
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\include{definitions}
+
+\iffalse
+\newcommand{\selectlanguage}[1]{}
+\newcommand{\command}[1]
+\fi
+\newcommand{\ukrainian}[1]{%
+{\selectlanguage{ukrainian}\fontencoding{T2A}\selectfont#1}}
+\newcommand{\ttwob}[1]{%
+{\fontencoding{T2B}\selectfont#1}}
+
+\begin{document}
+\selectlanguage{russian}
+% begin russian alphabet
+\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
+\command{\CYRA}
+\command{\CYRB}
+\command{\CYRV}
+\command{\CYRG}
+\command{\CYRD}
+\command{\CYRE}
+\command{\CYRYO}
+\command{\CYRZH}
+\command{\CYRZ}
+\command{\CYRI}
+\command{\CYRISHRT}
+\command{\CYRK}
+\command{\CYRL}
+\command{\CYRM}
+\command{\CYRN}
+\command{\CYRO}
+\command{\CYRP}
+\command{\CYRR}
+\command{\CYRS}
+\command{\CYRT}
+\command{\CYRU}
+\command{\CYRF}
+\command{\CYRH}
+\command{\CYRC}
+\command{\CYRCH}
+\command{\CYRSH}
+\command{\CYRSHCH}
+\command{\CYRHRDSN}
+\command{\CYRERY}
+\command{\CYRSFTSN}
+\command{\CYREREV}
+\command{\CYRYU}
+\command{\CYRYA}
+\par
+\command{\cyra}
+\command{\cyrb}
+\command{\cyrv}
+\command{\cyrg}
+\command{\cyrd}
+\command{\cyre}
+\command{\cyryo}
+\command{\cyrzh}
+\command{\cyrz}
+\command{\cyri}
+\command{\cyrishrt}
+\command{\cyrk}
+\command{\cyrl}
+\command{\cyrm}
+\command{\cyrn}
+\command{\cyro}
+\command{\cyrp}
+\command{\cyrr}
+\command{\cyrs}
+\command{\cyrt}
+\command{\cyru}
+\command{\cyrf}
+\command{\cyrh}
+\command{\cyrc}
+\command{\cyrch}
+\command{\cyrsh}
+\command{\cyrshch}
+\command{\cyrhrdsn}
+\command{\cyrery}
+\command{\cyrsftsn}
+\command{\cyrerev}
+\command{\cyryu}
+\command{\cyrya}
+\par % end of russian alphabet
+\command{\CYRABHCH}
+\command{\CYRABHCHDSC}
+\end{neededpkgs}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\CYRZHDSC}
+}
+\end{neededpkgs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRABHDZE}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\CYRZDSC}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
+\ttwob{
+\command{\CYRKHK}
+}
+\end{neededpkgs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRKHCRS}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRKDSC}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\CYRKVCRS}
+\command{\CYRLJE}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
+\ttwob{
+\command{\CYRLDSC}
+}
+\end{neededpkgs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRMDSC}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRNDSC}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\CYRNG}
+\command{\CYRNJE}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
+\ttwob{
+\command{\CYRNHK}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
+\command{\CYROTLD}
+\command{\CYRPHK}
+\command{\CYRRTICK}
+\end{neededpkgs}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\CYRSDSC}
+}
+\end{neededpkgs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRTDSC}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\CYRTSHE}
+\command{\CYRDJE}
+\command{\CYRUSHRT}
+}
+\end{neededpkgs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRSHHA}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRGHK}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\CYRGUP}
+\command{\CYRGHCRS}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
+\command{\CYRHDSC}
+\command{\CYRDZHE}
+\command{\CYRDZE}
+\command{\CYRTETSE}
+\end{neededpkgs}
+\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
+\ttwob{
+\command{\CYRCHLDSC}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\CYRCHVCRS}
+}
+\end{neededpkgs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRCHRDSC}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRSEMISFTSN}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\CYRIE}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
+\command{\CYRSCHWA}
+\command{\CYRII}
+\command{\CYRJE}
+\end{neededpkgs}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\CYRYI}
+\command{\CYRY}
+\command{\CYRYHCRS}
+\command{\CYRAE}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
+\command{\CYRABHHA}
+\command{\CYRpalochka}
+\command{\cyrabhch}
+\command{\cyrabhchdsc}
+\end{neededpkgs}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\cyrzhdsc}
+}
+\end{neededpkgs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrabhdze}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\cyrzdsc}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
+\ttwob{
+\command{\cyrkhk}
+}
+\end{neededpkgs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrkhcrs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrkdsc}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\cyrkvcrs}
+\command{\cyrlje}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
+\ttwob{
+\command{\cyrldsc}
+}
+\end{neededpkgs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrmdsc}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrndsc}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\cyrng}
+\command{\cyrnje}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
+\ttwob{
+\command{\cyrnhk}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
+\command{\cyrotld}
+\command{\cyrphk}
+\command{\cyrrtick}
+\end{neededpkgs}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\cyrsdsc}
+}
+\end{neededpkgs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrtdsc}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\cyrtshe}
+\command{\cyrdje}
+\command{\cyrushrt}
+}
+\end{neededpkgs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrshha}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrghk}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\cyrgup}
+\command{\cyrghcrs}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
+\command{\cyrhdsc}
+\command{\cyrdzhe}
+\command{\cyrdze}
+\command{\cyrtetse}
+\end{neededpkgs}
+\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
+\ttwob{
+\command{\cyrchldsc}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\cyrchvcrs}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
+\command{\cyrchrdsc}
+\command{\cyrsemisftsn}
+\end{neededpkgs}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\cyrie}
+}
+\end{neededpkgs}
+\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
+\command{\cyrschwa}
+\command{\cyrii}
+\command{\cyrje}
+\end{neededpkgs}
+\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
+\ukrainian{
+\command{\cyryi}
+\command{\cyry}
+\command{\cyryhcrs}
+\command{\cyrae}
+}
+\end{neededpkgs}
+\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrabhha}
+
+\end{document}
diff --git a/src/kile/symbols/cyrillic/CMakeLists.txt b/src/kile/symbols/cyrillic/CMakeLists.txt
new file mode 100644
index 0000000..55a001e
--- /dev/null
+++ b/src/kile/symbols/cyrillic/CMakeLists.txt
@@ -0,0 +1,164 @@
+
+########### install files ###############
+
+SET( symbols
+ img001cyrillic.png
+ img002cyrillic.png
+ img003cyrillic.png
+ img004cyrillic.png
+ img005cyrillic.png
+ img006cyrillic.png
+ img007cyrillic.png
+ img008cyrillic.png
+ img009cyrillic.png
+ img010cyrillic.png
+ img011cyrillic.png
+ img012cyrillic.png
+ img013cyrillic.png
+ img014cyrillic.png
+ img015cyrillic.png
+ img016cyrillic.png
+ img017cyrillic.png
+ img018cyrillic.png
+ img019cyrillic.png
+ img020cyrillic.png
+ img021cyrillic.png
+ img022cyrillic.png
+ img023cyrillic.png
+ img024cyrillic.png
+ img025cyrillic.png
+ img026cyrillic.png
+ img027cyrillic.png
+ img028cyrillic.png
+ img029cyrillic.png
+ img030cyrillic.png
+ img031cyrillic.png
+ img032cyrillic.png
+ img033cyrillic.png
+ img034cyrillic.png
+ img035cyrillic.png
+ img036cyrillic.png
+ img037cyrillic.png
+ img038cyrillic.png
+ img039cyrillic.png
+ img040cyrillic.png
+ img041cyrillic.png
+ img042cyrillic.png
+ img043cyrillic.png
+ img044cyrillic.png
+ img045cyrillic.png
+ img046cyrillic.png
+ img047cyrillic.png
+ img048cyrillic.png
+ img049cyrillic.png
+ img050cyrillic.png
+ img051cyrillic.png
+ img052cyrillic.png
+ img053cyrillic.png
+ img054cyrillic.png
+ img055cyrillic.png
+ img056cyrillic.png
+ img057cyrillic.png
+ img058cyrillic.png
+ img059cyrillic.png
+ img060cyrillic.png
+ img061cyrillic.png
+ img062cyrillic.png
+ img063cyrillic.png
+ img064cyrillic.png
+ img065cyrillic.png
+ img066cyrillic.png
+ img067cyrillic.png
+ img068cyrillic.png
+ img069cyrillic.png
+ img070cyrillic.png
+ img071cyrillic.png
+ img072cyrillic.png
+ img073cyrillic.png
+ img074cyrillic.png
+ img075cyrillic.png
+ img076cyrillic.png
+ img077cyrillic.png
+ img078cyrillic.png
+ img079cyrillic.png
+ img080cyrillic.png
+ img081cyrillic.png
+ img082cyrillic.png
+ img083cyrillic.png
+ img084cyrillic.png
+ img085cyrillic.png
+ img086cyrillic.png
+ img087cyrillic.png
+ img088cyrillic.png
+ img089cyrillic.png
+ img090cyrillic.png
+ img091cyrillic.png
+ img092cyrillic.png
+ img093cyrillic.png
+ img094cyrillic.png
+ img095cyrillic.png
+ img096cyrillic.png
+ img097cyrillic.png
+ img098cyrillic.png
+ img099cyrillic.png
+ img100cyrillic.png
+ img101cyrillic.png
+ img102cyrillic.png
+ img103cyrillic.png
+ img104cyrillic.png
+ img105cyrillic.png
+ img106cyrillic.png
+ img107cyrillic.png
+ img108cyrillic.png
+ img109cyrillic.png
+ img110cyrillic.png
+ img111cyrillic.png
+ img112cyrillic.png
+ img113cyrillic.png
+ img114cyrillic.png
+ img115cyrillic.png
+ img116cyrillic.png
+ img117cyrillic.png
+ img118cyrillic.png
+ img119cyrillic.png
+ img120cyrillic.png
+ img121cyrillic.png
+ img122cyrillic.png
+ img123cyrillic.png
+ img124cyrillic.png
+ img125cyrillic.png
+ img126cyrillic.png
+ img127cyrillic.png
+ img128cyrillic.png
+ img129cyrillic.png
+ img130cyrillic.png
+ img131cyrillic.png
+ img132cyrillic.png
+ img133cyrillic.png
+ img134cyrillic.png
+ img135cyrillic.png
+ img136cyrillic.png
+ img137cyrillic.png
+ img138cyrillic.png
+ img139cyrillic.png
+ img140cyrillic.png
+ img141cyrillic.png
+ img142cyrillic.png
+ img143cyrillic.png
+ img144cyrillic.png
+ img145cyrillic.png
+ img146cyrillic.png
+ img147cyrillic.png
+ img148cyrillic.png
+ img149cyrillic.png
+ img150cyrillic.png
+ img151cyrillic.png
+ img152cyrillic.png
+ img153cyrillic.png
+ img154cyrillic.png
+ img155cyrillic.png
+ img156cyrillic.png
+ img157cyrillic.png
+)
+
+INSTALL( FILES ${symbols} DESTINATION share/apps/kile/mathsymbols/cyrillic ) \ No newline at end of file
diff --git a/src/kile/symbols/cyrillic/Makefile.am b/src/kile/symbols/cyrillic/Makefile.am
new file mode 100644
index 0000000..1dc8893
--- /dev/null
+++ b/src/kile/symbols/cyrillic/Makefile.am
@@ -0,0 +1,159 @@
+picsdir = $(kde_datadir)/kile/mathsymbols/cyrillic
+
+pics_DATA = img001cyrillic.png \
+ img002cyrillic.png \
+ img003cyrillic.png \
+ img004cyrillic.png \
+ img005cyrillic.png \
+ img006cyrillic.png \
+ img007cyrillic.png \
+ img008cyrillic.png \
+ img009cyrillic.png \
+ img010cyrillic.png \
+ img011cyrillic.png \
+ img012cyrillic.png \
+ img013cyrillic.png \
+ img014cyrillic.png \
+ img015cyrillic.png \
+ img016cyrillic.png \
+ img017cyrillic.png \
+ img018cyrillic.png \
+ img019cyrillic.png \
+ img020cyrillic.png \
+ img021cyrillic.png \
+ img022cyrillic.png \
+ img023cyrillic.png \
+ img024cyrillic.png \
+ img025cyrillic.png \
+ img026cyrillic.png \
+ img027cyrillic.png \
+ img028cyrillic.png \
+ img029cyrillic.png \
+ img030cyrillic.png \
+ img031cyrillic.png \
+ img032cyrillic.png \
+ img033cyrillic.png \
+ img034cyrillic.png \
+ img035cyrillic.png \
+ img036cyrillic.png \
+ img037cyrillic.png \
+ img038cyrillic.png \
+ img039cyrillic.png \
+ img040cyrillic.png \
+ img041cyrillic.png \
+ img042cyrillic.png \
+ img043cyrillic.png \
+ img044cyrillic.png \
+ img045cyrillic.png \
+ img046cyrillic.png \
+ img047cyrillic.png \
+ img048cyrillic.png \
+ img049cyrillic.png \
+ img050cyrillic.png \
+ img051cyrillic.png \
+ img052cyrillic.png \
+ img053cyrillic.png \
+ img054cyrillic.png \
+ img055cyrillic.png \
+ img056cyrillic.png \
+ img057cyrillic.png \
+ img058cyrillic.png \
+ img059cyrillic.png \
+ img060cyrillic.png \
+ img061cyrillic.png \
+ img062cyrillic.png \
+ img063cyrillic.png \
+ img064cyrillic.png \
+ img065cyrillic.png \
+ img066cyrillic.png \
+ img067cyrillic.png \
+ img068cyrillic.png \
+ img069cyrillic.png \
+ img070cyrillic.png \
+ img071cyrillic.png \
+ img072cyrillic.png \
+ img073cyrillic.png \
+ img074cyrillic.png \
+ img075cyrillic.png \
+ img076cyrillic.png \
+ img077cyrillic.png \
+ img078cyrillic.png \
+ img079cyrillic.png \
+ img080cyrillic.png \
+ img081cyrillic.png \
+ img082cyrillic.png \
+ img083cyrillic.png \
+ img084cyrillic.png \
+ img085cyrillic.png \
+ img086cyrillic.png \
+ img087cyrillic.png \
+ img088cyrillic.png \
+ img089cyrillic.png \
+ img090cyrillic.png \
+ img091cyrillic.png \
+ img092cyrillic.png \
+ img093cyrillic.png \
+ img094cyrillic.png \
+ img095cyrillic.png \
+ img096cyrillic.png \
+ img097cyrillic.png \
+ img098cyrillic.png \
+ img099cyrillic.png \
+ img100cyrillic.png \
+ img101cyrillic.png \
+ img102cyrillic.png \
+ img103cyrillic.png \
+ img104cyrillic.png \
+ img105cyrillic.png \
+ img106cyrillic.png \
+ img107cyrillic.png \
+ img108cyrillic.png \
+ img109cyrillic.png \
+ img110cyrillic.png \
+ img111cyrillic.png \
+ img112cyrillic.png \
+ img113cyrillic.png \
+ img114cyrillic.png \
+ img115cyrillic.png \
+ img116cyrillic.png \
+ img117cyrillic.png \
+ img118cyrillic.png \
+ img119cyrillic.png \
+ img120cyrillic.png \
+ img121cyrillic.png \
+ img122cyrillic.png \
+ img123cyrillic.png \
+ img124cyrillic.png \
+ img125cyrillic.png \
+ img126cyrillic.png \
+ img127cyrillic.png \
+ img128cyrillic.png \
+ img129cyrillic.png \
+ img130cyrillic.png \
+ img131cyrillic.png \
+ img132cyrillic.png \
+ img133cyrillic.png \
+ img134cyrillic.png \
+ img135cyrillic.png \
+ img136cyrillic.png \
+ img137cyrillic.png \
+ img138cyrillic.png \
+ img139cyrillic.png \
+ img140cyrillic.png \
+ img141cyrillic.png \
+ img142cyrillic.png \
+ img143cyrillic.png \
+ img144cyrillic.png \
+ img145cyrillic.png \
+ img146cyrillic.png \
+ img147cyrillic.png \
+ img148cyrillic.png \
+ img149cyrillic.png \
+ img150cyrillic.png \
+ img151cyrillic.png \
+ img152cyrillic.png \
+ img153cyrillic.png \
+ img154cyrillic.png \
+ img155cyrillic.png \
+ img156cyrillic.png \
+ img157cyrillic.png
diff --git a/src/kile/symbols/cyrillic/img001cyrillic.png b/src/kile/symbols/cyrillic/img001cyrillic.png
new file mode 100644
index 0000000..a1061e4
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img001cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img002cyrillic.png b/src/kile/symbols/cyrillic/img002cyrillic.png
new file mode 100644
index 0000000..8d61414
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img002cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img003cyrillic.png b/src/kile/symbols/cyrillic/img003cyrillic.png
new file mode 100644
index 0000000..48b1c23
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img003cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img004cyrillic.png b/src/kile/symbols/cyrillic/img004cyrillic.png
new file mode 100644
index 0000000..51934f3
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img004cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img005cyrillic.png b/src/kile/symbols/cyrillic/img005cyrillic.png
new file mode 100644
index 0000000..99845af
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img005cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img006cyrillic.png b/src/kile/symbols/cyrillic/img006cyrillic.png
new file mode 100644
index 0000000..0cc6333
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img006cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img007cyrillic.png b/src/kile/symbols/cyrillic/img007cyrillic.png
new file mode 100644
index 0000000..9b9b905
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img007cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img008cyrillic.png b/src/kile/symbols/cyrillic/img008cyrillic.png
new file mode 100644
index 0000000..c9325dc
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img008cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img009cyrillic.png b/src/kile/symbols/cyrillic/img009cyrillic.png
new file mode 100644
index 0000000..6822030
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img009cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img010cyrillic.png b/src/kile/symbols/cyrillic/img010cyrillic.png
new file mode 100644
index 0000000..708d2d5
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img010cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img011cyrillic.png b/src/kile/symbols/cyrillic/img011cyrillic.png
new file mode 100644
index 0000000..3a2d0fb
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img011cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img012cyrillic.png b/src/kile/symbols/cyrillic/img012cyrillic.png
new file mode 100644
index 0000000..b09745b
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img012cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img013cyrillic.png b/src/kile/symbols/cyrillic/img013cyrillic.png
new file mode 100644
index 0000000..2cf0024
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img013cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img014cyrillic.png b/src/kile/symbols/cyrillic/img014cyrillic.png
new file mode 100644
index 0000000..809118a
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img014cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img015cyrillic.png b/src/kile/symbols/cyrillic/img015cyrillic.png
new file mode 100644
index 0000000..b7f7fa8
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img015cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img016cyrillic.png b/src/kile/symbols/cyrillic/img016cyrillic.png
new file mode 100644
index 0000000..5727445
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img016cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img017cyrillic.png b/src/kile/symbols/cyrillic/img017cyrillic.png
new file mode 100644
index 0000000..d47e01f
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img017cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img018cyrillic.png b/src/kile/symbols/cyrillic/img018cyrillic.png
new file mode 100644
index 0000000..962f985
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img018cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img019cyrillic.png b/src/kile/symbols/cyrillic/img019cyrillic.png
new file mode 100644
index 0000000..e996f21
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img019cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img020cyrillic.png b/src/kile/symbols/cyrillic/img020cyrillic.png
new file mode 100644
index 0000000..cb4c9e6
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img020cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img021cyrillic.png b/src/kile/symbols/cyrillic/img021cyrillic.png
new file mode 100644
index 0000000..6ceeef6
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img021cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img022cyrillic.png b/src/kile/symbols/cyrillic/img022cyrillic.png
new file mode 100644
index 0000000..59271d9
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img022cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img023cyrillic.png b/src/kile/symbols/cyrillic/img023cyrillic.png
new file mode 100644
index 0000000..e03a00a
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img023cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img024cyrillic.png b/src/kile/symbols/cyrillic/img024cyrillic.png
new file mode 100644
index 0000000..5f67b62
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img024cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img025cyrillic.png b/src/kile/symbols/cyrillic/img025cyrillic.png
new file mode 100644
index 0000000..40e62b6
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img025cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img026cyrillic.png b/src/kile/symbols/cyrillic/img026cyrillic.png
new file mode 100644
index 0000000..d4fd6c0
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img026cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img027cyrillic.png b/src/kile/symbols/cyrillic/img027cyrillic.png
new file mode 100644
index 0000000..c05a206
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img027cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img028cyrillic.png b/src/kile/symbols/cyrillic/img028cyrillic.png
new file mode 100644
index 0000000..e3a4027
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img028cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img029cyrillic.png b/src/kile/symbols/cyrillic/img029cyrillic.png
new file mode 100644
index 0000000..4a5c7be
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img029cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img030cyrillic.png b/src/kile/symbols/cyrillic/img030cyrillic.png
new file mode 100644
index 0000000..e225601
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img030cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img031cyrillic.png b/src/kile/symbols/cyrillic/img031cyrillic.png
new file mode 100644
index 0000000..e9a7bac
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img031cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img032cyrillic.png b/src/kile/symbols/cyrillic/img032cyrillic.png
new file mode 100644
index 0000000..374df87
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img032cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img033cyrillic.png b/src/kile/symbols/cyrillic/img033cyrillic.png
new file mode 100644
index 0000000..91d4083
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img033cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img034cyrillic.png b/src/kile/symbols/cyrillic/img034cyrillic.png
new file mode 100644
index 0000000..9b32582
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img034cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img035cyrillic.png b/src/kile/symbols/cyrillic/img035cyrillic.png
new file mode 100644
index 0000000..1442a51
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img035cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img036cyrillic.png b/src/kile/symbols/cyrillic/img036cyrillic.png
new file mode 100644
index 0000000..17b32ea
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img036cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img037cyrillic.png b/src/kile/symbols/cyrillic/img037cyrillic.png
new file mode 100644
index 0000000..6a1c3f1
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img037cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img038cyrillic.png b/src/kile/symbols/cyrillic/img038cyrillic.png
new file mode 100644
index 0000000..d20bcf8
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img038cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img039cyrillic.png b/src/kile/symbols/cyrillic/img039cyrillic.png
new file mode 100644
index 0000000..f3dfa77
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img039cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img040cyrillic.png b/src/kile/symbols/cyrillic/img040cyrillic.png
new file mode 100644
index 0000000..eb02a63
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img040cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img041cyrillic.png b/src/kile/symbols/cyrillic/img041cyrillic.png
new file mode 100644
index 0000000..9f16ce6
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img041cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img042cyrillic.png b/src/kile/symbols/cyrillic/img042cyrillic.png
new file mode 100644
index 0000000..b52cbbb
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img042cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img043cyrillic.png b/src/kile/symbols/cyrillic/img043cyrillic.png
new file mode 100644
index 0000000..e3543b7
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img043cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img044cyrillic.png b/src/kile/symbols/cyrillic/img044cyrillic.png
new file mode 100644
index 0000000..50301e3
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img044cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img045cyrillic.png b/src/kile/symbols/cyrillic/img045cyrillic.png
new file mode 100644
index 0000000..92265ba
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img045cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img046cyrillic.png b/src/kile/symbols/cyrillic/img046cyrillic.png
new file mode 100644
index 0000000..b177673
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img046cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img047cyrillic.png b/src/kile/symbols/cyrillic/img047cyrillic.png
new file mode 100644
index 0000000..574a24c
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img047cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img048cyrillic.png b/src/kile/symbols/cyrillic/img048cyrillic.png
new file mode 100644
index 0000000..2420476
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img048cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img049cyrillic.png b/src/kile/symbols/cyrillic/img049cyrillic.png
new file mode 100644
index 0000000..94b76fb
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img049cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img050cyrillic.png b/src/kile/symbols/cyrillic/img050cyrillic.png
new file mode 100644
index 0000000..8996178
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img050cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img051cyrillic.png b/src/kile/symbols/cyrillic/img051cyrillic.png
new file mode 100644
index 0000000..9fb32bd
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img051cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img052cyrillic.png b/src/kile/symbols/cyrillic/img052cyrillic.png
new file mode 100644
index 0000000..f48d0fe
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img052cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img053cyrillic.png b/src/kile/symbols/cyrillic/img053cyrillic.png
new file mode 100644
index 0000000..d0b2ec8
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img053cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img054cyrillic.png b/src/kile/symbols/cyrillic/img054cyrillic.png
new file mode 100644
index 0000000..1025a1c
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img054cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img055cyrillic.png b/src/kile/symbols/cyrillic/img055cyrillic.png
new file mode 100644
index 0000000..1931e28
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img055cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img056cyrillic.png b/src/kile/symbols/cyrillic/img056cyrillic.png
new file mode 100644
index 0000000..ccaeb0f
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img056cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img057cyrillic.png b/src/kile/symbols/cyrillic/img057cyrillic.png
new file mode 100644
index 0000000..3a2c792
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img057cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img058cyrillic.png b/src/kile/symbols/cyrillic/img058cyrillic.png
new file mode 100644
index 0000000..643b852
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img058cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img059cyrillic.png b/src/kile/symbols/cyrillic/img059cyrillic.png
new file mode 100644
index 0000000..98f6ea1
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img059cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img060cyrillic.png b/src/kile/symbols/cyrillic/img060cyrillic.png
new file mode 100644
index 0000000..4802f41
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img060cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img061cyrillic.png b/src/kile/symbols/cyrillic/img061cyrillic.png
new file mode 100644
index 0000000..f46e329
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img061cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img062cyrillic.png b/src/kile/symbols/cyrillic/img062cyrillic.png
new file mode 100644
index 0000000..6ea7d01
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img062cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img063cyrillic.png b/src/kile/symbols/cyrillic/img063cyrillic.png
new file mode 100644
index 0000000..10cd7f8
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img063cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img064cyrillic.png b/src/kile/symbols/cyrillic/img064cyrillic.png
new file mode 100644
index 0000000..9268b19
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img064cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img065cyrillic.png b/src/kile/symbols/cyrillic/img065cyrillic.png
new file mode 100644
index 0000000..be954e7
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img065cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img066cyrillic.png b/src/kile/symbols/cyrillic/img066cyrillic.png
new file mode 100644
index 0000000..cdcf2ef
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img066cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img067cyrillic.png b/src/kile/symbols/cyrillic/img067cyrillic.png
new file mode 100644
index 0000000..9fbe364
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img067cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img068cyrillic.png b/src/kile/symbols/cyrillic/img068cyrillic.png
new file mode 100644
index 0000000..c5f9d8f
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img068cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img069cyrillic.png b/src/kile/symbols/cyrillic/img069cyrillic.png
new file mode 100644
index 0000000..676242e
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img069cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img070cyrillic.png b/src/kile/symbols/cyrillic/img070cyrillic.png
new file mode 100644
index 0000000..2595d6f
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img070cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img071cyrillic.png b/src/kile/symbols/cyrillic/img071cyrillic.png
new file mode 100644
index 0000000..8824312
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img071cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img072cyrillic.png b/src/kile/symbols/cyrillic/img072cyrillic.png
new file mode 100644
index 0000000..107ddf1
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img072cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img073cyrillic.png b/src/kile/symbols/cyrillic/img073cyrillic.png
new file mode 100644
index 0000000..42cecde
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img073cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img074cyrillic.png b/src/kile/symbols/cyrillic/img074cyrillic.png
new file mode 100644
index 0000000..f7dae81
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img074cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img075cyrillic.png b/src/kile/symbols/cyrillic/img075cyrillic.png
new file mode 100644
index 0000000..0d33f51
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img075cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img076cyrillic.png b/src/kile/symbols/cyrillic/img076cyrillic.png
new file mode 100644
index 0000000..9c1a9b7
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img076cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img077cyrillic.png b/src/kile/symbols/cyrillic/img077cyrillic.png
new file mode 100644
index 0000000..d1611c5
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img077cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img078cyrillic.png b/src/kile/symbols/cyrillic/img078cyrillic.png
new file mode 100644
index 0000000..279b0b7
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img078cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img079cyrillic.png b/src/kile/symbols/cyrillic/img079cyrillic.png
new file mode 100644
index 0000000..d9ff501
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img079cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img080cyrillic.png b/src/kile/symbols/cyrillic/img080cyrillic.png
new file mode 100644
index 0000000..ee1310d
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img080cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img081cyrillic.png b/src/kile/symbols/cyrillic/img081cyrillic.png
new file mode 100644
index 0000000..0ce9ac8
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img081cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img082cyrillic.png b/src/kile/symbols/cyrillic/img082cyrillic.png
new file mode 100644
index 0000000..a7bfaaa
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img082cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img083cyrillic.png b/src/kile/symbols/cyrillic/img083cyrillic.png
new file mode 100644
index 0000000..fafa912
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img083cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img084cyrillic.png b/src/kile/symbols/cyrillic/img084cyrillic.png
new file mode 100644
index 0000000..15e4b43
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img084cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img085cyrillic.png b/src/kile/symbols/cyrillic/img085cyrillic.png
new file mode 100644
index 0000000..f6f18fc
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img085cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img086cyrillic.png b/src/kile/symbols/cyrillic/img086cyrillic.png
new file mode 100644
index 0000000..a2b7a18
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img086cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img087cyrillic.png b/src/kile/symbols/cyrillic/img087cyrillic.png
new file mode 100644
index 0000000..78b4c3e
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img087cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img088cyrillic.png b/src/kile/symbols/cyrillic/img088cyrillic.png
new file mode 100644
index 0000000..1133477
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img088cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img089cyrillic.png b/src/kile/symbols/cyrillic/img089cyrillic.png
new file mode 100644
index 0000000..0254eca
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img089cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img090cyrillic.png b/src/kile/symbols/cyrillic/img090cyrillic.png
new file mode 100644
index 0000000..2019e4f
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img090cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img091cyrillic.png b/src/kile/symbols/cyrillic/img091cyrillic.png
new file mode 100644
index 0000000..be03b53
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img091cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img092cyrillic.png b/src/kile/symbols/cyrillic/img092cyrillic.png
new file mode 100644
index 0000000..4d6b512
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img092cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img093cyrillic.png b/src/kile/symbols/cyrillic/img093cyrillic.png
new file mode 100644
index 0000000..dbf0e7a
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img093cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img094cyrillic.png b/src/kile/symbols/cyrillic/img094cyrillic.png
new file mode 100644
index 0000000..7807d0d
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img094cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img095cyrillic.png b/src/kile/symbols/cyrillic/img095cyrillic.png
new file mode 100644
index 0000000..aa8eb7d
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img095cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img096cyrillic.png b/src/kile/symbols/cyrillic/img096cyrillic.png
new file mode 100644
index 0000000..03c2e58
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img096cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img097cyrillic.png b/src/kile/symbols/cyrillic/img097cyrillic.png
new file mode 100644
index 0000000..ec94feb
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img097cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img098cyrillic.png b/src/kile/symbols/cyrillic/img098cyrillic.png
new file mode 100644
index 0000000..f9f34ff
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img098cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img099cyrillic.png b/src/kile/symbols/cyrillic/img099cyrillic.png
new file mode 100644
index 0000000..e2d09bd
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img099cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img100cyrillic.png b/src/kile/symbols/cyrillic/img100cyrillic.png
new file mode 100644
index 0000000..c2464c2
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img100cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img101cyrillic.png b/src/kile/symbols/cyrillic/img101cyrillic.png
new file mode 100644
index 0000000..d748ca5
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img101cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img102cyrillic.png b/src/kile/symbols/cyrillic/img102cyrillic.png
new file mode 100644
index 0000000..0fb2ff3
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img102cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img103cyrillic.png b/src/kile/symbols/cyrillic/img103cyrillic.png
new file mode 100644
index 0000000..145db53
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img103cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img104cyrillic.png b/src/kile/symbols/cyrillic/img104cyrillic.png
new file mode 100644
index 0000000..5c7385c
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img104cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img105cyrillic.png b/src/kile/symbols/cyrillic/img105cyrillic.png
new file mode 100644
index 0000000..b3d7b80
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img105cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img106cyrillic.png b/src/kile/symbols/cyrillic/img106cyrillic.png
new file mode 100644
index 0000000..a9c0ee2
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img106cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img107cyrillic.png b/src/kile/symbols/cyrillic/img107cyrillic.png
new file mode 100644
index 0000000..28087b9
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img107cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img108cyrillic.png b/src/kile/symbols/cyrillic/img108cyrillic.png
new file mode 100644
index 0000000..80a9bdc
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img108cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img109cyrillic.png b/src/kile/symbols/cyrillic/img109cyrillic.png
new file mode 100644
index 0000000..6761643
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img109cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img110cyrillic.png b/src/kile/symbols/cyrillic/img110cyrillic.png
new file mode 100644
index 0000000..6a6ffd7
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img110cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img111cyrillic.png b/src/kile/symbols/cyrillic/img111cyrillic.png
new file mode 100644
index 0000000..dd76e46
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img111cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img112cyrillic.png b/src/kile/symbols/cyrillic/img112cyrillic.png
new file mode 100644
index 0000000..5be3113
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img112cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img113cyrillic.png b/src/kile/symbols/cyrillic/img113cyrillic.png
new file mode 100644
index 0000000..96c15e4
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img113cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img114cyrillic.png b/src/kile/symbols/cyrillic/img114cyrillic.png
new file mode 100644
index 0000000..5573c5b
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img114cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img115cyrillic.png b/src/kile/symbols/cyrillic/img115cyrillic.png
new file mode 100644
index 0000000..f075183
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img115cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img116cyrillic.png b/src/kile/symbols/cyrillic/img116cyrillic.png
new file mode 100644
index 0000000..a195d50
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img116cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img117cyrillic.png b/src/kile/symbols/cyrillic/img117cyrillic.png
new file mode 100644
index 0000000..c119c51
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img117cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img118cyrillic.png b/src/kile/symbols/cyrillic/img118cyrillic.png
new file mode 100644
index 0000000..c9101dc
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img118cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img119cyrillic.png b/src/kile/symbols/cyrillic/img119cyrillic.png
new file mode 100644
index 0000000..7ea58c1
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img119cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img120cyrillic.png b/src/kile/symbols/cyrillic/img120cyrillic.png
new file mode 100644
index 0000000..1fe7e6e
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img120cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img121cyrillic.png b/src/kile/symbols/cyrillic/img121cyrillic.png
new file mode 100644
index 0000000..5eeef9c
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img121cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img122cyrillic.png b/src/kile/symbols/cyrillic/img122cyrillic.png
new file mode 100644
index 0000000..bd9d8e1
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img122cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img123cyrillic.png b/src/kile/symbols/cyrillic/img123cyrillic.png
new file mode 100644
index 0000000..25b317c
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img123cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img124cyrillic.png b/src/kile/symbols/cyrillic/img124cyrillic.png
new file mode 100644
index 0000000..ece5df5
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img124cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img125cyrillic.png b/src/kile/symbols/cyrillic/img125cyrillic.png
new file mode 100644
index 0000000..80d6ba1
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img125cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img126cyrillic.png b/src/kile/symbols/cyrillic/img126cyrillic.png
new file mode 100644
index 0000000..8b571a1
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img126cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img127cyrillic.png b/src/kile/symbols/cyrillic/img127cyrillic.png
new file mode 100644
index 0000000..e9d957e
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img127cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img128cyrillic.png b/src/kile/symbols/cyrillic/img128cyrillic.png
new file mode 100644
index 0000000..6388de5
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img128cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img129cyrillic.png b/src/kile/symbols/cyrillic/img129cyrillic.png
new file mode 100644
index 0000000..92c4471
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img129cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img130cyrillic.png b/src/kile/symbols/cyrillic/img130cyrillic.png
new file mode 100644
index 0000000..022cca5
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img130cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img131cyrillic.png b/src/kile/symbols/cyrillic/img131cyrillic.png
new file mode 100644
index 0000000..8953079
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img131cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img132cyrillic.png b/src/kile/symbols/cyrillic/img132cyrillic.png
new file mode 100644
index 0000000..82f5df8
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img132cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img133cyrillic.png b/src/kile/symbols/cyrillic/img133cyrillic.png
new file mode 100644
index 0000000..06caaea
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img133cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img134cyrillic.png b/src/kile/symbols/cyrillic/img134cyrillic.png
new file mode 100644
index 0000000..fff8989
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img134cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img135cyrillic.png b/src/kile/symbols/cyrillic/img135cyrillic.png
new file mode 100644
index 0000000..17faa4c
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img135cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img136cyrillic.png b/src/kile/symbols/cyrillic/img136cyrillic.png
new file mode 100644
index 0000000..f22abd9
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img136cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img137cyrillic.png b/src/kile/symbols/cyrillic/img137cyrillic.png
new file mode 100644
index 0000000..0703108
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img137cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img138cyrillic.png b/src/kile/symbols/cyrillic/img138cyrillic.png
new file mode 100644
index 0000000..c632353
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img138cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img139cyrillic.png b/src/kile/symbols/cyrillic/img139cyrillic.png
new file mode 100644
index 0000000..4c0e4fe
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img139cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img140cyrillic.png b/src/kile/symbols/cyrillic/img140cyrillic.png
new file mode 100644
index 0000000..37c6267
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img140cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img141cyrillic.png b/src/kile/symbols/cyrillic/img141cyrillic.png
new file mode 100644
index 0000000..865a9f3
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img141cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img142cyrillic.png b/src/kile/symbols/cyrillic/img142cyrillic.png
new file mode 100644
index 0000000..a49865d
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img142cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img143cyrillic.png b/src/kile/symbols/cyrillic/img143cyrillic.png
new file mode 100644
index 0000000..6c6abdd
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img143cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img144cyrillic.png b/src/kile/symbols/cyrillic/img144cyrillic.png
new file mode 100644
index 0000000..b85823f
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img144cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img145cyrillic.png b/src/kile/symbols/cyrillic/img145cyrillic.png
new file mode 100644
index 0000000..7852de9
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img145cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img146cyrillic.png b/src/kile/symbols/cyrillic/img146cyrillic.png
new file mode 100644
index 0000000..d1c3740
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img146cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img147cyrillic.png b/src/kile/symbols/cyrillic/img147cyrillic.png
new file mode 100644
index 0000000..0a3c439
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img147cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img148cyrillic.png b/src/kile/symbols/cyrillic/img148cyrillic.png
new file mode 100644
index 0000000..deb905b
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img148cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img149cyrillic.png b/src/kile/symbols/cyrillic/img149cyrillic.png
new file mode 100644
index 0000000..eadc01d
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img149cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img150cyrillic.png b/src/kile/symbols/cyrillic/img150cyrillic.png
new file mode 100644
index 0000000..eef71f7
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img150cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img151cyrillic.png b/src/kile/symbols/cyrillic/img151cyrillic.png
new file mode 100644
index 0000000..412056b
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img151cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img152cyrillic.png b/src/kile/symbols/cyrillic/img152cyrillic.png
new file mode 100644
index 0000000..f5cacef
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img152cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img153cyrillic.png b/src/kile/symbols/cyrillic/img153cyrillic.png
new file mode 100644
index 0000000..dd1d26d
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img153cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img154cyrillic.png b/src/kile/symbols/cyrillic/img154cyrillic.png
new file mode 100644
index 0000000..2673a59
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img154cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img155cyrillic.png b/src/kile/symbols/cyrillic/img155cyrillic.png
new file mode 100644
index 0000000..e39bb26
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img155cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img156cyrillic.png b/src/kile/symbols/cyrillic/img156cyrillic.png
new file mode 100644
index 0000000..1922c01
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img156cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/cyrillic/img157cyrillic.png b/src/kile/symbols/cyrillic/img157cyrillic.png
new file mode 100644
index 0000000..3562a8e
--- /dev/null
+++ b/src/kile/symbols/cyrillic/img157cyrillic.png
Binary files differ
diff --git a/src/kile/symbols/definitions.tex b/src/kile/symbols/definitions.tex
new file mode 100644
index 0000000..9bde86d
--- /dev/null
+++ b/src/kile/symbols/definitions.tex
@@ -0,0 +1,24 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Author: Thomas Braun
+% begin: Wed 5 april 2006
+% last edit: --
+% License: GPLv2 or later
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\setlength{\parindent}{0cm} % only to look better if viewed on one page
+\pagestyle{empty}
+
+\newcommand{\page}{\newpage} % default for generating pngs
+% \newcommand{\page}{} % use this to get it on one page
+
+\newcommand{\mathcommand}[2][]{\ensuremath{#2}\page} % easy mathmode :)
+\newcommand{\command}[2][]{#2\page} % without mathmode
+
+% The optional argument is the desired command which kile should insert
+% This can therefore differ from the command used to generate the png,
+% Only use it if you really know what you do !!
+% if emtpy, the string in the mandatory argument is used as command to insert into kile.
+
+\newenvironment{neededpkgs}[2][]{}{}
+\newcommand{\pkgs}[2][]{}
+% needed additional packages for this command, see testfile.tex for how to use it
diff --git a/src/kile/symbols/delimiters.tex b/src/kile/symbols/delimiters.tex
new file mode 100644
index 0000000..89d492e
--- /dev/null
+++ b/src/kile/symbols/delimiters.tex
@@ -0,0 +1,60 @@
+\documentclass[a4paper,10pt]{article}
+\usepackage{amsmath}
+\usepackage{amssymb}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Author: Thomas Braun
+% begin: Fri 7 april 2006
+% last edit: --
+% License: GPLv2 or later
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{definitions}
+
+\begin{document}
+\mathcommand{\downarrow}
+\mathcommand{\Downarrow}
+\mathcommand{[}
+\mathcommand{]}
+\mathcommand{\langle}
+\mathcommand{\rangle}
+\mathcommand{|}
+\mathcommand{\|}
+\mathcommand{\lceil}
+\mathcommand{\rceil}
+\mathcommand{\uparrow}
+\mathcommand{\Uparrow}
+\mathcommand{\lfloor}
+\mathcommand{\rfloor}
+\mathcommand{\updownarrow}
+\mathcommand{\Updownarrow}
+\mathcommand{(}
+\mathcommand{)}
+\mathcommand{\{}
+\mathcommand{\}}
+\mathcommand{/}
+\mathcommand{\backslash}
+\par
+\mathcommand[\lmoustache]{\left \lmoustache \right.}
+\mathcommand[\rmoustache]{\left \rmoustache \right.}
+\mathcommand[\lgroup]{\left \lgroup \right.}
+\mathcommand[\rgroup]{\left \rgroup \right.}
+\mathcommand[\arrowvert]{\left \arrowvert \right.}
+\mathcommand[\Arrowvert]{\left \Arrowvert \right.}
+\mathcommand[\bracevert]{\left \bracevert \right.}
+\par
+\begin{neededpkgs}{amsmath}
+\mathcommand{\lvert}
+\mathcommand{\rvert}
+\mathcommand{\lVert}
+\mathcommand{\rVert}
+\end{neededpkgs}
+\par
+\begin{neededpkgs}{amssymb}
+\mathcommand{\ulcorner}
+\mathcommand{\urcorner}
+\mathcommand{\llcorner}
+\mathcommand{\lrcorner}
+\end{neededpkgs}
+
+\end{document}
diff --git a/src/kile/symbols/delimiters/CMakeLists.txt b/src/kile/symbols/delimiters/CMakeLists.txt
new file mode 100644
index 0000000..a472c22
--- /dev/null
+++ b/src/kile/symbols/delimiters/CMakeLists.txt
@@ -0,0 +1,44 @@
+
+########### install files ###############
+
+SET( symbols
+ img001delimiters.png
+ img002delimiters.png
+ img003delimiters.png
+ img004delimiters.png
+ img005delimiters.png
+ img006delimiters.png
+ img007delimiters.png
+ img008delimiters.png
+ img009delimiters.png
+ img010delimiters.png
+ img011delimiters.png
+ img012delimiters.png
+ img013delimiters.png
+ img014delimiters.png
+ img015delimiters.png
+ img016delimiters.png
+ img017delimiters.png
+ img018delimiters.png
+ img019delimiters.png
+ img020delimiters.png
+ img021delimiters.png
+ img022delimiters.png
+ img023delimiters.png
+ img024delimiters.png
+ img025delimiters.png
+ img026delimiters.png
+ img027delimiters.png
+ img028delimiters.png
+ img029delimiters.png
+ img030delimiters.png
+ img031delimiters.png
+ img032delimiters.png
+ img033delimiters.png
+ img034delimiters.png
+ img035delimiters.png
+ img036delimiters.png
+ img037delimiters.png
+)
+
+INSTALL( FILES ${symbols} DESTINATION share/apps/kile/mathsymbols/delimiters ) \ No newline at end of file
diff --git a/src/kile/symbols/delimiters/Makefile.am b/src/kile/symbols/delimiters/Makefile.am
new file mode 100644
index 0000000..974f343
--- /dev/null
+++ b/src/kile/symbols/delimiters/Makefile.am
@@ -0,0 +1,39 @@
+picsdir = $(kde_datadir)/kile/mathsymbols/delimiters
+
+pics_DATA = img001delimiters.png \
+ img002delimiters.png \
+ img003delimiters.png \
+ img004delimiters.png \
+ img005delimiters.png \
+ img006delimiters.png \
+ img007delimiters.png \
+ img008delimiters.png \
+ img009delimiters.png \
+ img010delimiters.png \
+ img011delimiters.png \
+ img012delimiters.png \
+ img013delimiters.png \
+ img014delimiters.png \
+ img015delimiters.png \
+ img016delimiters.png \
+ img017delimiters.png \
+ img018delimiters.png \
+ img019delimiters.png \
+ img020delimiters.png \
+ img021delimiters.png \
+ img022delimiters.png \
+ img023delimiters.png \
+ img024delimiters.png \
+ img025delimiters.png \
+ img026delimiters.png \
+ img027delimiters.png \
+ img028delimiters.png \
+ img029delimiters.png \
+ img030delimiters.png \
+ img031delimiters.png \
+ img032delimiters.png \
+ img033delimiters.png \
+ img034delimiters.png \
+ img035delimiters.png \
+ img036delimiters.png \
+ img037delimiters.png
diff --git a/src/kile/symbols/delimiters/img001delimiters.png b/src/kile/symbols/delimiters/img001delimiters.png
new file mode 100644
index 0000000..7e8918d
--- /dev/null
+++ b/src/kile/symbols/delimiters/img001delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img002delimiters.png b/src/kile/symbols/delimiters/img002delimiters.png
new file mode 100644
index 0000000..3c0b73d
--- /dev/null
+++ b/src/kile/symbols/delimiters/img002delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img003delimiters.png b/src/kile/symbols/delimiters/img003delimiters.png
new file mode 100644
index 0000000..36e92a0
--- /dev/null
+++ b/src/kile/symbols/delimiters/img003delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img004delimiters.png b/src/kile/symbols/delimiters/img004delimiters.png
new file mode 100644
index 0000000..373ef96
--- /dev/null
+++ b/src/kile/symbols/delimiters/img004delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img005delimiters.png b/src/kile/symbols/delimiters/img005delimiters.png
new file mode 100644
index 0000000..c6690f7
--- /dev/null
+++ b/src/kile/symbols/delimiters/img005delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img006delimiters.png b/src/kile/symbols/delimiters/img006delimiters.png
new file mode 100644
index 0000000..0a4d199
--- /dev/null
+++ b/src/kile/symbols/delimiters/img006delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img007delimiters.png b/src/kile/symbols/delimiters/img007delimiters.png
new file mode 100644
index 0000000..e0db350
--- /dev/null
+++ b/src/kile/symbols/delimiters/img007delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img008delimiters.png b/src/kile/symbols/delimiters/img008delimiters.png
new file mode 100644
index 0000000..a2a616d
--- /dev/null
+++ b/src/kile/symbols/delimiters/img008delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img009delimiters.png b/src/kile/symbols/delimiters/img009delimiters.png
new file mode 100644
index 0000000..d8f882b
--- /dev/null
+++ b/src/kile/symbols/delimiters/img009delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img010delimiters.png b/src/kile/symbols/delimiters/img010delimiters.png
new file mode 100644
index 0000000..0be17f6
--- /dev/null
+++ b/src/kile/symbols/delimiters/img010delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img011delimiters.png b/src/kile/symbols/delimiters/img011delimiters.png
new file mode 100644
index 0000000..48db054
--- /dev/null
+++ b/src/kile/symbols/delimiters/img011delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img012delimiters.png b/src/kile/symbols/delimiters/img012delimiters.png
new file mode 100644
index 0000000..1ce124a
--- /dev/null
+++ b/src/kile/symbols/delimiters/img012delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img013delimiters.png b/src/kile/symbols/delimiters/img013delimiters.png
new file mode 100644
index 0000000..77b25c9
--- /dev/null
+++ b/src/kile/symbols/delimiters/img013delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img014delimiters.png b/src/kile/symbols/delimiters/img014delimiters.png
new file mode 100644
index 0000000..de97c37
--- /dev/null
+++ b/src/kile/symbols/delimiters/img014delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img015delimiters.png b/src/kile/symbols/delimiters/img015delimiters.png
new file mode 100644
index 0000000..a7d6cf1
--- /dev/null
+++ b/src/kile/symbols/delimiters/img015delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img016delimiters.png b/src/kile/symbols/delimiters/img016delimiters.png
new file mode 100644
index 0000000..7bb12ec
--- /dev/null
+++ b/src/kile/symbols/delimiters/img016delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img017delimiters.png b/src/kile/symbols/delimiters/img017delimiters.png
new file mode 100644
index 0000000..84daf54
--- /dev/null
+++ b/src/kile/symbols/delimiters/img017delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img018delimiters.png b/src/kile/symbols/delimiters/img018delimiters.png
new file mode 100644
index 0000000..bb83cf3
--- /dev/null
+++ b/src/kile/symbols/delimiters/img018delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img019delimiters.png b/src/kile/symbols/delimiters/img019delimiters.png
new file mode 100644
index 0000000..9d7a5cf
--- /dev/null
+++ b/src/kile/symbols/delimiters/img019delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img020delimiters.png b/src/kile/symbols/delimiters/img020delimiters.png
new file mode 100644
index 0000000..47984f2
--- /dev/null
+++ b/src/kile/symbols/delimiters/img020delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img021delimiters.png b/src/kile/symbols/delimiters/img021delimiters.png
new file mode 100644
index 0000000..7416d7a
--- /dev/null
+++ b/src/kile/symbols/delimiters/img021delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img022delimiters.png b/src/kile/symbols/delimiters/img022delimiters.png
new file mode 100644
index 0000000..a6a1ef7
--- /dev/null
+++ b/src/kile/symbols/delimiters/img022delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img023delimiters.png b/src/kile/symbols/delimiters/img023delimiters.png
new file mode 100644
index 0000000..9a1a415
--- /dev/null
+++ b/src/kile/symbols/delimiters/img023delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img024delimiters.png b/src/kile/symbols/delimiters/img024delimiters.png
new file mode 100644
index 0000000..0d3543b
--- /dev/null
+++ b/src/kile/symbols/delimiters/img024delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img025delimiters.png b/src/kile/symbols/delimiters/img025delimiters.png
new file mode 100644
index 0000000..f138277
--- /dev/null
+++ b/src/kile/symbols/delimiters/img025delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img026delimiters.png b/src/kile/symbols/delimiters/img026delimiters.png
new file mode 100644
index 0000000..2d65bf9
--- /dev/null
+++ b/src/kile/symbols/delimiters/img026delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img027delimiters.png b/src/kile/symbols/delimiters/img027delimiters.png
new file mode 100644
index 0000000..40956aa
--- /dev/null
+++ b/src/kile/symbols/delimiters/img027delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img028delimiters.png b/src/kile/symbols/delimiters/img028delimiters.png
new file mode 100644
index 0000000..46941a7
--- /dev/null
+++ b/src/kile/symbols/delimiters/img028delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img029delimiters.png b/src/kile/symbols/delimiters/img029delimiters.png
new file mode 100644
index 0000000..14b7d81
--- /dev/null
+++ b/src/kile/symbols/delimiters/img029delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img030delimiters.png b/src/kile/symbols/delimiters/img030delimiters.png
new file mode 100644
index 0000000..e884129
--- /dev/null
+++ b/src/kile/symbols/delimiters/img030delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img031delimiters.png b/src/kile/symbols/delimiters/img031delimiters.png
new file mode 100644
index 0000000..93d71d8
--- /dev/null
+++ b/src/kile/symbols/delimiters/img031delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img032delimiters.png b/src/kile/symbols/delimiters/img032delimiters.png
new file mode 100644
index 0000000..d5cd871
--- /dev/null
+++ b/src/kile/symbols/delimiters/img032delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img033delimiters.png b/src/kile/symbols/delimiters/img033delimiters.png
new file mode 100644
index 0000000..383196c
--- /dev/null
+++ b/src/kile/symbols/delimiters/img033delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img034delimiters.png b/src/kile/symbols/delimiters/img034delimiters.png
new file mode 100644
index 0000000..da68f49
--- /dev/null
+++ b/src/kile/symbols/delimiters/img034delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img035delimiters.png b/src/kile/symbols/delimiters/img035delimiters.png
new file mode 100644
index 0000000..749552c
--- /dev/null
+++ b/src/kile/symbols/delimiters/img035delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img036delimiters.png b/src/kile/symbols/delimiters/img036delimiters.png
new file mode 100644
index 0000000..19f2303
--- /dev/null
+++ b/src/kile/symbols/delimiters/img036delimiters.png
Binary files differ
diff --git a/src/kile/symbols/delimiters/img037delimiters.png b/src/kile/symbols/delimiters/img037delimiters.png
new file mode 100644
index 0000000..b241c4d
--- /dev/null
+++ b/src/kile/symbols/delimiters/img037delimiters.png
Binary files differ
diff --git a/src/kile/symbols/gesymb.cpp b/src/kile/symbols/gesymb.cpp
new file mode 100644
index 0000000..3305494
--- /dev/null
+++ b/src/kile/symbols/gesymb.cpp
@@ -0,0 +1,175 @@
+/***************************************************************************
+ begin : Mon April 17 2006
+ edit: : Sat March 29 2008
+ copyright : (C) 2006-2008 by Thomas Braun
+ email : braun@physik.fu-berlin.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "gesymb.h"
+
+using std::cout;
+
+int main( int argc, char ** argv )
+{
+int latexret=-1;
+int dvipngret=-1;
+QString texcommand, texfile,type,dvipngcommand,line;
+QString pkgs,pkgsarg,savepkgs="",savepkgsarg="";
+bool env=false;
+
+
+if (argc < 2)
+ usage();
+
+
+texfile=argv[2];
+type=argv[1];
+
+QFile f( texfile );
+if ( !f.open( IO_ReadOnly ) )
+{
+ cout << "File " << texfile.latin1() << " is not readable\n";
+ return 1;
+}
+
+texcommand="latex " + texfile;
+dvipngcommand="dvipng --picky -bg Transparent -x 518 -O -1.2in,-1.2in -T bbox -D 300 -o img%03d" + type + ".png " + texfile.left(texfile.length()-4);
+
+cout << texcommand.latin1() << "\n";
+cout << dvipngcommand.latin1() << "\n";
+
+latexret = system(texcommand.latin1());
+dvipngret= system(dvipngcommand.latin1());
+
+if (latexret)
+{
+ cout << "Error compiling the latex file\n";
+ return 1;
+}
+if(dvipngret)
+{
+ cout << "Error producing the pngs\n";
+ return 1;
+}
+
+QTextStream t(&f);
+
+QRegExp optarg("\\\\(?:math)?command\\[(.*)\\]\\{");
+QRegExp arg("\\\\(?:math)?command\\{(.*)\\}");
+QRegExp beginenvpkgs("^\\\\begin\\{neededpkgs\\}(?:\\[(.*)\\])?\\{(.*)\\}");
+QRegExp endenvpkgs("^\\\\end\\{neededpkgs\\}");
+QRegExp cmdpkgs("\\\\pkgs(?:\\[(.*)\\])?\\{(.*)\\}");
+QRegExp comment("^\\s*%");
+
+int number=1;
+beginenvpkgs.setMinimal(true);
+cmdpkgs.setMinimal(true);
+// optarg.setMinimal(true); in some cases necessary
+
+while( (line = t.readLine()) != 0L)
+{
+ if( line.find(comment) != -1 )
+ continue;
+ if(env)
+ {
+ pkgs=savepkgs;
+ pkgsarg=savepkgsarg;
+ }
+ else
+ {
+ pkgs="";
+ pkgsarg="";
+ }
+
+ if ( line.find(beginenvpkgs) != -1)
+ {
+ env=true;
+ pkgs=beginenvpkgs.cap(2);
+ pkgsarg=beginenvpkgs.cap(1);
+ savepkgs=pkgs;
+ savepkgsarg=pkgsarg;
+ }
+ else if( line.find(cmdpkgs) != -1)
+ {
+ pkgs=cmdpkgs.cap(2);
+ pkgsarg=cmdpkgs.cap(1);
+ }
+ else if( line.find(endenvpkgs) != -1)
+ {
+ env=false;
+ savepkgs="";
+ savepkgsarg="";
+ pkgs="";
+ pkgsarg="";
+ }
+
+ cout << "line is " << line.latin1();
+ cout << "; pkgs=" << pkgs.latin1() << " ,pkgsarg=" << pkgsarg.latin1() << " ,savepkgs=" << savepkgs.latin1() << " ,savepkgsarg=" << savepkgsarg.latin1() << "\n";
+
+ if ( line.find(optarg) != -1)
+ writeComment(optarg.cap(1),pkgs,pkgsarg,type,number++);
+ else if(line.find(arg) != -1)
+ writeComment(arg.cap(1),pkgs,pkgsarg,type,number++);
+}
+
+f.close();
+return 0;
+}
+
+void usage()
+{
+ cout << "Usage:\n";
+ cout << "gesymb <type> <latex-file>\n";
+ exit(1);
+}
+
+void writeComment(QString cmd, QString pkgs, QString pkgsarg, QString type, int number)
+{
+
+QImage image;
+QString fname;
+fname.sprintf("img%03d%s.png",number,type.latin1());
+
+cout << "fname is " << fname.latin1() << "\n";
+
+if(image.load(fname))
+{
+ image.setText("Command",0,cmd);
+ image.setText("Packages",0, ( pkgsarg.isEmpty() ? "" : '[' + pkgsarg + ']' ) + ( pkgs.isEmpty() ? "" : '{' + pkgs + '}') );
+
+ if(!image.save(fname,"PNG"))
+ {
+ cout << "Image " << fname.latin1() << " could not be saved\n";
+ exit(1);
+ }
+ readComment(fname);
+}
+else
+ cout << "===writeComment=== ERROR " << fname.latin1() << " could not be loaded\n";
+
+}
+
+void readComment(QString fname)
+{
+QImage image;
+
+if(image.load(fname))
+{
+ cout << "image " << fname.latin1() << " has Command comment_" << image.text("Command").latin1() << "_\n";
+ cout << "image " << fname.latin1() << " has Packages comment_" << image.text("Packages").latin1() << "_\n";
+
+}
+else
+ cout << "===readComment=== ERROR " << fname.latin1() << " could not be loaded\n";
+}
+
+
diff --git a/src/kile/symbols/gesymb.h b/src/kile/symbols/gesymb.h
new file mode 100644
index 0000000..1477c33
--- /dev/null
+++ b/src/kile/symbols/gesymb.h
@@ -0,0 +1,27 @@
+/***************************************************************************
+ begin : Mon April 17 2003
+ copyright : (C) 2006 by Thomas Braun
+ email : braun@physik.fu-berlin.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include <qimage.h>
+#include <qstring.h>
+#include <qregexp.h>
+#include <qfile.h>
+#include <stdlib.h>
+#include <iostream>
+
+void usage();
+void writeComment(QString cmd, QString pkgs, QString pkgsarg, QString type, int number);
+void readComment(QString fname);
+
diff --git a/src/kile/symbols/greek.tex b/src/kile/symbols/greek.tex
new file mode 100644
index 0000000..23ae7d4
--- /dev/null
+++ b/src/kile/symbols/greek.tex
@@ -0,0 +1,85 @@
+\documentclass[a4paper,10pt]{article}
+\usepackage{amsmath}
+\usepackage[T1]{fontenc}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Author: Thomas Braun
+% begin: fri april 7 2006
+% last edit: ""
+% License: GPLv2 or later
+%
+% all greek letters (small, big, amsmath)
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{definitions}
+
+\begin{document}
+%
+\mathcommand{\alpha}
+\mathcommand{\beta}
+\mathcommand{\gamma}
+\mathcommand{\delta}
+\mathcommand{\epsilon}
+\mathcommand{\varepsilon}
+\mathcommand{\zeta}
+\mathcommand{\eta}
+\mathcommand{\theta}
+\mathcommand{\vartheta}
+\mathcommand{\iota}
+\mathcommand{\kappa}
+\mathcommand{\lambda}
+\mathcommand{\mu}
+\mathcommand{\nu}
+\mathcommand{\xi}
+\mathcommand{o}
+\mathcommand{\pi}
+\mathcommand{\varpi}
+\mathcommand{\rho}
+\mathcommand{\varrho}
+\mathcommand{\sigma}
+\mathcommand{\varsigma}
+\mathcommand{\tau}
+\mathcommand{\upsilon}
+\mathcommand{\phi}
+\mathcommand{\varphi}
+\mathcommand{\chi}
+\mathcommand{\psi}
+\mathcommand{\omega}
+\par
+\mathcommand{A}
+\mathcommand{B}
+\mathcommand{\Gamma}
+\pkgs{amsmath}\mathcommand{\varGamma}
+\mathcommand{\Delta}
+\pkgs{amsmath}\mathcommand{\varDelta}
+\mathcommand{E}
+\mathcommand{Z}
+\mathcommand{H}
+\mathcommand{\Theta}
+\pkgs{amsmath}\mathcommand{\varTheta}
+\mathcommand{I}
+\mathcommand{K}
+\mathcommand{\Lambda}
+\pkgs{amsmath}\mathcommand{\varLambda}
+\mathcommand{M}
+\mathcommand{N}
+\mathcommand{\Xi}
+\pkgs{amsmath}\mathcommand{\varXi}
+\mathcommand{O}
+\mathcommand{\Pi}
+\pkgs{amsmath}\mathcommand{\varPi}
+\mathcommand{P}
+\mathcommand{\Sigma}
+\pkgs{amsmath}\mathcommand{\varSigma}
+\mathcommand{T}
+\mathcommand{\Upsilon}
+\pkgs{amsmath}\mathcommand{\varUpsilon}
+\mathcommand{\Phi}
+\pkgs{amsmath}\mathcommand{\varPhi}
+\mathcommand{X}
+\mathcommand{\Psi}
+\mathcommand{\varPsi}
+\mathcommand{\Omega}
+\pkgs{amsmath}\mathcommand{\varOmega}
+
+\end{document} \ No newline at end of file
diff --git a/src/kile/symbols/greek/CMakeLists.txt b/src/kile/symbols/greek/CMakeLists.txt
new file mode 100644
index 0000000..dcf61b7
--- /dev/null
+++ b/src/kile/symbols/greek/CMakeLists.txt
@@ -0,0 +1,72 @@
+
+########### install files ###############
+
+SET( symbols
+ img001greek.png
+ img002greek.png
+ img003greek.png
+ img004greek.png
+ img005greek.png
+ img006greek.png
+ img007greek.png
+ img008greek.png
+ img009greek.png
+ img010greek.png
+ img011greek.png
+ img012greek.png
+ img013greek.png
+ img014greek.png
+ img015greek.png
+ img016greek.png
+ img017greek.png
+ img018greek.png
+ img019greek.png
+ img020greek.png
+ img021greek.png
+ img022greek.png
+ img023greek.png
+ img024greek.png
+ img025greek.png
+ img026greek.png
+ img027greek.png
+ img028greek.png
+ img029greek.png
+ img030greek.png
+ img031greek.png
+ img032greek.png
+ img033greek.png
+ img034greek.png
+ img035greek.png
+ img036greek.png
+ img037greek.png
+ img038greek.png
+ img039greek.png
+ img040greek.png
+ img041greek.png
+ img042greek.png
+ img043greek.png
+ img044greek.png
+ img045greek.png
+ img046greek.png
+ img047greek.png
+ img048greek.png
+ img049greek.png
+ img050greek.png
+ img051greek.png
+ img052greek.png
+ img053greek.png
+ img054greek.png
+ img055greek.png
+ img056greek.png
+ img057greek.png
+ img058greek.png
+ img059greek.png
+ img060greek.png
+ img061greek.png
+ img062greek.png
+ img063greek.png
+ img064greek.png
+ img065greek.png
+)
+
+INSTALL( FILES ${symbols} DESTINATION share/apps/kile/mathsymbols/greek )
diff --git a/src/kile/symbols/greek/Makefile.am b/src/kile/symbols/greek/Makefile.am
new file mode 100644
index 0000000..30cec49
--- /dev/null
+++ b/src/kile/symbols/greek/Makefile.am
@@ -0,0 +1,67 @@
+picsdir = $(kde_datadir)/kile/mathsymbols/greek
+
+pics_DATA = img001greek.png \
+ img002greek.png \
+ img003greek.png \
+ img004greek.png \
+ img005greek.png \
+ img006greek.png \
+ img007greek.png \
+ img008greek.png \
+ img009greek.png \
+ img010greek.png \
+ img011greek.png \
+ img012greek.png \
+ img013greek.png \
+ img014greek.png \
+ img015greek.png \
+ img016greek.png \
+ img017greek.png \
+ img018greek.png \
+ img019greek.png \
+ img020greek.png \
+ img021greek.png \
+ img022greek.png \
+ img023greek.png \
+ img024greek.png \
+ img025greek.png \
+ img026greek.png \
+ img027greek.png \
+ img028greek.png \
+ img029greek.png \
+ img030greek.png \
+ img031greek.png \
+ img032greek.png \
+ img033greek.png \
+ img034greek.png \
+ img035greek.png \
+ img036greek.png \
+ img037greek.png \
+ img038greek.png \
+ img039greek.png \
+ img040greek.png \
+ img041greek.png \
+ img042greek.png \
+ img043greek.png \
+ img044greek.png \
+ img045greek.png \
+ img046greek.png \
+ img047greek.png \
+ img048greek.png \
+ img049greek.png \
+ img050greek.png \
+ img051greek.png \
+ img052greek.png \
+ img053greek.png \
+ img054greek.png \
+ img055greek.png \
+ img056greek.png \
+ img057greek.png \
+ img058greek.png \
+ img059greek.png \
+ img060greek.png \
+ img061greek.png \
+ img062greek.png \
+ img063greek.png \
+ img064greek.png \
+ img065greek.png
diff --git a/src/kile/symbols/greek/img001greek.png b/src/kile/symbols/greek/img001greek.png
new file mode 100644
index 0000000..813962b
--- /dev/null
+++ b/src/kile/symbols/greek/img001greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img002greek.png b/src/kile/symbols/greek/img002greek.png
new file mode 100644
index 0000000..dbd9cbd
--- /dev/null
+++ b/src/kile/symbols/greek/img002greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img003greek.png b/src/kile/symbols/greek/img003greek.png
new file mode 100644
index 0000000..c8ed57f
--- /dev/null
+++ b/src/kile/symbols/greek/img003greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img004greek.png b/src/kile/symbols/greek/img004greek.png
new file mode 100644
index 0000000..83345b2
--- /dev/null
+++ b/src/kile/symbols/greek/img004greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img005greek.png b/src/kile/symbols/greek/img005greek.png
new file mode 100644
index 0000000..5266dde
--- /dev/null
+++ b/src/kile/symbols/greek/img005greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img006greek.png b/src/kile/symbols/greek/img006greek.png
new file mode 100644
index 0000000..a7705c7
--- /dev/null
+++ b/src/kile/symbols/greek/img006greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img007greek.png b/src/kile/symbols/greek/img007greek.png
new file mode 100644
index 0000000..c84842b
--- /dev/null
+++ b/src/kile/symbols/greek/img007greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img008greek.png b/src/kile/symbols/greek/img008greek.png
new file mode 100644
index 0000000..f69eae1
--- /dev/null
+++ b/src/kile/symbols/greek/img008greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img009greek.png b/src/kile/symbols/greek/img009greek.png
new file mode 100644
index 0000000..0703127
--- /dev/null
+++ b/src/kile/symbols/greek/img009greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img010greek.png b/src/kile/symbols/greek/img010greek.png
new file mode 100644
index 0000000..d04888e
--- /dev/null
+++ b/src/kile/symbols/greek/img010greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img011greek.png b/src/kile/symbols/greek/img011greek.png
new file mode 100644
index 0000000..69f0cb1
--- /dev/null
+++ b/src/kile/symbols/greek/img011greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img012greek.png b/src/kile/symbols/greek/img012greek.png
new file mode 100644
index 0000000..f9caddb
--- /dev/null
+++ b/src/kile/symbols/greek/img012greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img013greek.png b/src/kile/symbols/greek/img013greek.png
new file mode 100644
index 0000000..87bb0a8
--- /dev/null
+++ b/src/kile/symbols/greek/img013greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img014greek.png b/src/kile/symbols/greek/img014greek.png
new file mode 100644
index 0000000..d347b94
--- /dev/null
+++ b/src/kile/symbols/greek/img014greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img015greek.png b/src/kile/symbols/greek/img015greek.png
new file mode 100644
index 0000000..9d064f9
--- /dev/null
+++ b/src/kile/symbols/greek/img015greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img016greek.png b/src/kile/symbols/greek/img016greek.png
new file mode 100644
index 0000000..ed9dbf3
--- /dev/null
+++ b/src/kile/symbols/greek/img016greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img017greek.png b/src/kile/symbols/greek/img017greek.png
new file mode 100644
index 0000000..a89685a
--- /dev/null
+++ b/src/kile/symbols/greek/img017greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img018greek.png b/src/kile/symbols/greek/img018greek.png
new file mode 100644
index 0000000..b82eab9
--- /dev/null
+++ b/src/kile/symbols/greek/img018greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img019greek.png b/src/kile/symbols/greek/img019greek.png
new file mode 100644
index 0000000..b50389b
--- /dev/null
+++ b/src/kile/symbols/greek/img019greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img020greek.png b/src/kile/symbols/greek/img020greek.png
new file mode 100644
index 0000000..7457e69
--- /dev/null
+++ b/src/kile/symbols/greek/img020greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img021greek.png b/src/kile/symbols/greek/img021greek.png
new file mode 100644
index 0000000..601542c
--- /dev/null
+++ b/src/kile/symbols/greek/img021greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img022greek.png b/src/kile/symbols/greek/img022greek.png
new file mode 100644
index 0000000..7c5396e
--- /dev/null
+++ b/src/kile/symbols/greek/img022greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img023greek.png b/src/kile/symbols/greek/img023greek.png
new file mode 100644
index 0000000..809b03d
--- /dev/null
+++ b/src/kile/symbols/greek/img023greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img024greek.png b/src/kile/symbols/greek/img024greek.png
new file mode 100644
index 0000000..7987ada
--- /dev/null
+++ b/src/kile/symbols/greek/img024greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img025greek.png b/src/kile/symbols/greek/img025greek.png
new file mode 100644
index 0000000..4337494
--- /dev/null
+++ b/src/kile/symbols/greek/img025greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img026greek.png b/src/kile/symbols/greek/img026greek.png
new file mode 100644
index 0000000..ad4c475
--- /dev/null
+++ b/src/kile/symbols/greek/img026greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img027greek.png b/src/kile/symbols/greek/img027greek.png
new file mode 100644
index 0000000..57ec42d
--- /dev/null
+++ b/src/kile/symbols/greek/img027greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img028greek.png b/src/kile/symbols/greek/img028greek.png
new file mode 100644
index 0000000..f1fe2d1
--- /dev/null
+++ b/src/kile/symbols/greek/img028greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img029greek.png b/src/kile/symbols/greek/img029greek.png
new file mode 100644
index 0000000..9a66150
--- /dev/null
+++ b/src/kile/symbols/greek/img029greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img030greek.png b/src/kile/symbols/greek/img030greek.png
new file mode 100644
index 0000000..114f32f
--- /dev/null
+++ b/src/kile/symbols/greek/img030greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img031greek.png b/src/kile/symbols/greek/img031greek.png
new file mode 100644
index 0000000..3e9ca29
--- /dev/null
+++ b/src/kile/symbols/greek/img031greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img032greek.png b/src/kile/symbols/greek/img032greek.png
new file mode 100644
index 0000000..183485b
--- /dev/null
+++ b/src/kile/symbols/greek/img032greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img033greek.png b/src/kile/symbols/greek/img033greek.png
new file mode 100644
index 0000000..7b8cfde
--- /dev/null
+++ b/src/kile/symbols/greek/img033greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img034greek.png b/src/kile/symbols/greek/img034greek.png
new file mode 100644
index 0000000..f832168
--- /dev/null
+++ b/src/kile/symbols/greek/img034greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img035greek.png b/src/kile/symbols/greek/img035greek.png
new file mode 100644
index 0000000..089401d
--- /dev/null
+++ b/src/kile/symbols/greek/img035greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img036greek.png b/src/kile/symbols/greek/img036greek.png
new file mode 100644
index 0000000..f82ab7c
--- /dev/null
+++ b/src/kile/symbols/greek/img036greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img037greek.png b/src/kile/symbols/greek/img037greek.png
new file mode 100644
index 0000000..b595818
--- /dev/null
+++ b/src/kile/symbols/greek/img037greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img038greek.png b/src/kile/symbols/greek/img038greek.png
new file mode 100644
index 0000000..137bdbd
--- /dev/null
+++ b/src/kile/symbols/greek/img038greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img039greek.png b/src/kile/symbols/greek/img039greek.png
new file mode 100644
index 0000000..e5aa58e
--- /dev/null
+++ b/src/kile/symbols/greek/img039greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img040greek.png b/src/kile/symbols/greek/img040greek.png
new file mode 100644
index 0000000..8d47810
--- /dev/null
+++ b/src/kile/symbols/greek/img040greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img041greek.png b/src/kile/symbols/greek/img041greek.png
new file mode 100644
index 0000000..2f2fd3c
--- /dev/null
+++ b/src/kile/symbols/greek/img041greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img042greek.png b/src/kile/symbols/greek/img042greek.png
new file mode 100644
index 0000000..bc56219
--- /dev/null
+++ b/src/kile/symbols/greek/img042greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img043greek.png b/src/kile/symbols/greek/img043greek.png
new file mode 100644
index 0000000..3da9628
--- /dev/null
+++ b/src/kile/symbols/greek/img043greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img044greek.png b/src/kile/symbols/greek/img044greek.png
new file mode 100644
index 0000000..ed6bd90
--- /dev/null
+++ b/src/kile/symbols/greek/img044greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img045greek.png b/src/kile/symbols/greek/img045greek.png
new file mode 100644
index 0000000..1b63e5d
--- /dev/null
+++ b/src/kile/symbols/greek/img045greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img046greek.png b/src/kile/symbols/greek/img046greek.png
new file mode 100644
index 0000000..00b446f
--- /dev/null
+++ b/src/kile/symbols/greek/img046greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img047greek.png b/src/kile/symbols/greek/img047greek.png
new file mode 100644
index 0000000..da3d5e2
--- /dev/null
+++ b/src/kile/symbols/greek/img047greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img048greek.png b/src/kile/symbols/greek/img048greek.png
new file mode 100644
index 0000000..ca572b2
--- /dev/null
+++ b/src/kile/symbols/greek/img048greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img049greek.png b/src/kile/symbols/greek/img049greek.png
new file mode 100644
index 0000000..823a00a
--- /dev/null
+++ b/src/kile/symbols/greek/img049greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img050greek.png b/src/kile/symbols/greek/img050greek.png
new file mode 100644
index 0000000..545a77d
--- /dev/null
+++ b/src/kile/symbols/greek/img050greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img051greek.png b/src/kile/symbols/greek/img051greek.png
new file mode 100644
index 0000000..72bad32
--- /dev/null
+++ b/src/kile/symbols/greek/img051greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img052greek.png b/src/kile/symbols/greek/img052greek.png
new file mode 100644
index 0000000..c04eda6
--- /dev/null
+++ b/src/kile/symbols/greek/img052greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img053greek.png b/src/kile/symbols/greek/img053greek.png
new file mode 100644
index 0000000..705ef63
--- /dev/null
+++ b/src/kile/symbols/greek/img053greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img054greek.png b/src/kile/symbols/greek/img054greek.png
new file mode 100644
index 0000000..e96a7de
--- /dev/null
+++ b/src/kile/symbols/greek/img054greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img055greek.png b/src/kile/symbols/greek/img055greek.png
new file mode 100644
index 0000000..dd543e9
--- /dev/null
+++ b/src/kile/symbols/greek/img055greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img056greek.png b/src/kile/symbols/greek/img056greek.png
new file mode 100644
index 0000000..ecebd0e
--- /dev/null
+++ b/src/kile/symbols/greek/img056greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img057greek.png b/src/kile/symbols/greek/img057greek.png
new file mode 100644
index 0000000..0be687e
--- /dev/null
+++ b/src/kile/symbols/greek/img057greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img058greek.png b/src/kile/symbols/greek/img058greek.png
new file mode 100644
index 0000000..a69c454
--- /dev/null
+++ b/src/kile/symbols/greek/img058greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img059greek.png b/src/kile/symbols/greek/img059greek.png
new file mode 100644
index 0000000..8e8f48d
--- /dev/null
+++ b/src/kile/symbols/greek/img059greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img060greek.png b/src/kile/symbols/greek/img060greek.png
new file mode 100644
index 0000000..605e827
--- /dev/null
+++ b/src/kile/symbols/greek/img060greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img061greek.png b/src/kile/symbols/greek/img061greek.png
new file mode 100644
index 0000000..8fc3198
--- /dev/null
+++ b/src/kile/symbols/greek/img061greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img062greek.png b/src/kile/symbols/greek/img062greek.png
new file mode 100644
index 0000000..795a2c9
--- /dev/null
+++ b/src/kile/symbols/greek/img062greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img063greek.png b/src/kile/symbols/greek/img063greek.png
new file mode 100644
index 0000000..b8a37b0
--- /dev/null
+++ b/src/kile/symbols/greek/img063greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img064greek.png b/src/kile/symbols/greek/img064greek.png
new file mode 100644
index 0000000..e374f63
--- /dev/null
+++ b/src/kile/symbols/greek/img064greek.png
Binary files differ
diff --git a/src/kile/symbols/greek/img065greek.png b/src/kile/symbols/greek/img065greek.png
new file mode 100644
index 0000000..48c780e
--- /dev/null
+++ b/src/kile/symbols/greek/img065greek.png
Binary files differ
diff --git a/src/kile/symbols/misc-math.tex b/src/kile/symbols/misc-math.tex
new file mode 100644
index 0000000..18902ae
--- /dev/null
+++ b/src/kile/symbols/misc-math.tex
@@ -0,0 +1,158 @@
+\documentclass[a4paper,10pt]{article}
+\usepackage{amsmath}
+\usepackage{amssymb}
+\usepackage[T1]{fontenc}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Author: Thomas Braun
+% begin: Sun 9 april 2006
+% last edit: So 1 april
+% License: GPLv2 or later
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\iffalse
+\newcommand{\begin{neededpkgs}}[2][]{}
+\newcommand{\pkgs}[2][]{}
+\newcommand{\mathcommand}[1]{}
+\fi
+
+\input{definitions}
+
+\begin{document}
+
+\mathcommand{\cdotp}
+\mathcommand{\colon}
+\mathcommand{\ldotp}
+\mathcommand{\vdots}
+\mathcommand{\cdots}
+\mathcommand{\ddots}
+\mathcommand{\ldots}
+
+\par\bigskip
+
+\mathcommand{\neg}
+\mathcommand{\infty}
+\mathcommand{\prime}
+\pkgs{amssymb}\mathcommand{\backprime}
+\mathcommand{\backslash}
+\pkgs{amssymb}\mathcommand{\diagdown}
+\pkgs{amssymb}\mathcommand{\diagup}
+\mathcommand{\surd}
+\mathcommand{\emptyset}
+\pkgs{amssymb}\mathcommand{\varnothing}
+
+\par\bigskip
+
+\mathcommand{\sharp}
+\mathcommand{\flat}
+\mathcommand{\natural}
+\mathcommand{\angle}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\sphericalangle}
+\mathcommand{\measuredangle}
+\mathcommand{\Box}
+\mathcommand{\square}
+\end{neededpkgs}
+
+\mathcommand{\triangle}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\vartriangle}
+\mathcommand{\triangledown}
+\mathcommand{\Diamond}
+\end{neededpkgs}
+\mathcommand{\diamondsuit}
+\pkgs{amssymb}\mathcommand{\lozenge}
+\mathcommand{\heartsuit}
+
+\par\bigskip
+
+\begin{neededpkgs}{amssymb}
+\mathcommand{\blacksquare}
+\mathcommand{\blacktriangle}
+\mathcommand{\blacktriangledown}
+\mathcommand{\blacklozenge}
+\mathcommand{\bigstar}
+\end{neededpkgs}
+\mathcommand{\spadesuit}
+\mathcommand{\clubsuit}
+
+\par\bigskip
+
+\mathcommand{\forall}
+\mathcommand{\exists}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\nexists}
+\mathcommand{\Finv}
+\mathcommand{\Game}
+\end{neededpkgs}
+\mathcommand{\ni}
+\mathcommand{\in}
+\mathcommand{\notin}
+\pkgs{amssymb} \mathcommand{\complement}
+\mathcommand{\Im}
+\mathcommand{\Re}
+\mathcommand{\aleph}
+\mathcommand{\wp}
+
+\par\bigskip
+
+\pkgs{amssymb}\mathcommand{\hslash}
+\mathcommand{\hbar}
+\mathcommand{\imath}
+\mathcommand{\jmath}
+\pkgs{amssymb}\mathcommand{\Bbbk}
+\mathcommand{\ell}
+\pkgs{amssymb}\mathcommand{\circledR}
+\pkgs{amssymb}\mathcommand{\circledS}
+\mathcommand{\bot}
+\mathcommand{\top}
+\mathcommand{\partial}
+\mathcommand{\nabla}
+\pkgs{amssymb}\mathcommand{\eth}
+\pkgs{amssymb}\mathcommand{\mho}
+
+\par\bigskip
+
+\mathcommand[\acute{}]{\acute{a}}
+\mathcommand[\grave{}]{\grave{a}}
+\mathcommand[\check{}]{\check{a}}
+\mathcommand[\hat{}]{\hat{a}}
+\mathcommand[\tilde{}]{\tilde{a}}
+\mathcommand[\bar{}]{\bar{a}}
+\mathcommand[\vec{}]{\vec{a}}
+\mathcommand[\breve{}]{\breve{a}}
+\mathcommand[\dot{}]{\dot{a}}
+\mathcommand[\ddot{}]{\ddot{a}}
+\begin{neededpkgs}{amsmath}
+\mathcommand[\dddot{}]{\dddot{a}}
+\mathcommand[\ddddot{}]{\ddddot{a}}
+\end{neededpkgs}
+\mathcommand[\mathring{}]{\mathring{a}}
+
+\par\bigskip
+
+\mathcommand[\widetilde{}]{\widetilde{abc}}
+\mathcommand[\widehat{}]{\widehat{abc}}
+\mathcommand[\overleftarrow{}]{\overleftarrow{abc}}
+\mathcommand[\overrightarrow{}]{\overrightarrow{abc}}
+\mathcommand[\overline{}]{\overline{abc}}
+\mathcommand[\underline{}]{\underline{abc}}
+\mathcommand[\overbrace{}]{\overbrace{abc}}
+\mathcommand[\underbrace{}]{\underbrace{abc}}
+
+\par\bigskip
+
+\begin{neededpkgs}{amsmath}
+\mathcommand[\overleftrightarrow{}]{\overleftrightarrow{abc}}
+\mathcommand[\underleftrightarrow{}]{\underleftrightarrow{abc}}
+\mathcommand[\underleftarrow{}]{\underleftarrow{abc}}
+\mathcommand[\underrightarrow{}]{\underrightarrow{abc}}
+\mathcommand[\xleftarrow{}]{\xleftarrow{abc}}
+\mathcommand[\xrightarrow{}]{\xrightarrow{abc}}
+\end{neededpkgs}
+\mathcommand[\stackrel{}{}]{\stackrel{abc}{=}}
+\mathcommand[\sqrt{}]{\sqrt{a}}
+\mathcommand{f'}
+\mathcommand{f''}
+
+\end{document}
diff --git a/src/kile/symbols/misc-math/CMakeLists.txt b/src/kile/symbols/misc-math/CMakeLists.txt
new file mode 100644
index 0000000..1c8df35
--- /dev/null
+++ b/src/kile/symbols/misc-math/CMakeLists.txt
@@ -0,0 +1,105 @@
+
+########### install files ###############
+
+SET( symbols
+ img001misc-math.png
+ img002misc-math.png
+ img003misc-math.png
+ img004misc-math.png
+ img005misc-math.png
+ img006misc-math.png
+ img007misc-math.png
+ img008misc-math.png
+ img009misc-math.png
+ img010misc-math.png
+ img011misc-math.png
+ img012misc-math.png
+ img013misc-math.png
+ img014misc-math.png
+ img015misc-math.png
+ img016misc-math.png
+ img017misc-math.png
+ img018misc-math.png
+ img019misc-math.png
+ img020misc-math.png
+ img021misc-math.png
+ img022misc-math.png
+ img023misc-math.png
+ img024misc-math.png
+ img025misc-math.png
+ img026misc-math.png
+ img027misc-math.png
+ img028misc-math.png
+ img029misc-math.png
+ img030misc-math.png
+ img031misc-math.png
+ img032misc-math.png
+ img033misc-math.png
+ img034misc-math.png
+ img035misc-math.png
+ img036misc-math.png
+ img037misc-math.png
+ img038misc-math.png
+ img039misc-math.png
+ img040misc-math.png
+ img041misc-math.png
+ img042misc-math.png
+ img043misc-math.png
+ img044misc-math.png
+ img045misc-math.png
+ img046misc-math.png
+ img047misc-math.png
+ img048misc-math.png
+ img049misc-math.png
+ img050misc-math.png
+ img051misc-math.png
+ img052misc-math.png
+ img053misc-math.png
+ img054misc-math.png
+ img055misc-math.png
+ img056misc-math.png
+ img057misc-math.png
+ img058misc-math.png
+ img059misc-math.png
+ img060misc-math.png
+ img061misc-math.png
+ img062misc-math.png
+ img063misc-math.png
+ img064misc-math.png
+ img065misc-math.png
+ img066misc-math.png
+ img067misc-math.png
+ img068misc-math.png
+ img069misc-math.png
+ img070misc-math.png
+ img071misc-math.png
+ img072misc-math.png
+ img073misc-math.png
+ img074misc-math.png
+ img075misc-math.png
+ img076misc-math.png
+ img077misc-math.png
+ img078misc-math.png
+ img079misc-math.png
+ img080misc-math.png
+ img081misc-math.png
+ img082misc-math.png
+ img083misc-math.png
+ img084misc-math.png
+ img085misc-math.png
+ img086misc-math.png
+ img087misc-math.png
+ img088misc-math.png
+ img089misc-math.png
+ img090misc-math.png
+ img091misc-math.png
+ img092misc-math.png
+ img093misc-math.png
+ img094misc-math.png
+ img095misc-math.png
+ img096misc-math.png
+ img097misc-math.png
+)
+
+INSTALL( FILES ${symbols} DESTINATION share/apps/kile/mathsymbols/misc-math )
+
diff --git a/src/kile/symbols/misc-math/Makefile.am b/src/kile/symbols/misc-math/Makefile.am
new file mode 100644
index 0000000..73ec384
--- /dev/null
+++ b/src/kile/symbols/misc-math/Makefile.am
@@ -0,0 +1,99 @@
+picsdir = $(kde_datadir)/kile/mathsymbols/misc-math
+
+pics_DATA = img001misc-math.png \
+ img002misc-math.png \
+ img003misc-math.png \
+ img004misc-math.png \
+ img005misc-math.png \
+ img006misc-math.png \
+ img007misc-math.png \
+ img008misc-math.png \
+ img009misc-math.png \
+ img010misc-math.png \
+ img011misc-math.png \
+ img012misc-math.png \
+ img013misc-math.png \
+ img014misc-math.png \
+ img015misc-math.png \
+ img016misc-math.png \
+ img017misc-math.png \
+ img018misc-math.png \
+ img019misc-math.png \
+ img020misc-math.png \
+ img021misc-math.png \
+ img022misc-math.png \
+ img023misc-math.png \
+ img024misc-math.png \
+ img025misc-math.png \
+ img026misc-math.png \
+ img027misc-math.png \
+ img028misc-math.png \
+ img029misc-math.png \
+ img030misc-math.png \
+ img031misc-math.png \
+ img032misc-math.png \
+ img033misc-math.png \
+ img034misc-math.png \
+ img035misc-math.png \
+ img036misc-math.png \
+ img037misc-math.png \
+ img038misc-math.png \
+ img039misc-math.png \
+ img040misc-math.png \
+ img041misc-math.png \
+ img042misc-math.png \
+ img043misc-math.png \
+ img044misc-math.png \
+ img045misc-math.png \
+ img046misc-math.png \
+ img047misc-math.png \
+ img048misc-math.png \
+ img049misc-math.png \
+ img050misc-math.png \
+ img051misc-math.png \
+ img052misc-math.png \
+ img053misc-math.png \
+ img054misc-math.png \
+ img055misc-math.png \
+ img056misc-math.png \
+ img057misc-math.png \
+ img058misc-math.png \
+ img059misc-math.png \
+ img060misc-math.png \
+ img061misc-math.png \
+ img062misc-math.png \
+ img063misc-math.png \
+ img064misc-math.png \
+ img065misc-math.png \
+ img066misc-math.png \
+ img067misc-math.png \
+ img068misc-math.png \
+ img069misc-math.png \
+ img070misc-math.png \
+ img071misc-math.png \
+ img072misc-math.png \
+ img073misc-math.png \
+ img074misc-math.png \
+ img075misc-math.png \
+ img076misc-math.png \
+ img077misc-math.png \
+ img078misc-math.png \
+ img079misc-math.png \
+ img080misc-math.png \
+ img081misc-math.png \
+ img082misc-math.png \
+ img083misc-math.png \
+ img084misc-math.png \
+ img085misc-math.png \
+ img086misc-math.png \
+ img087misc-math.png \
+ img088misc-math.png \
+ img089misc-math.png \
+ img090misc-math.png \
+ img091misc-math.png \
+ img092misc-math.png \
+ img093misc-math.png \
+ img094misc-math.png \
+ img095misc-math.png \
+ img096misc-math.png \
+ img097misc-math.png
diff --git a/src/kile/symbols/misc-math/img001misc-math.png b/src/kile/symbols/misc-math/img001misc-math.png
new file mode 100644
index 0000000..1d645d0
--- /dev/null
+++ b/src/kile/symbols/misc-math/img001misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img002misc-math.png b/src/kile/symbols/misc-math/img002misc-math.png
new file mode 100644
index 0000000..4f602a0
--- /dev/null
+++ b/src/kile/symbols/misc-math/img002misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img003misc-math.png b/src/kile/symbols/misc-math/img003misc-math.png
new file mode 100644
index 0000000..b84661c
--- /dev/null
+++ b/src/kile/symbols/misc-math/img003misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img004misc-math.png b/src/kile/symbols/misc-math/img004misc-math.png
new file mode 100644
index 0000000..8c6196b
--- /dev/null
+++ b/src/kile/symbols/misc-math/img004misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img005misc-math.png b/src/kile/symbols/misc-math/img005misc-math.png
new file mode 100644
index 0000000..905df3a
--- /dev/null
+++ b/src/kile/symbols/misc-math/img005misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img006misc-math.png b/src/kile/symbols/misc-math/img006misc-math.png
new file mode 100644
index 0000000..3f307c4
--- /dev/null
+++ b/src/kile/symbols/misc-math/img006misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img007misc-math.png b/src/kile/symbols/misc-math/img007misc-math.png
new file mode 100644
index 0000000..ded579b
--- /dev/null
+++ b/src/kile/symbols/misc-math/img007misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img008misc-math.png b/src/kile/symbols/misc-math/img008misc-math.png
new file mode 100644
index 0000000..d598acf
--- /dev/null
+++ b/src/kile/symbols/misc-math/img008misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img009misc-math.png b/src/kile/symbols/misc-math/img009misc-math.png
new file mode 100644
index 0000000..6be2dae
--- /dev/null
+++ b/src/kile/symbols/misc-math/img009misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img010misc-math.png b/src/kile/symbols/misc-math/img010misc-math.png
new file mode 100644
index 0000000..52397e8
--- /dev/null
+++ b/src/kile/symbols/misc-math/img010misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img011misc-math.png b/src/kile/symbols/misc-math/img011misc-math.png
new file mode 100644
index 0000000..1e30e48
--- /dev/null
+++ b/src/kile/symbols/misc-math/img011misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img012misc-math.png b/src/kile/symbols/misc-math/img012misc-math.png
new file mode 100644
index 0000000..a6a1ef7
--- /dev/null
+++ b/src/kile/symbols/misc-math/img012misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img013misc-math.png b/src/kile/symbols/misc-math/img013misc-math.png
new file mode 100644
index 0000000..3a9fede
--- /dev/null
+++ b/src/kile/symbols/misc-math/img013misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img014misc-math.png b/src/kile/symbols/misc-math/img014misc-math.png
new file mode 100644
index 0000000..265dbd2
--- /dev/null
+++ b/src/kile/symbols/misc-math/img014misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img015misc-math.png b/src/kile/symbols/misc-math/img015misc-math.png
new file mode 100644
index 0000000..58288ef
--- /dev/null
+++ b/src/kile/symbols/misc-math/img015misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img016misc-math.png b/src/kile/symbols/misc-math/img016misc-math.png
new file mode 100644
index 0000000..8c5caa7
--- /dev/null
+++ b/src/kile/symbols/misc-math/img016misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img017misc-math.png b/src/kile/symbols/misc-math/img017misc-math.png
new file mode 100644
index 0000000..00bed4f
--- /dev/null
+++ b/src/kile/symbols/misc-math/img017misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img018misc-math.png b/src/kile/symbols/misc-math/img018misc-math.png
new file mode 100644
index 0000000..d0ca127
--- /dev/null
+++ b/src/kile/symbols/misc-math/img018misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img019misc-math.png b/src/kile/symbols/misc-math/img019misc-math.png
new file mode 100644
index 0000000..d2568d9
--- /dev/null
+++ b/src/kile/symbols/misc-math/img019misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img020misc-math.png b/src/kile/symbols/misc-math/img020misc-math.png
new file mode 100644
index 0000000..a174e9e
--- /dev/null
+++ b/src/kile/symbols/misc-math/img020misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img021misc-math.png b/src/kile/symbols/misc-math/img021misc-math.png
new file mode 100644
index 0000000..67913d6
--- /dev/null
+++ b/src/kile/symbols/misc-math/img021misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img022misc-math.png b/src/kile/symbols/misc-math/img022misc-math.png
new file mode 100644
index 0000000..64268c1
--- /dev/null
+++ b/src/kile/symbols/misc-math/img022misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img023misc-math.png b/src/kile/symbols/misc-math/img023misc-math.png
new file mode 100644
index 0000000..fbee4f2
--- /dev/null
+++ b/src/kile/symbols/misc-math/img023misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img024misc-math.png b/src/kile/symbols/misc-math/img024misc-math.png
new file mode 100644
index 0000000..e1d9052
--- /dev/null
+++ b/src/kile/symbols/misc-math/img024misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img025misc-math.png b/src/kile/symbols/misc-math/img025misc-math.png
new file mode 100644
index 0000000..c62e80e
--- /dev/null
+++ b/src/kile/symbols/misc-math/img025misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img026misc-math.png b/src/kile/symbols/misc-math/img026misc-math.png
new file mode 100644
index 0000000..4a0ad24
--- /dev/null
+++ b/src/kile/symbols/misc-math/img026misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img027misc-math.png b/src/kile/symbols/misc-math/img027misc-math.png
new file mode 100644
index 0000000..53411be
--- /dev/null
+++ b/src/kile/symbols/misc-math/img027misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img028misc-math.png b/src/kile/symbols/misc-math/img028misc-math.png
new file mode 100644
index 0000000..93ef4e5
--- /dev/null
+++ b/src/kile/symbols/misc-math/img028misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img029misc-math.png b/src/kile/symbols/misc-math/img029misc-math.png
new file mode 100644
index 0000000..b23c435
--- /dev/null
+++ b/src/kile/symbols/misc-math/img029misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img030misc-math.png b/src/kile/symbols/misc-math/img030misc-math.png
new file mode 100644
index 0000000..64d9630
--- /dev/null
+++ b/src/kile/symbols/misc-math/img030misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img031misc-math.png b/src/kile/symbols/misc-math/img031misc-math.png
new file mode 100644
index 0000000..ab0d89c
--- /dev/null
+++ b/src/kile/symbols/misc-math/img031misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img032misc-math.png b/src/kile/symbols/misc-math/img032misc-math.png
new file mode 100644
index 0000000..9d04c32
--- /dev/null
+++ b/src/kile/symbols/misc-math/img032misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img033misc-math.png b/src/kile/symbols/misc-math/img033misc-math.png
new file mode 100644
index 0000000..ea4e6f5
--- /dev/null
+++ b/src/kile/symbols/misc-math/img033misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img034misc-math.png b/src/kile/symbols/misc-math/img034misc-math.png
new file mode 100644
index 0000000..43397fa
--- /dev/null
+++ b/src/kile/symbols/misc-math/img034misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img035misc-math.png b/src/kile/symbols/misc-math/img035misc-math.png
new file mode 100644
index 0000000..b897411
--- /dev/null
+++ b/src/kile/symbols/misc-math/img035misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img036misc-math.png b/src/kile/symbols/misc-math/img036misc-math.png
new file mode 100644
index 0000000..b5f1743
--- /dev/null
+++ b/src/kile/symbols/misc-math/img036misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img037misc-math.png b/src/kile/symbols/misc-math/img037misc-math.png
new file mode 100644
index 0000000..19ead9f
--- /dev/null
+++ b/src/kile/symbols/misc-math/img037misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img038misc-math.png b/src/kile/symbols/misc-math/img038misc-math.png
new file mode 100644
index 0000000..c4991e2
--- /dev/null
+++ b/src/kile/symbols/misc-math/img038misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img039misc-math.png b/src/kile/symbols/misc-math/img039misc-math.png
new file mode 100644
index 0000000..0819a8d
--- /dev/null
+++ b/src/kile/symbols/misc-math/img039misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img040misc-math.png b/src/kile/symbols/misc-math/img040misc-math.png
new file mode 100644
index 0000000..b819e7a
--- /dev/null
+++ b/src/kile/symbols/misc-math/img040misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img041misc-math.png b/src/kile/symbols/misc-math/img041misc-math.png
new file mode 100644
index 0000000..a8bb169
--- /dev/null
+++ b/src/kile/symbols/misc-math/img041misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img042misc-math.png b/src/kile/symbols/misc-math/img042misc-math.png
new file mode 100644
index 0000000..d880d57
--- /dev/null
+++ b/src/kile/symbols/misc-math/img042misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img043misc-math.png b/src/kile/symbols/misc-math/img043misc-math.png
new file mode 100644
index 0000000..74be08e
--- /dev/null
+++ b/src/kile/symbols/misc-math/img043misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img044misc-math.png b/src/kile/symbols/misc-math/img044misc-math.png
new file mode 100644
index 0000000..35198a9
--- /dev/null
+++ b/src/kile/symbols/misc-math/img044misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img045misc-math.png b/src/kile/symbols/misc-math/img045misc-math.png
new file mode 100644
index 0000000..2d85ae3
--- /dev/null
+++ b/src/kile/symbols/misc-math/img045misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img046misc-math.png b/src/kile/symbols/misc-math/img046misc-math.png
new file mode 100644
index 0000000..061831a
--- /dev/null
+++ b/src/kile/symbols/misc-math/img046misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img047misc-math.png b/src/kile/symbols/misc-math/img047misc-math.png
new file mode 100644
index 0000000..053e08f
--- /dev/null
+++ b/src/kile/symbols/misc-math/img047misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img048misc-math.png b/src/kile/symbols/misc-math/img048misc-math.png
new file mode 100644
index 0000000..c693b35
--- /dev/null
+++ b/src/kile/symbols/misc-math/img048misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img049misc-math.png b/src/kile/symbols/misc-math/img049misc-math.png
new file mode 100644
index 0000000..207b369
--- /dev/null
+++ b/src/kile/symbols/misc-math/img049misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img050misc-math.png b/src/kile/symbols/misc-math/img050misc-math.png
new file mode 100644
index 0000000..e592454
--- /dev/null
+++ b/src/kile/symbols/misc-math/img050misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img051misc-math.png b/src/kile/symbols/misc-math/img051misc-math.png
new file mode 100644
index 0000000..e93f038
--- /dev/null
+++ b/src/kile/symbols/misc-math/img051misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img052misc-math.png b/src/kile/symbols/misc-math/img052misc-math.png
new file mode 100644
index 0000000..be3031e
--- /dev/null
+++ b/src/kile/symbols/misc-math/img052misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img053misc-math.png b/src/kile/symbols/misc-math/img053misc-math.png
new file mode 100644
index 0000000..3697f8b
--- /dev/null
+++ b/src/kile/symbols/misc-math/img053misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img054misc-math.png b/src/kile/symbols/misc-math/img054misc-math.png
new file mode 100644
index 0000000..2f36b24
--- /dev/null
+++ b/src/kile/symbols/misc-math/img054misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img055misc-math.png b/src/kile/symbols/misc-math/img055misc-math.png
new file mode 100644
index 0000000..597d71c
--- /dev/null
+++ b/src/kile/symbols/misc-math/img055misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img056misc-math.png b/src/kile/symbols/misc-math/img056misc-math.png
new file mode 100644
index 0000000..3116546
--- /dev/null
+++ b/src/kile/symbols/misc-math/img056misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img057misc-math.png b/src/kile/symbols/misc-math/img057misc-math.png
new file mode 100644
index 0000000..5e0c175
--- /dev/null
+++ b/src/kile/symbols/misc-math/img057misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img058misc-math.png b/src/kile/symbols/misc-math/img058misc-math.png
new file mode 100644
index 0000000..27adf73
--- /dev/null
+++ b/src/kile/symbols/misc-math/img058misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img059misc-math.png b/src/kile/symbols/misc-math/img059misc-math.png
new file mode 100644
index 0000000..3986c51
--- /dev/null
+++ b/src/kile/symbols/misc-math/img059misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img060misc-math.png b/src/kile/symbols/misc-math/img060misc-math.png
new file mode 100644
index 0000000..86572ae
--- /dev/null
+++ b/src/kile/symbols/misc-math/img060misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img061misc-math.png b/src/kile/symbols/misc-math/img061misc-math.png
new file mode 100644
index 0000000..3a3f3ef
--- /dev/null
+++ b/src/kile/symbols/misc-math/img061misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img062misc-math.png b/src/kile/symbols/misc-math/img062misc-math.png
new file mode 100644
index 0000000..f500b8c
--- /dev/null
+++ b/src/kile/symbols/misc-math/img062misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img063misc-math.png b/src/kile/symbols/misc-math/img063misc-math.png
new file mode 100644
index 0000000..8e2cf5d
--- /dev/null
+++ b/src/kile/symbols/misc-math/img063misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img064misc-math.png b/src/kile/symbols/misc-math/img064misc-math.png
new file mode 100644
index 0000000..dcb3631
--- /dev/null
+++ b/src/kile/symbols/misc-math/img064misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img065misc-math.png b/src/kile/symbols/misc-math/img065misc-math.png
new file mode 100644
index 0000000..78e27ab
--- /dev/null
+++ b/src/kile/symbols/misc-math/img065misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img066misc-math.png b/src/kile/symbols/misc-math/img066misc-math.png
new file mode 100644
index 0000000..2c38d5a
--- /dev/null
+++ b/src/kile/symbols/misc-math/img066misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img067misc-math.png b/src/kile/symbols/misc-math/img067misc-math.png
new file mode 100644
index 0000000..daee1ae
--- /dev/null
+++ b/src/kile/symbols/misc-math/img067misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img068misc-math.png b/src/kile/symbols/misc-math/img068misc-math.png
new file mode 100644
index 0000000..9209a42
--- /dev/null
+++ b/src/kile/symbols/misc-math/img068misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img069misc-math.png b/src/kile/symbols/misc-math/img069misc-math.png
new file mode 100644
index 0000000..36c3ca4
--- /dev/null
+++ b/src/kile/symbols/misc-math/img069misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img070misc-math.png b/src/kile/symbols/misc-math/img070misc-math.png
new file mode 100644
index 0000000..4388202
--- /dev/null
+++ b/src/kile/symbols/misc-math/img070misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img071misc-math.png b/src/kile/symbols/misc-math/img071misc-math.png
new file mode 100644
index 0000000..1647d75
--- /dev/null
+++ b/src/kile/symbols/misc-math/img071misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img072misc-math.png b/src/kile/symbols/misc-math/img072misc-math.png
new file mode 100644
index 0000000..1091b1f
--- /dev/null
+++ b/src/kile/symbols/misc-math/img072misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img073misc-math.png b/src/kile/symbols/misc-math/img073misc-math.png
new file mode 100644
index 0000000..237bea5
--- /dev/null
+++ b/src/kile/symbols/misc-math/img073misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img074misc-math.png b/src/kile/symbols/misc-math/img074misc-math.png
new file mode 100644
index 0000000..ebac2da
--- /dev/null
+++ b/src/kile/symbols/misc-math/img074misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img075misc-math.png b/src/kile/symbols/misc-math/img075misc-math.png
new file mode 100644
index 0000000..76604d3
--- /dev/null
+++ b/src/kile/symbols/misc-math/img075misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img076misc-math.png b/src/kile/symbols/misc-math/img076misc-math.png
new file mode 100644
index 0000000..0e6f510
--- /dev/null
+++ b/src/kile/symbols/misc-math/img076misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img077misc-math.png b/src/kile/symbols/misc-math/img077misc-math.png
new file mode 100644
index 0000000..d4d64d0
--- /dev/null
+++ b/src/kile/symbols/misc-math/img077misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img078misc-math.png b/src/kile/symbols/misc-math/img078misc-math.png
new file mode 100644
index 0000000..b300223
--- /dev/null
+++ b/src/kile/symbols/misc-math/img078misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img079misc-math.png b/src/kile/symbols/misc-math/img079misc-math.png
new file mode 100644
index 0000000..2a36df1
--- /dev/null
+++ b/src/kile/symbols/misc-math/img079misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img080misc-math.png b/src/kile/symbols/misc-math/img080misc-math.png
new file mode 100644
index 0000000..a3533e1
--- /dev/null
+++ b/src/kile/symbols/misc-math/img080misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img081misc-math.png b/src/kile/symbols/misc-math/img081misc-math.png
new file mode 100644
index 0000000..3dd99bb
--- /dev/null
+++ b/src/kile/symbols/misc-math/img081misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img082misc-math.png b/src/kile/symbols/misc-math/img082misc-math.png
new file mode 100644
index 0000000..07c3493
--- /dev/null
+++ b/src/kile/symbols/misc-math/img082misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img083misc-math.png b/src/kile/symbols/misc-math/img083misc-math.png
new file mode 100644
index 0000000..e358c11
--- /dev/null
+++ b/src/kile/symbols/misc-math/img083misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img084misc-math.png b/src/kile/symbols/misc-math/img084misc-math.png
new file mode 100644
index 0000000..c548797
--- /dev/null
+++ b/src/kile/symbols/misc-math/img084misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img085misc-math.png b/src/kile/symbols/misc-math/img085misc-math.png
new file mode 100644
index 0000000..f29018c
--- /dev/null
+++ b/src/kile/symbols/misc-math/img085misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img086misc-math.png b/src/kile/symbols/misc-math/img086misc-math.png
new file mode 100644
index 0000000..ec5e64c
--- /dev/null
+++ b/src/kile/symbols/misc-math/img086misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img087misc-math.png b/src/kile/symbols/misc-math/img087misc-math.png
new file mode 100644
index 0000000..99f08d8
--- /dev/null
+++ b/src/kile/symbols/misc-math/img087misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img088misc-math.png b/src/kile/symbols/misc-math/img088misc-math.png
new file mode 100644
index 0000000..ad5c1db
--- /dev/null
+++ b/src/kile/symbols/misc-math/img088misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img089misc-math.png b/src/kile/symbols/misc-math/img089misc-math.png
new file mode 100644
index 0000000..ba94b6a
--- /dev/null
+++ b/src/kile/symbols/misc-math/img089misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img090misc-math.png b/src/kile/symbols/misc-math/img090misc-math.png
new file mode 100644
index 0000000..6486b4e
--- /dev/null
+++ b/src/kile/symbols/misc-math/img090misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img091misc-math.png b/src/kile/symbols/misc-math/img091misc-math.png
new file mode 100644
index 0000000..81dae15
--- /dev/null
+++ b/src/kile/symbols/misc-math/img091misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img092misc-math.png b/src/kile/symbols/misc-math/img092misc-math.png
new file mode 100644
index 0000000..c1eaffd
--- /dev/null
+++ b/src/kile/symbols/misc-math/img092misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img093misc-math.png b/src/kile/symbols/misc-math/img093misc-math.png
new file mode 100644
index 0000000..b257625
--- /dev/null
+++ b/src/kile/symbols/misc-math/img093misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img094misc-math.png b/src/kile/symbols/misc-math/img094misc-math.png
new file mode 100644
index 0000000..b43853f
--- /dev/null
+++ b/src/kile/symbols/misc-math/img094misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img095misc-math.png b/src/kile/symbols/misc-math/img095misc-math.png
new file mode 100644
index 0000000..90fd803
--- /dev/null
+++ b/src/kile/symbols/misc-math/img095misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img096misc-math.png b/src/kile/symbols/misc-math/img096misc-math.png
new file mode 100644
index 0000000..866b851
--- /dev/null
+++ b/src/kile/symbols/misc-math/img096misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-math/img097misc-math.png b/src/kile/symbols/misc-math/img097misc-math.png
new file mode 100644
index 0000000..656320b
--- /dev/null
+++ b/src/kile/symbols/misc-math/img097misc-math.png
Binary files differ
diff --git a/src/kile/symbols/misc-text.tex b/src/kile/symbols/misc-text.tex
new file mode 100644
index 0000000..1afa2d2
--- /dev/null
+++ b/src/kile/symbols/misc-text.tex
@@ -0,0 +1,204 @@
+\documentclass[a4paper,10pt]{scrartcl}
+
+\usepackage{textcomp}
+\usepackage{amssymb}
+\usepackage{eurosym}
+\usepackage{marvosym}
+\usepackage{wasysym}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Author: Thomas Braun
+% begin: Sat 15 april 2006
+% last edit: Sat 5 april 2008
+% License: GPLv2 or later
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{definitions}
+
+\iffalse
+\newcommand{\begin{neededpkgs}}[2][]{}
+\newcommand{\pkgs}[2][]{}
+\fi
+
+\begin{document}
+
+\command{\dots}
+\pkgs{textcomp}\command{\texttildelow}
+\command{\textasciicircum}
+\pkgs{textcomp}\command{\textasciimacron}
+\pkgs{textcomp}\command{\textasciiacute}
+\pkgs{textcomp}\command{\textasciidieresis}
+\command{\textasciitilde}
+\pkgs{textcomp}\command{\textasciigrave}
+\pkgs{textcomp}\command{\textasciibreve}
+\pkgs{textcomp}\command{\textasciicaron}
+\pkgs{textcomp}\command{\textacutedbl}
+\pkgs{textcomp}\command{\textgravedbl}
+\command{\textquotedblleft}
+\command{\textquotedblright}
+\command{\textquoteleft}
+\command{\textquoteright}
+\pkgs{textcomp}\command{\textquotestraightbase}
+\pkgs{textcomp}\command{\textquotestraightdblbase}
+\pkgs{textcomp}\command{\textquotesingle}
+\pkgs{textcomp}\command{\textdblhyphen}
+\pkgs{textcomp}\command{\textdblhyphenchar}
+\command{\textasteriskcentered}
+\command{\textperiodcentered}
+\command{\textquestiondown}
+\pkgs{textcomp}\command{\textinterrobang}
+\pkgs{textcomp}\command{\textinterrobangdown}
+\command{\textexclamdown}
+
+\pkgs{textcomp}\command{\texttwelveudash}
+\command{\textemdash}
+\command{\textendash}
+\pkgs{textcomp}\command{\textthreequartersemdash}
+\command{\textvisiblespace}
+\command{\_}
+
+\pkgs{textcomp}\command{\textcurrency}
+\pkgs{textcomp}\command{\textbaht}
+\pkgs{textcomp}\command{\textguarani}
+\pkgs{textcomp}\command{\textwon}
+\pkgs{textcomp}\command{\textcent}
+\pkgs{textcomp}\command{\textcentoldstyle}
+\command{\textdollar}
+\pkgs{textcomp}\command{\textdollaroldstyle}
+\pkgs{textcomp}\command{\textlira}
+\pkgs{textcomp}\command{\textyen}
+\pkgs{textcomp}\command{\textdong}
+\pkgs{textcomp}\command{\textnaira}
+\pkgs{textcomp}\command{\textcolonmonetary}
+\pkgs{textcomp}\command{\textpeso}
+\command{\pounds}
+\pkgs{textcomp}\command{\textflorin}
+\pkgs{textcomp}\command{\texteuro}
+
+\begin{neededpkgs}{eurosym}
+\command{\geneuro}
+\command{\geneuronarrow}
+\command{\geneurowide}
+\command{\officialeuro}
+\end{neededpkgs}
+
+\command{\textcircled{a}}
+\command{\textcopyright}
+\pkgs{textcomp}\command{\textcopyleft}
+\command{\textregistered}
+\command{\texttrademark}
+\pkgs{textcomp}\command{\textservicemark}
+% \cc dvipng chokes here
+% \ccby
+% \ccnc
+% \ccnd
+% \ccsa
+
+\command{\oldstylenums{0}}
+\command{\oldstylenums{1}}
+\command{\oldstylenums{2}}
+\command{\oldstylenums{3}}
+\command{\oldstylenums{4}}
+\command{\oldstylenums{5}}
+\command{\oldstylenums{6}}
+\command{\oldstylenums{7}}
+\command{\oldstylenums{8}}
+\command{\oldstylenums{9}}
+%
+\begin{neededpkgs}{textcomp}
+%
+\command{\textonehalf}
+\command{\textonequarter}
+\command{\textthreequarters}
+%
+\command{\textonesuperior}
+\command{\texttwosuperior}
+\command{\textthreesuperior}
+%
+\command{\textnumero}
+%
+\command{\textpertenthousand}
+\command{\textperthousand}
+%
+\command{\textdiscount}
+\command{\textblank}
+\command{\textrecipe}
+\command{\textestimated}
+\command{\textreferencemark}
+\command{\textmusicalnote}
+%
+\end{neededpkgs}
+%
+\command{\dag}
+\command{\ddag}
+\command{\S}
+\command{\$}
+\pkgs{textcomp}\command{\textpilcrow}
+%
+\begin{neededpkgs}{marvosym}
+\command{\Cutleft}
+\command{\Cutright}
+\command{\Leftscissors}
+\command{\Cutline}
+\command{\Kutline}
+\command{\Rightscissors}
+\end{neededpkgs}
+%
+\begin{neededpkgs}{wasysym}
+\command{\CheckedBox}
+\command{\Square}
+\command{\XBox}
+\end{neededpkgs}
+%
+\pkgs{textcomp} \command{\textbigcircle}
+\pkgs{textcomp} \command{\textopenbullet}
+\command{\textbullet}
+\pkgs{amssymb}\command{\checkmark}
+\pkgs{amssymb}\command{\maltese}
+
+% \textcapitalcompwordmark currently not working due to missing glyps (april 5 2008) with texlive-full version 2005
+% \textascendercompwordmark ""
+\begin{neededpkgs}{textcomp}
+\command{\textordmasculine}
+\command{\textordfeminine}
+\command{\textborn}
+\command{\textdivorced}
+\command{\textdied}
+\command{\textmarried}
+\command{\textleaf}
+
+\command{\textcelsius}
+\command{\textdegree}
+\command{\textmho}
+\command{\textohm}
+\end{neededpkgs}
+
+\command{\textbackslash}
+\command{\textbar}
+\pkgs{textcomp} \command{\textbrokenbar}
+\command{\textbardbl}
+%
+\begin{neededpkgs}{textcomp}
+\command{\textfractionsolidus}
+\command{\textlangle}
+\command{\textlnot}
+\command{\textminus}
+\command{\textrangle}
+\command{\textlbrackdbl}
+\command{\textrbrackdbl}
+\command{\textmu}
+\command{\textpm}
+\command{\textlquill}
+\command{\textrquill}
+\end{neededpkgs}
+%
+\command{\textless}
+\command{\textgreater}
+%
+\begin{neededpkgs}{textcomp}
+\command{\textsurd}
+\command{\texttimes}
+\command{\textdiv}
+\end{neededpkgs}
+%
+\end{document}
diff --git a/src/kile/symbols/misc-text/CMakeLists.txt b/src/kile/symbols/misc-text/CMakeLists.txt
new file mode 100644
index 0000000..e9a0f3d
--- /dev/null
+++ b/src/kile/symbols/misc-text/CMakeLists.txt
@@ -0,0 +1,142 @@
+
+########### install files ###############
+
+SET( symbols
+ img001misc-text.png
+ img002misc-text.png
+ img003misc-text.png
+ img004misc-text.png
+ img005misc-text.png
+ img006misc-text.png
+ img007misc-text.png
+ img008misc-text.png
+ img009misc-text.png
+ img010misc-text.png
+ img011misc-text.png
+ img012misc-text.png
+ img013misc-text.png
+ img014misc-text.png
+ img015misc-text.png
+ img016misc-text.png
+ img017misc-text.png
+ img018misc-text.png
+ img019misc-text.png
+ img020misc-text.png
+ img021misc-text.png
+ img022misc-text.png
+ img023misc-text.png
+ img024misc-text.png
+ img025misc-text.png
+ img026misc-text.png
+ img027misc-text.png
+ img028misc-text.png
+ img029misc-text.png
+ img030misc-text.png
+ img031misc-text.png
+ img032misc-text.png
+ img033misc-text.png
+ img034misc-text.png
+ img035misc-text.png
+ img036misc-text.png
+ img037misc-text.png
+ img038misc-text.png
+ img039misc-text.png
+ img040misc-text.png
+ img041misc-text.png
+ img042misc-text.png
+ img043misc-text.png
+ img044misc-text.png
+ img045misc-text.png
+ img046misc-text.png
+ img047misc-text.png
+ img048misc-text.png
+ img049misc-text.png
+ img050misc-text.png
+ img051misc-text.png
+ img052misc-text.png
+ img053misc-text.png
+ img054misc-text.png
+ img055misc-text.png
+ img056misc-text.png
+ img057misc-text.png
+ img058misc-text.png
+ img059misc-text.png
+ img060misc-text.png
+ img061misc-text.png
+ img062misc-text.png
+ img063misc-text.png
+ img064misc-text.png
+ img065misc-text.png
+ img066misc-text.png
+ img067misc-text.png
+ img068misc-text.png
+ img069misc-text.png
+ img070misc-text.png
+ img071misc-text.png
+ img072misc-text.png
+ img073misc-text.png
+ img074misc-text.png
+ img075misc-text.png
+ img076misc-text.png
+ img077misc-text.png
+ img078misc-text.png
+ img079misc-text.png
+ img080misc-text.png
+ img081misc-text.png
+ img082misc-text.png
+ img083misc-text.png
+ img084misc-text.png
+ img085misc-text.png
+ img086misc-text.png
+ img087misc-text.png
+ img088misc-text.png
+ img089misc-text.png
+ img090misc-text.png
+ img091misc-text.png
+ img092misc-text.png
+ img093misc-text.png
+ img094misc-text.png
+ img095misc-text.png
+ img096misc-text.png
+ img097misc-text.png
+ img098misc-text.png
+ img099misc-text.png
+ img100misc-text.png
+ img101misc-text.png
+ img102misc-text.png
+ img103misc-text.png
+ img104misc-text.png
+ img105misc-text.png
+ img106misc-text.png
+ img107misc-text.png
+ img108misc-text.png
+ img109misc-text.png
+ img110misc-text.png
+ img111misc-text.png
+ img112misc-text.png
+ img113misc-text.png
+ img114misc-text.png
+ img115misc-text.png
+ img116misc-text.png
+ img117misc-text.png
+ img118misc-text.png
+ img119misc-text.png
+ img120misc-text.png
+ img121misc-text.png
+ img122misc-text.png
+ img123misc-text.png
+ img124misc-text.png
+ img125misc-text.png
+ img126misc-text.png
+ img127misc-text.png
+ img128misc-text.png
+ img129misc-text.png
+ img130misc-text.png
+ img131misc-text.png
+ img132misc-text.png
+ img133misc-text.png
+ img134misc-text.png
+ img135misc-text.png
+)
+
+INSTALL( FILES ${symbols} DESTINATION share/apps/kile/mathsymbols/misc-text )
diff --git a/src/kile/symbols/misc-text/Makefile.am b/src/kile/symbols/misc-text/Makefile.am
new file mode 100644
index 0000000..8f34f4b
--- /dev/null
+++ b/src/kile/symbols/misc-text/Makefile.am
@@ -0,0 +1,137 @@
+picsdir = $(kde_datadir)/kile/mathsymbols/misc-text
+
+pics_DATA = img001misc-text.png \
+ img002misc-text.png \
+ img003misc-text.png \
+ img004misc-text.png \
+ img005misc-text.png \
+ img006misc-text.png \
+ img007misc-text.png \
+ img008misc-text.png \
+ img009misc-text.png \
+ img010misc-text.png \
+ img011misc-text.png \
+ img012misc-text.png \
+ img013misc-text.png \
+ img014misc-text.png \
+ img015misc-text.png \
+ img016misc-text.png \
+ img017misc-text.png \
+ img018misc-text.png \
+ img019misc-text.png \
+ img020misc-text.png \
+ img021misc-text.png \
+ img022misc-text.png \
+ img023misc-text.png \
+ img024misc-text.png \
+ img025misc-text.png \
+ img026misc-text.png \
+ img027misc-text.png \
+ img028misc-text.png \
+ img029misc-text.png \
+ img030misc-text.png \
+ img031misc-text.png \
+ img032misc-text.png \
+ img033misc-text.png \
+ img034misc-text.png \
+ img035misc-text.png \
+ img036misc-text.png \
+ img037misc-text.png \
+ img038misc-text.png \
+ img039misc-text.png \
+ img040misc-text.png \
+ img041misc-text.png \
+ img042misc-text.png \
+ img043misc-text.png \
+ img044misc-text.png \
+ img045misc-text.png \
+ img046misc-text.png \
+ img047misc-text.png \
+ img048misc-text.png \
+ img049misc-text.png \
+ img050misc-text.png \
+ img051misc-text.png \
+ img052misc-text.png \
+ img053misc-text.png \
+ img054misc-text.png \
+ img055misc-text.png \
+ img056misc-text.png \
+ img057misc-text.png \
+ img058misc-text.png \
+ img059misc-text.png \
+ img060misc-text.png \
+ img061misc-text.png \
+ img062misc-text.png \
+ img063misc-text.png \
+ img064misc-text.png \
+ img065misc-text.png \
+ img066misc-text.png \
+ img067misc-text.png \
+ img068misc-text.png \
+ img069misc-text.png \
+ img070misc-text.png \
+ img071misc-text.png \
+ img072misc-text.png \
+ img073misc-text.png \
+ img074misc-text.png \
+ img075misc-text.png \
+ img076misc-text.png \
+ img077misc-text.png \
+ img078misc-text.png \
+ img079misc-text.png \
+ img080misc-text.png \
+ img081misc-text.png \
+ img082misc-text.png \
+ img083misc-text.png \
+ img084misc-text.png \
+ img085misc-text.png \
+ img086misc-text.png \
+ img087misc-text.png \
+ img088misc-text.png \
+ img089misc-text.png \
+ img090misc-text.png \
+ img091misc-text.png \
+ img092misc-text.png \
+ img093misc-text.png \
+ img094misc-text.png \
+ img095misc-text.png \
+ img096misc-text.png \
+ img097misc-text.png \
+ img098misc-text.png \
+ img099misc-text.png \
+ img100misc-text.png \
+ img101misc-text.png \
+ img102misc-text.png \
+ img103misc-text.png \
+ img104misc-text.png \
+ img105misc-text.png \
+ img106misc-text.png \
+ img107misc-text.png \
+ img108misc-text.png \
+ img109misc-text.png \
+ img110misc-text.png \
+ img111misc-text.png \
+ img112misc-text.png \
+ img113misc-text.png \
+ img114misc-text.png \
+ img115misc-text.png \
+ img116misc-text.png \
+ img117misc-text.png \
+ img118misc-text.png \
+ img119misc-text.png \
+ img120misc-text.png \
+ img121misc-text.png \
+ img122misc-text.png \
+ img123misc-text.png \
+ img124misc-text.png \
+ img125misc-text.png \
+ img126misc-text.png \
+ img127misc-text.png \
+ img128misc-text.png \
+ img129misc-text.png \
+ img130misc-text.png \
+ img131misc-text.png \
+ img132misc-text.png \
+ img133misc-text.png \
+ img134misc-text.png \
+ img135misc-text.png
diff --git a/src/kile/symbols/misc-text/img001misc-text.png b/src/kile/symbols/misc-text/img001misc-text.png
new file mode 100644
index 0000000..fde3edb
--- /dev/null
+++ b/src/kile/symbols/misc-text/img001misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img002misc-text.png b/src/kile/symbols/misc-text/img002misc-text.png
new file mode 100644
index 0000000..a4c1bae
--- /dev/null
+++ b/src/kile/symbols/misc-text/img002misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img003misc-text.png b/src/kile/symbols/misc-text/img003misc-text.png
new file mode 100644
index 0000000..e42f33c
--- /dev/null
+++ b/src/kile/symbols/misc-text/img003misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img004misc-text.png b/src/kile/symbols/misc-text/img004misc-text.png
new file mode 100644
index 0000000..191fcf5
--- /dev/null
+++ b/src/kile/symbols/misc-text/img004misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img005misc-text.png b/src/kile/symbols/misc-text/img005misc-text.png
new file mode 100644
index 0000000..6656897
--- /dev/null
+++ b/src/kile/symbols/misc-text/img005misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img006misc-text.png b/src/kile/symbols/misc-text/img006misc-text.png
new file mode 100644
index 0000000..1a54c7b
--- /dev/null
+++ b/src/kile/symbols/misc-text/img006misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img007misc-text.png b/src/kile/symbols/misc-text/img007misc-text.png
new file mode 100644
index 0000000..6fd6b09
--- /dev/null
+++ b/src/kile/symbols/misc-text/img007misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img008misc-text.png b/src/kile/symbols/misc-text/img008misc-text.png
new file mode 100644
index 0000000..4ac0668
--- /dev/null
+++ b/src/kile/symbols/misc-text/img008misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img009misc-text.png b/src/kile/symbols/misc-text/img009misc-text.png
new file mode 100644
index 0000000..359db9d
--- /dev/null
+++ b/src/kile/symbols/misc-text/img009misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img010misc-text.png b/src/kile/symbols/misc-text/img010misc-text.png
new file mode 100644
index 0000000..5934a77
--- /dev/null
+++ b/src/kile/symbols/misc-text/img010misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img011misc-text.png b/src/kile/symbols/misc-text/img011misc-text.png
new file mode 100644
index 0000000..142f189
--- /dev/null
+++ b/src/kile/symbols/misc-text/img011misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img012misc-text.png b/src/kile/symbols/misc-text/img012misc-text.png
new file mode 100644
index 0000000..c484b60
--- /dev/null
+++ b/src/kile/symbols/misc-text/img012misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img013misc-text.png b/src/kile/symbols/misc-text/img013misc-text.png
new file mode 100644
index 0000000..c75526c
--- /dev/null
+++ b/src/kile/symbols/misc-text/img013misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img014misc-text.png b/src/kile/symbols/misc-text/img014misc-text.png
new file mode 100644
index 0000000..fce4b51
--- /dev/null
+++ b/src/kile/symbols/misc-text/img014misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img015misc-text.png b/src/kile/symbols/misc-text/img015misc-text.png
new file mode 100644
index 0000000..f129a4e
--- /dev/null
+++ b/src/kile/symbols/misc-text/img015misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img016misc-text.png b/src/kile/symbols/misc-text/img016misc-text.png
new file mode 100644
index 0000000..9c02952
--- /dev/null
+++ b/src/kile/symbols/misc-text/img016misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img017misc-text.png b/src/kile/symbols/misc-text/img017misc-text.png
new file mode 100644
index 0000000..2c1fb51
--- /dev/null
+++ b/src/kile/symbols/misc-text/img017misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img018misc-text.png b/src/kile/symbols/misc-text/img018misc-text.png
new file mode 100644
index 0000000..98f0267
--- /dev/null
+++ b/src/kile/symbols/misc-text/img018misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img019misc-text.png b/src/kile/symbols/misc-text/img019misc-text.png
new file mode 100644
index 0000000..f33baf7
--- /dev/null
+++ b/src/kile/symbols/misc-text/img019misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img020misc-text.png b/src/kile/symbols/misc-text/img020misc-text.png
new file mode 100644
index 0000000..be91113
--- /dev/null
+++ b/src/kile/symbols/misc-text/img020misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img021misc-text.png b/src/kile/symbols/misc-text/img021misc-text.png
new file mode 100644
index 0000000..225d038
--- /dev/null
+++ b/src/kile/symbols/misc-text/img021misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img022misc-text.png b/src/kile/symbols/misc-text/img022misc-text.png
new file mode 100644
index 0000000..3039c97
--- /dev/null
+++ b/src/kile/symbols/misc-text/img022misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img023misc-text.png b/src/kile/symbols/misc-text/img023misc-text.png
new file mode 100644
index 0000000..70487b9
--- /dev/null
+++ b/src/kile/symbols/misc-text/img023misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img024misc-text.png b/src/kile/symbols/misc-text/img024misc-text.png
new file mode 100644
index 0000000..018e526
--- /dev/null
+++ b/src/kile/symbols/misc-text/img024misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img025misc-text.png b/src/kile/symbols/misc-text/img025misc-text.png
new file mode 100644
index 0000000..671acf9
--- /dev/null
+++ b/src/kile/symbols/misc-text/img025misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img026misc-text.png b/src/kile/symbols/misc-text/img026misc-text.png
new file mode 100644
index 0000000..64cfaa9
--- /dev/null
+++ b/src/kile/symbols/misc-text/img026misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img027misc-text.png b/src/kile/symbols/misc-text/img027misc-text.png
new file mode 100644
index 0000000..24e0373
--- /dev/null
+++ b/src/kile/symbols/misc-text/img027misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img028misc-text.png b/src/kile/symbols/misc-text/img028misc-text.png
new file mode 100644
index 0000000..1b6ef07
--- /dev/null
+++ b/src/kile/symbols/misc-text/img028misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img029misc-text.png b/src/kile/symbols/misc-text/img029misc-text.png
new file mode 100644
index 0000000..c778c21
--- /dev/null
+++ b/src/kile/symbols/misc-text/img029misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img030misc-text.png b/src/kile/symbols/misc-text/img030misc-text.png
new file mode 100644
index 0000000..85b1e5c
--- /dev/null
+++ b/src/kile/symbols/misc-text/img030misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img031misc-text.png b/src/kile/symbols/misc-text/img031misc-text.png
new file mode 100644
index 0000000..048f924
--- /dev/null
+++ b/src/kile/symbols/misc-text/img031misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img032misc-text.png b/src/kile/symbols/misc-text/img032misc-text.png
new file mode 100644
index 0000000..c4593c5
--- /dev/null
+++ b/src/kile/symbols/misc-text/img032misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img033misc-text.png b/src/kile/symbols/misc-text/img033misc-text.png
new file mode 100644
index 0000000..dcf9d21
--- /dev/null
+++ b/src/kile/symbols/misc-text/img033misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img034misc-text.png b/src/kile/symbols/misc-text/img034misc-text.png
new file mode 100644
index 0000000..c0c8494
--- /dev/null
+++ b/src/kile/symbols/misc-text/img034misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img035misc-text.png b/src/kile/symbols/misc-text/img035misc-text.png
new file mode 100644
index 0000000..cd714a4
--- /dev/null
+++ b/src/kile/symbols/misc-text/img035misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img036misc-text.png b/src/kile/symbols/misc-text/img036misc-text.png
new file mode 100644
index 0000000..57a4590
--- /dev/null
+++ b/src/kile/symbols/misc-text/img036misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img037misc-text.png b/src/kile/symbols/misc-text/img037misc-text.png
new file mode 100644
index 0000000..d80b275
--- /dev/null
+++ b/src/kile/symbols/misc-text/img037misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img038misc-text.png b/src/kile/symbols/misc-text/img038misc-text.png
new file mode 100644
index 0000000..d57a197
--- /dev/null
+++ b/src/kile/symbols/misc-text/img038misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img039misc-text.png b/src/kile/symbols/misc-text/img039misc-text.png
new file mode 100644
index 0000000..17a3fb3
--- /dev/null
+++ b/src/kile/symbols/misc-text/img039misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img040misc-text.png b/src/kile/symbols/misc-text/img040misc-text.png
new file mode 100644
index 0000000..30736a8
--- /dev/null
+++ b/src/kile/symbols/misc-text/img040misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img041misc-text.png b/src/kile/symbols/misc-text/img041misc-text.png
new file mode 100644
index 0000000..3851e82
--- /dev/null
+++ b/src/kile/symbols/misc-text/img041misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img042misc-text.png b/src/kile/symbols/misc-text/img042misc-text.png
new file mode 100644
index 0000000..01185cb
--- /dev/null
+++ b/src/kile/symbols/misc-text/img042misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img043misc-text.png b/src/kile/symbols/misc-text/img043misc-text.png
new file mode 100644
index 0000000..013cdbe
--- /dev/null
+++ b/src/kile/symbols/misc-text/img043misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img044misc-text.png b/src/kile/symbols/misc-text/img044misc-text.png
new file mode 100644
index 0000000..8abca15
--- /dev/null
+++ b/src/kile/symbols/misc-text/img044misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img045misc-text.png b/src/kile/symbols/misc-text/img045misc-text.png
new file mode 100644
index 0000000..31eb91b
--- /dev/null
+++ b/src/kile/symbols/misc-text/img045misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img046misc-text.png b/src/kile/symbols/misc-text/img046misc-text.png
new file mode 100644
index 0000000..28288b2
--- /dev/null
+++ b/src/kile/symbols/misc-text/img046misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img047misc-text.png b/src/kile/symbols/misc-text/img047misc-text.png
new file mode 100644
index 0000000..f303605
--- /dev/null
+++ b/src/kile/symbols/misc-text/img047misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img048misc-text.png b/src/kile/symbols/misc-text/img048misc-text.png
new file mode 100644
index 0000000..21a119f
--- /dev/null
+++ b/src/kile/symbols/misc-text/img048misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img049misc-text.png b/src/kile/symbols/misc-text/img049misc-text.png
new file mode 100644
index 0000000..8d98d5f
--- /dev/null
+++ b/src/kile/symbols/misc-text/img049misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img050misc-text.png b/src/kile/symbols/misc-text/img050misc-text.png
new file mode 100644
index 0000000..dc4b463
--- /dev/null
+++ b/src/kile/symbols/misc-text/img050misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img051misc-text.png b/src/kile/symbols/misc-text/img051misc-text.png
new file mode 100644
index 0000000..c571cfa
--- /dev/null
+++ b/src/kile/symbols/misc-text/img051misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img052misc-text.png b/src/kile/symbols/misc-text/img052misc-text.png
new file mode 100644
index 0000000..8c51f1d
--- /dev/null
+++ b/src/kile/symbols/misc-text/img052misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img053misc-text.png b/src/kile/symbols/misc-text/img053misc-text.png
new file mode 100644
index 0000000..8ba2361
--- /dev/null
+++ b/src/kile/symbols/misc-text/img053misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img054misc-text.png b/src/kile/symbols/misc-text/img054misc-text.png
new file mode 100644
index 0000000..757d312
--- /dev/null
+++ b/src/kile/symbols/misc-text/img054misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img055misc-text.png b/src/kile/symbols/misc-text/img055misc-text.png
new file mode 100644
index 0000000..ef63db5
--- /dev/null
+++ b/src/kile/symbols/misc-text/img055misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img056misc-text.png b/src/kile/symbols/misc-text/img056misc-text.png
new file mode 100644
index 0000000..f2f9524
--- /dev/null
+++ b/src/kile/symbols/misc-text/img056misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img057misc-text.png b/src/kile/symbols/misc-text/img057misc-text.png
new file mode 100644
index 0000000..32712a0
--- /dev/null
+++ b/src/kile/symbols/misc-text/img057misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img058misc-text.png b/src/kile/symbols/misc-text/img058misc-text.png
new file mode 100644
index 0000000..7754363
--- /dev/null
+++ b/src/kile/symbols/misc-text/img058misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img059misc-text.png b/src/kile/symbols/misc-text/img059misc-text.png
new file mode 100644
index 0000000..5b4ccfd
--- /dev/null
+++ b/src/kile/symbols/misc-text/img059misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img060misc-text.png b/src/kile/symbols/misc-text/img060misc-text.png
new file mode 100644
index 0000000..5f899fe
--- /dev/null
+++ b/src/kile/symbols/misc-text/img060misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img061misc-text.png b/src/kile/symbols/misc-text/img061misc-text.png
new file mode 100644
index 0000000..c952800
--- /dev/null
+++ b/src/kile/symbols/misc-text/img061misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img062misc-text.png b/src/kile/symbols/misc-text/img062misc-text.png
new file mode 100644
index 0000000..35dd072
--- /dev/null
+++ b/src/kile/symbols/misc-text/img062misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img063misc-text.png b/src/kile/symbols/misc-text/img063misc-text.png
new file mode 100644
index 0000000..6438d8d
--- /dev/null
+++ b/src/kile/symbols/misc-text/img063misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img064misc-text.png b/src/kile/symbols/misc-text/img064misc-text.png
new file mode 100644
index 0000000..767c80b
--- /dev/null
+++ b/src/kile/symbols/misc-text/img064misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img065misc-text.png b/src/kile/symbols/misc-text/img065misc-text.png
new file mode 100644
index 0000000..bc17545
--- /dev/null
+++ b/src/kile/symbols/misc-text/img065misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img066misc-text.png b/src/kile/symbols/misc-text/img066misc-text.png
new file mode 100644
index 0000000..6e2392a
--- /dev/null
+++ b/src/kile/symbols/misc-text/img066misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img067misc-text.png b/src/kile/symbols/misc-text/img067misc-text.png
new file mode 100644
index 0000000..9b9e9ff
--- /dev/null
+++ b/src/kile/symbols/misc-text/img067misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img068misc-text.png b/src/kile/symbols/misc-text/img068misc-text.png
new file mode 100644
index 0000000..5b08bac
--- /dev/null
+++ b/src/kile/symbols/misc-text/img068misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img069misc-text.png b/src/kile/symbols/misc-text/img069misc-text.png
new file mode 100644
index 0000000..c2081d3
--- /dev/null
+++ b/src/kile/symbols/misc-text/img069misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img070misc-text.png b/src/kile/symbols/misc-text/img070misc-text.png
new file mode 100644
index 0000000..8d23b23
--- /dev/null
+++ b/src/kile/symbols/misc-text/img070misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img071misc-text.png b/src/kile/symbols/misc-text/img071misc-text.png
new file mode 100644
index 0000000..01b631f
--- /dev/null
+++ b/src/kile/symbols/misc-text/img071misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img072misc-text.png b/src/kile/symbols/misc-text/img072misc-text.png
new file mode 100644
index 0000000..b2ea041
--- /dev/null
+++ b/src/kile/symbols/misc-text/img072misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img073misc-text.png b/src/kile/symbols/misc-text/img073misc-text.png
new file mode 100644
index 0000000..bc227ab
--- /dev/null
+++ b/src/kile/symbols/misc-text/img073misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img074misc-text.png b/src/kile/symbols/misc-text/img074misc-text.png
new file mode 100644
index 0000000..64381e6
--- /dev/null
+++ b/src/kile/symbols/misc-text/img074misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img075misc-text.png b/src/kile/symbols/misc-text/img075misc-text.png
new file mode 100644
index 0000000..b6a9bce
--- /dev/null
+++ b/src/kile/symbols/misc-text/img075misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img076misc-text.png b/src/kile/symbols/misc-text/img076misc-text.png
new file mode 100644
index 0000000..abd1070
--- /dev/null
+++ b/src/kile/symbols/misc-text/img076misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img077misc-text.png b/src/kile/symbols/misc-text/img077misc-text.png
new file mode 100644
index 0000000..6fb3dca
--- /dev/null
+++ b/src/kile/symbols/misc-text/img077misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img078misc-text.png b/src/kile/symbols/misc-text/img078misc-text.png
new file mode 100644
index 0000000..6d703ea
--- /dev/null
+++ b/src/kile/symbols/misc-text/img078misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img079misc-text.png b/src/kile/symbols/misc-text/img079misc-text.png
new file mode 100644
index 0000000..d6c2176
--- /dev/null
+++ b/src/kile/symbols/misc-text/img079misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img080misc-text.png b/src/kile/symbols/misc-text/img080misc-text.png
new file mode 100644
index 0000000..37afd00
--- /dev/null
+++ b/src/kile/symbols/misc-text/img080misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img081misc-text.png b/src/kile/symbols/misc-text/img081misc-text.png
new file mode 100644
index 0000000..b308ca0
--- /dev/null
+++ b/src/kile/symbols/misc-text/img081misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img082misc-text.png b/src/kile/symbols/misc-text/img082misc-text.png
new file mode 100644
index 0000000..2ea30de
--- /dev/null
+++ b/src/kile/symbols/misc-text/img082misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img083misc-text.png b/src/kile/symbols/misc-text/img083misc-text.png
new file mode 100644
index 0000000..19b1d7e
--- /dev/null
+++ b/src/kile/symbols/misc-text/img083misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img084misc-text.png b/src/kile/symbols/misc-text/img084misc-text.png
new file mode 100644
index 0000000..8f6bc46
--- /dev/null
+++ b/src/kile/symbols/misc-text/img084misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img085misc-text.png b/src/kile/symbols/misc-text/img085misc-text.png
new file mode 100644
index 0000000..4c28303
--- /dev/null
+++ b/src/kile/symbols/misc-text/img085misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img086misc-text.png b/src/kile/symbols/misc-text/img086misc-text.png
new file mode 100644
index 0000000..5db8c0e
--- /dev/null
+++ b/src/kile/symbols/misc-text/img086misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img087misc-text.png b/src/kile/symbols/misc-text/img087misc-text.png
new file mode 100644
index 0000000..29beecd
--- /dev/null
+++ b/src/kile/symbols/misc-text/img087misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img088misc-text.png b/src/kile/symbols/misc-text/img088misc-text.png
new file mode 100644
index 0000000..23da988
--- /dev/null
+++ b/src/kile/symbols/misc-text/img088misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img089misc-text.png b/src/kile/symbols/misc-text/img089misc-text.png
new file mode 100644
index 0000000..558a23e
--- /dev/null
+++ b/src/kile/symbols/misc-text/img089misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img090misc-text.png b/src/kile/symbols/misc-text/img090misc-text.png
new file mode 100644
index 0000000..78bce22
--- /dev/null
+++ b/src/kile/symbols/misc-text/img090misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img091misc-text.png b/src/kile/symbols/misc-text/img091misc-text.png
new file mode 100644
index 0000000..01889a2
--- /dev/null
+++ b/src/kile/symbols/misc-text/img091misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img092misc-text.png b/src/kile/symbols/misc-text/img092misc-text.png
new file mode 100644
index 0000000..49a6d0f
--- /dev/null
+++ b/src/kile/symbols/misc-text/img092misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img093misc-text.png b/src/kile/symbols/misc-text/img093misc-text.png
new file mode 100644
index 0000000..65557d9
--- /dev/null
+++ b/src/kile/symbols/misc-text/img093misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img094misc-text.png b/src/kile/symbols/misc-text/img094misc-text.png
new file mode 100644
index 0000000..4909ece
--- /dev/null
+++ b/src/kile/symbols/misc-text/img094misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img095misc-text.png b/src/kile/symbols/misc-text/img095misc-text.png
new file mode 100644
index 0000000..55bef81
--- /dev/null
+++ b/src/kile/symbols/misc-text/img095misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img096misc-text.png b/src/kile/symbols/misc-text/img096misc-text.png
new file mode 100644
index 0000000..b565291
--- /dev/null
+++ b/src/kile/symbols/misc-text/img096misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img097misc-text.png b/src/kile/symbols/misc-text/img097misc-text.png
new file mode 100644
index 0000000..ca8bf79
--- /dev/null
+++ b/src/kile/symbols/misc-text/img097misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img098misc-text.png b/src/kile/symbols/misc-text/img098misc-text.png
new file mode 100644
index 0000000..a45441c
--- /dev/null
+++ b/src/kile/symbols/misc-text/img098misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img099misc-text.png b/src/kile/symbols/misc-text/img099misc-text.png
new file mode 100644
index 0000000..8fefc00
--- /dev/null
+++ b/src/kile/symbols/misc-text/img099misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img100misc-text.png b/src/kile/symbols/misc-text/img100misc-text.png
new file mode 100644
index 0000000..b6509db
--- /dev/null
+++ b/src/kile/symbols/misc-text/img100misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img101misc-text.png b/src/kile/symbols/misc-text/img101misc-text.png
new file mode 100644
index 0000000..6a6405b
--- /dev/null
+++ b/src/kile/symbols/misc-text/img101misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img102misc-text.png b/src/kile/symbols/misc-text/img102misc-text.png
new file mode 100644
index 0000000..63c50b1
--- /dev/null
+++ b/src/kile/symbols/misc-text/img102misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img103misc-text.png b/src/kile/symbols/misc-text/img103misc-text.png
new file mode 100644
index 0000000..4f64007
--- /dev/null
+++ b/src/kile/symbols/misc-text/img103misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img104misc-text.png b/src/kile/symbols/misc-text/img104misc-text.png
new file mode 100644
index 0000000..5d849ed
--- /dev/null
+++ b/src/kile/symbols/misc-text/img104misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img105misc-text.png b/src/kile/symbols/misc-text/img105misc-text.png
new file mode 100644
index 0000000..cf9a7eb
--- /dev/null
+++ b/src/kile/symbols/misc-text/img105misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img106misc-text.png b/src/kile/symbols/misc-text/img106misc-text.png
new file mode 100644
index 0000000..1da485d
--- /dev/null
+++ b/src/kile/symbols/misc-text/img106misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img107misc-text.png b/src/kile/symbols/misc-text/img107misc-text.png
new file mode 100644
index 0000000..ce669fd
--- /dev/null
+++ b/src/kile/symbols/misc-text/img107misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img108misc-text.png b/src/kile/symbols/misc-text/img108misc-text.png
new file mode 100644
index 0000000..65329b6
--- /dev/null
+++ b/src/kile/symbols/misc-text/img108misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img109misc-text.png b/src/kile/symbols/misc-text/img109misc-text.png
new file mode 100644
index 0000000..4a8ef19
--- /dev/null
+++ b/src/kile/symbols/misc-text/img109misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img110misc-text.png b/src/kile/symbols/misc-text/img110misc-text.png
new file mode 100644
index 0000000..2158db1
--- /dev/null
+++ b/src/kile/symbols/misc-text/img110misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img111misc-text.png b/src/kile/symbols/misc-text/img111misc-text.png
new file mode 100644
index 0000000..367b784
--- /dev/null
+++ b/src/kile/symbols/misc-text/img111misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img112misc-text.png b/src/kile/symbols/misc-text/img112misc-text.png
new file mode 100644
index 0000000..6d96d69
--- /dev/null
+++ b/src/kile/symbols/misc-text/img112misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img113misc-text.png b/src/kile/symbols/misc-text/img113misc-text.png
new file mode 100644
index 0000000..0e761f8
--- /dev/null
+++ b/src/kile/symbols/misc-text/img113misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img114misc-text.png b/src/kile/symbols/misc-text/img114misc-text.png
new file mode 100644
index 0000000..ebad725
--- /dev/null
+++ b/src/kile/symbols/misc-text/img114misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img115misc-text.png b/src/kile/symbols/misc-text/img115misc-text.png
new file mode 100644
index 0000000..a88878c
--- /dev/null
+++ b/src/kile/symbols/misc-text/img115misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img116misc-text.png b/src/kile/symbols/misc-text/img116misc-text.png
new file mode 100644
index 0000000..129fbcc
--- /dev/null
+++ b/src/kile/symbols/misc-text/img116misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img117misc-text.png b/src/kile/symbols/misc-text/img117misc-text.png
new file mode 100644
index 0000000..3440926
--- /dev/null
+++ b/src/kile/symbols/misc-text/img117misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img118misc-text.png b/src/kile/symbols/misc-text/img118misc-text.png
new file mode 100644
index 0000000..da78deb
--- /dev/null
+++ b/src/kile/symbols/misc-text/img118misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img119misc-text.png b/src/kile/symbols/misc-text/img119misc-text.png
new file mode 100644
index 0000000..65d0117
--- /dev/null
+++ b/src/kile/symbols/misc-text/img119misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img120misc-text.png b/src/kile/symbols/misc-text/img120misc-text.png
new file mode 100644
index 0000000..0dc15a2
--- /dev/null
+++ b/src/kile/symbols/misc-text/img120misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img121misc-text.png b/src/kile/symbols/misc-text/img121misc-text.png
new file mode 100644
index 0000000..fe27acc
--- /dev/null
+++ b/src/kile/symbols/misc-text/img121misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img122misc-text.png b/src/kile/symbols/misc-text/img122misc-text.png
new file mode 100644
index 0000000..f7028cf
--- /dev/null
+++ b/src/kile/symbols/misc-text/img122misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img123misc-text.png b/src/kile/symbols/misc-text/img123misc-text.png
new file mode 100644
index 0000000..44516ae
--- /dev/null
+++ b/src/kile/symbols/misc-text/img123misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img124misc-text.png b/src/kile/symbols/misc-text/img124misc-text.png
new file mode 100644
index 0000000..aea8f14
--- /dev/null
+++ b/src/kile/symbols/misc-text/img124misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img125misc-text.png b/src/kile/symbols/misc-text/img125misc-text.png
new file mode 100644
index 0000000..95bbcd3
--- /dev/null
+++ b/src/kile/symbols/misc-text/img125misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img126misc-text.png b/src/kile/symbols/misc-text/img126misc-text.png
new file mode 100644
index 0000000..00b010e
--- /dev/null
+++ b/src/kile/symbols/misc-text/img126misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img127misc-text.png b/src/kile/symbols/misc-text/img127misc-text.png
new file mode 100644
index 0000000..b28ae40
--- /dev/null
+++ b/src/kile/symbols/misc-text/img127misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img128misc-text.png b/src/kile/symbols/misc-text/img128misc-text.png
new file mode 100644
index 0000000..ab2ce14
--- /dev/null
+++ b/src/kile/symbols/misc-text/img128misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img129misc-text.png b/src/kile/symbols/misc-text/img129misc-text.png
new file mode 100644
index 0000000..0c19698
--- /dev/null
+++ b/src/kile/symbols/misc-text/img129misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img130misc-text.png b/src/kile/symbols/misc-text/img130misc-text.png
new file mode 100644
index 0000000..e8288a4
--- /dev/null
+++ b/src/kile/symbols/misc-text/img130misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img131misc-text.png b/src/kile/symbols/misc-text/img131misc-text.png
new file mode 100644
index 0000000..1c46096
--- /dev/null
+++ b/src/kile/symbols/misc-text/img131misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img132misc-text.png b/src/kile/symbols/misc-text/img132misc-text.png
new file mode 100644
index 0000000..a5ea98c
--- /dev/null
+++ b/src/kile/symbols/misc-text/img132misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img133misc-text.png b/src/kile/symbols/misc-text/img133misc-text.png
new file mode 100644
index 0000000..d5cf450
--- /dev/null
+++ b/src/kile/symbols/misc-text/img133misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img134misc-text.png b/src/kile/symbols/misc-text/img134misc-text.png
new file mode 100644
index 0000000..3a8a60a
--- /dev/null
+++ b/src/kile/symbols/misc-text/img134misc-text.png
Binary files differ
diff --git a/src/kile/symbols/misc-text/img135misc-text.png b/src/kile/symbols/misc-text/img135misc-text.png
new file mode 100644
index 0000000..8bb94b1
--- /dev/null
+++ b/src/kile/symbols/misc-text/img135misc-text.png
Binary files differ
diff --git a/src/kile/symbols/operators.tex b/src/kile/symbols/operators.tex
new file mode 100644
index 0000000..1531d20
--- /dev/null
+++ b/src/kile/symbols/operators.tex
@@ -0,0 +1,154 @@
+\documentclass[a4paper,10pt]{article}
+\usepackage{amsmath}
+\usepackage{amssymb}
+\usepackage[T1]{fontenc}
+\usepackage{color}
+
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Author: Thomas Braun
+% begin: Sun 9 april 2006
+% last edit: Mon 9 april 2007
+% License: GPLv2 or later
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\iffalse
+\newcommand{\begin{neededpkgs}}[2][]{}
+\newcommand{\pkgs}[2][]{}
+\fi
+
+\input{definitions}
+
+\begin{document}
+
+\mathcommand{\pm}
+\mathcommand{\mp}
+\mathcommand{\times}
+\mathcommand{\div}
+\mathcommand{\ast}
+\mathcommand{\star}
+\mathcommand{\circ}
+\mathcommand{\bullet}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\divideontimes}
+\mathcommand{\ltimes}
+\mathcommand{\rtimes}
+\end{neededpkgs}
+\mathcommand{\cdot}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\dotplus}
+\mathcommand{\leftthreetimes}
+\mathcommand{\rightthreetimes}
+\end{neededpkgs}
+\mathcommand{\amalg}
+\mathcommand{\otimes}
+\mathcommand{\oplus}
+\mathcommand{\ominus}
+\mathcommand{\oslash}
+\mathcommand{\odot}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\circledcirc}
+\mathcommand{\circleddash}
+\mathcommand{\circledast}
+\end{neededpkgs}
+\mathcommand{\bigcirc}
+\mathcommand{\boxdot}
+\mathcommand{\boxminus}
+\mathcommand{\boxplus}
+\mathcommand{\boxtimes}
+\mathcommand{\diamond}
+\mathcommand{\bigtriangleup}
+\mathcommand{\bigtriangledown}
+\mathcommand{\triangleleft}
+\mathcommand{\triangleright}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\lhd}
+\mathcommand{\rhd}
+\mathcommand{\unlhd}
+\mathcommand{\unrhd}
+\end{neededpkgs}
+\mathcommand{\cup}
+\mathcommand{\cap}
+\mathcommand{\uplus}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\Cup}
+\mathcommand{\Cap}
+\end{neededpkgs}
+\mathcommand{\wr}
+\mathcommand{\setminus}
+\pkgs{amssymb}\mathcommand{\smallsetminus}
+\mathcommand{\sqcap}
+\mathcommand{\sqcup}
+\mathcommand{\wedge}
+\mathcommand{\vee}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\barwedge}
+\mathcommand{\veebar}
+\mathcommand{\doublebarwedge}
+\mathcommand{\curlywedge}
+\mathcommand{\curlyvee}
+\mathcommand{\dagger}
+\mathcommand{\ddagger}
+\mathcommand{\intercal}
+\end{neededpkgs}
+\mathcommand{\bigcap}
+\mathcommand{\bigcup}
+\mathcommand{\biguplus}
+\mathcommand{\bigsqcup}
+\mathcommand{\prod}
+\mathcommand{\coprod}
+\mathcommand{\bigwedge}
+\mathcommand{\bigvee}
+\mathcommand{\bigodot}
+\mathcommand{\bigoplus}
+\mathcommand{\bigotimes}
+\mathcommand{\sum}
+\mathcommand{\int}
+\mathcommand{\oint}
+\begin{neededpkgs}{amsmath}
+\mathcommand{\iint}
+\mathcommand{\iiint}
+\mathcommand{\iiiint}
+\mathcommand{\idotsint}
+\end{neededpkgs}
+
+\mathcommand{\arccos}
+\mathcommand{\arcsin}
+\mathcommand{\arctan}
+\mathcommand{\arg}
+\mathcommand{\cos}
+\mathcommand{\cosh}
+\mathcommand{\cot}
+\mathcommand{\coth}
+\mathcommand{\csc}
+\mathcommand{\deg}
+\mathcommand{\det}
+\mathcommand{\dim}
+\mathcommand{\exp}
+\mathcommand{\gcd}
+\mathcommand{\hom}
+\mathcommand{\inf}
+\mathcommand{\ker}
+\mathcommand{\lg}
+\mathcommand{\lim}
+\mathcommand{\liminf}
+\mathcommand{\limsup}
+\mathcommand{\ln}
+\mathcommand{\log}
+\mathcommand{\max}
+\mathcommand{\min}
+\mathcommand{\Pr}
+\pkgs{amsmath}\mathcommand{\projlim}
+\mathcommand{\sec}
+\mathcommand{\sin}
+\mathcommand{\sinh}
+\mathcommand{\sup}
+\mathcommand{\tan}
+\mathcommand{\tanh}
+\begin{neededpkgs}{}
+\mathcommand{\varlimsup}
+\mathcommand{\varliminf}
+\mathcommand{\varinjlim}
+\mathcommand{\varprojlim}
+\end{neededpkgs}
+
+\end{document}
diff --git a/src/kile/symbols/operators/CMakeLists.txt b/src/kile/symbols/operators/CMakeLists.txt
new file mode 100644
index 0000000..589defe
--- /dev/null
+++ b/src/kile/symbols/operators/CMakeLists.txt
@@ -0,0 +1,120 @@
+
+########### install files ###############
+
+SET( symbols
+ img001operators.png
+ img002operators.png
+ img003operators.png
+ img004operators.png
+ img005operators.png
+ img006operators.png
+ img007operators.png
+ img008operators.png
+ img009operators.png
+ img010operators.png
+ img011operators.png
+ img012operators.png
+ img013operators.png
+ img014operators.png
+ img015operators.png
+ img016operators.png
+ img017operators.png
+ img018operators.png
+ img019operators.png
+ img020operators.png
+ img021operators.png
+ img022operators.png
+ img023operators.png
+ img024operators.png
+ img025operators.png
+ img026operators.png
+ img027operators.png
+ img028operators.png
+ img029operators.png
+ img030operators.png
+ img031operators.png
+ img032operators.png
+ img033operators.png
+ img034operators.png
+ img035operators.png
+ img036operators.png
+ img037operators.png
+ img038operators.png
+ img039operators.png
+ img040operators.png
+ img041operators.png
+ img042operators.png
+ img043operators.png
+ img044operators.png
+ img045operators.png
+ img046operators.png
+ img047operators.png
+ img048operators.png
+ img049operators.png
+ img050operators.png
+ img051operators.png
+ img052operators.png
+ img053operators.png
+ img054operators.png
+ img055operators.png
+ img056operators.png
+ img057operators.png
+ img058operators.png
+ img059operators.png
+ img060operators.png
+ img061operators.png
+ img062operators.png
+ img063operators.png
+ img064operators.png
+ img065operators.png
+ img066operators.png
+ img067operators.png
+ img068operators.png
+ img069operators.png
+ img070operators.png
+ img071operators.png
+ img072operators.png
+ img073operators.png
+ img074operators.png
+ img075operators.png
+ img076operators.png
+ img077operators.png
+ img078operators.png
+ img079operators.png
+ img080operators.png
+ img081operators.png
+ img082operators.png
+ img083operators.png
+ img084operators.png
+ img085operators.png
+ img086operators.png
+ img087operators.png
+ img088operators.png
+ img089operators.png
+ img090operators.png
+ img091operators.png
+ img092operators.png
+ img093operators.png
+ img094operators.png
+ img095operators.png
+ img096operators.png
+ img097operators.png
+ img098operators.png
+ img099operators.png
+ img100operators.png
+ img101operators.png
+ img102operators.png
+ img103operators.png
+ img104operators.png
+ img105operators.png
+ img106operators.png
+ img107operators.png
+ img108operators.png
+ img109operators.png
+ img110operators.png
+ img111operators.png
+ img112operators.png
+ img113operators.png
+)
+INSTALL( FILES ${symbols} DESTINATION share/apps/kile/mathsymbols/operators )
+
diff --git a/src/kile/symbols/operators/Makefile.am b/src/kile/symbols/operators/Makefile.am
new file mode 100644
index 0000000..661c588
--- /dev/null
+++ b/src/kile/symbols/operators/Makefile.am
@@ -0,0 +1,115 @@
+picsdir = $(kde_datadir)/kile/mathsymbols/operators
+
+pics_DATA = img001operators.png \
+ img002operators.png \
+ img003operators.png \
+ img004operators.png \
+ img005operators.png \
+ img006operators.png \
+ img007operators.png \
+ img008operators.png \
+ img009operators.png \
+ img010operators.png \
+ img011operators.png \
+ img012operators.png \
+ img013operators.png \
+ img014operators.png \
+ img015operators.png \
+ img016operators.png \
+ img017operators.png \
+ img018operators.png \
+ img019operators.png \
+ img020operators.png \
+ img021operators.png \
+ img022operators.png \
+ img023operators.png \
+ img024operators.png \
+ img025operators.png \
+ img026operators.png \
+ img027operators.png \
+ img028operators.png \
+ img029operators.png \
+ img030operators.png \
+ img031operators.png \
+ img032operators.png \
+ img033operators.png \
+ img034operators.png \
+ img035operators.png \
+ img036operators.png \
+ img037operators.png \
+ img038operators.png \
+ img039operators.png \
+ img040operators.png \
+ img041operators.png \
+ img042operators.png \
+ img043operators.png \
+ img044operators.png \
+ img045operators.png \
+ img046operators.png \
+ img047operators.png \
+ img048operators.png \
+ img049operators.png \
+ img050operators.png \
+ img051operators.png \
+ img052operators.png \
+ img053operators.png \
+ img054operators.png \
+ img055operators.png \
+ img056operators.png \
+ img057operators.png \
+ img058operators.png \
+ img059operators.png \
+ img060operators.png \
+ img061operators.png \
+ img062operators.png \
+ img063operators.png \
+ img064operators.png \
+ img065operators.png \
+ img066operators.png \
+ img067operators.png \
+ img068operators.png \
+ img069operators.png \
+ img070operators.png \
+ img071operators.png \
+ img072operators.png \
+ img073operators.png \
+ img074operators.png \
+ img075operators.png \
+ img076operators.png \
+ img077operators.png \
+ img078operators.png \
+ img079operators.png \
+ img080operators.png \
+ img081operators.png \
+ img082operators.png \
+ img083operators.png \
+ img084operators.png \
+ img085operators.png \
+ img086operators.png \
+ img087operators.png \
+ img088operators.png \
+ img089operators.png \
+ img090operators.png \
+ img091operators.png \
+ img092operators.png \
+ img093operators.png \
+ img094operators.png \
+ img095operators.png \
+ img096operators.png \
+ img097operators.png \
+ img098operators.png \
+ img099operators.png \
+ img100operators.png \
+ img101operators.png \
+ img102operators.png \
+ img103operators.png \
+ img104operators.png \
+ img105operators.png \
+ img106operators.png \
+ img107operators.png \
+ img108operators.png \
+ img109operators.png \
+ img110operators.png \
+ img111operators.png \
+ img112operators.png \
+ img113operators.png
diff --git a/src/kile/symbols/operators/img001operators.png b/src/kile/symbols/operators/img001operators.png
new file mode 100644
index 0000000..a562622
--- /dev/null
+++ b/src/kile/symbols/operators/img001operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img002operators.png b/src/kile/symbols/operators/img002operators.png
new file mode 100644
index 0000000..09d4cf7
--- /dev/null
+++ b/src/kile/symbols/operators/img002operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img003operators.png b/src/kile/symbols/operators/img003operators.png
new file mode 100644
index 0000000..a972768
--- /dev/null
+++ b/src/kile/symbols/operators/img003operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img004operators.png b/src/kile/symbols/operators/img004operators.png
new file mode 100644
index 0000000..2fccf98
--- /dev/null
+++ b/src/kile/symbols/operators/img004operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img005operators.png b/src/kile/symbols/operators/img005operators.png
new file mode 100644
index 0000000..a9a8a5f
--- /dev/null
+++ b/src/kile/symbols/operators/img005operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img006operators.png b/src/kile/symbols/operators/img006operators.png
new file mode 100644
index 0000000..cd2ae88
--- /dev/null
+++ b/src/kile/symbols/operators/img006operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img007operators.png b/src/kile/symbols/operators/img007operators.png
new file mode 100644
index 0000000..7e5a955
--- /dev/null
+++ b/src/kile/symbols/operators/img007operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img008operators.png b/src/kile/symbols/operators/img008operators.png
new file mode 100644
index 0000000..ab5c999
--- /dev/null
+++ b/src/kile/symbols/operators/img008operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img009operators.png b/src/kile/symbols/operators/img009operators.png
new file mode 100644
index 0000000..27017ac
--- /dev/null
+++ b/src/kile/symbols/operators/img009operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img010operators.png b/src/kile/symbols/operators/img010operators.png
new file mode 100644
index 0000000..7ee359f
--- /dev/null
+++ b/src/kile/symbols/operators/img010operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img011operators.png b/src/kile/symbols/operators/img011operators.png
new file mode 100644
index 0000000..21c55a3
--- /dev/null
+++ b/src/kile/symbols/operators/img011operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img012operators.png b/src/kile/symbols/operators/img012operators.png
new file mode 100644
index 0000000..9e3dbd1
--- /dev/null
+++ b/src/kile/symbols/operators/img012operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img013operators.png b/src/kile/symbols/operators/img013operators.png
new file mode 100644
index 0000000..8e3c876
--- /dev/null
+++ b/src/kile/symbols/operators/img013operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img014operators.png b/src/kile/symbols/operators/img014operators.png
new file mode 100644
index 0000000..e7a2956
--- /dev/null
+++ b/src/kile/symbols/operators/img014operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img015operators.png b/src/kile/symbols/operators/img015operators.png
new file mode 100644
index 0000000..5cff510
--- /dev/null
+++ b/src/kile/symbols/operators/img015operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img016operators.png b/src/kile/symbols/operators/img016operators.png
new file mode 100644
index 0000000..1367aef
--- /dev/null
+++ b/src/kile/symbols/operators/img016operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img017operators.png b/src/kile/symbols/operators/img017operators.png
new file mode 100644
index 0000000..bb3be17
--- /dev/null
+++ b/src/kile/symbols/operators/img017operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img018operators.png b/src/kile/symbols/operators/img018operators.png
new file mode 100644
index 0000000..50dff18
--- /dev/null
+++ b/src/kile/symbols/operators/img018operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img019operators.png b/src/kile/symbols/operators/img019operators.png
new file mode 100644
index 0000000..761139f
--- /dev/null
+++ b/src/kile/symbols/operators/img019operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img020operators.png b/src/kile/symbols/operators/img020operators.png
new file mode 100644
index 0000000..43f9ec7
--- /dev/null
+++ b/src/kile/symbols/operators/img020operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img021operators.png b/src/kile/symbols/operators/img021operators.png
new file mode 100644
index 0000000..5936471
--- /dev/null
+++ b/src/kile/symbols/operators/img021operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img022operators.png b/src/kile/symbols/operators/img022operators.png
new file mode 100644
index 0000000..b9fcfaa
--- /dev/null
+++ b/src/kile/symbols/operators/img022operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img023operators.png b/src/kile/symbols/operators/img023operators.png
new file mode 100644
index 0000000..a084b9b
--- /dev/null
+++ b/src/kile/symbols/operators/img023operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img024operators.png b/src/kile/symbols/operators/img024operators.png
new file mode 100644
index 0000000..265f92e
--- /dev/null
+++ b/src/kile/symbols/operators/img024operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img025operators.png b/src/kile/symbols/operators/img025operators.png
new file mode 100644
index 0000000..234673e
--- /dev/null
+++ b/src/kile/symbols/operators/img025operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img026operators.png b/src/kile/symbols/operators/img026operators.png
new file mode 100644
index 0000000..942c838
--- /dev/null
+++ b/src/kile/symbols/operators/img026operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img027operators.png b/src/kile/symbols/operators/img027operators.png
new file mode 100644
index 0000000..fb02ae6
--- /dev/null
+++ b/src/kile/symbols/operators/img027operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img028operators.png b/src/kile/symbols/operators/img028operators.png
new file mode 100644
index 0000000..180a533
--- /dev/null
+++ b/src/kile/symbols/operators/img028operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img029operators.png b/src/kile/symbols/operators/img029operators.png
new file mode 100644
index 0000000..a1d552e
--- /dev/null
+++ b/src/kile/symbols/operators/img029operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img030operators.png b/src/kile/symbols/operators/img030operators.png
new file mode 100644
index 0000000..c43abca
--- /dev/null
+++ b/src/kile/symbols/operators/img030operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img031operators.png b/src/kile/symbols/operators/img031operators.png
new file mode 100644
index 0000000..aa28551
--- /dev/null
+++ b/src/kile/symbols/operators/img031operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img032operators.png b/src/kile/symbols/operators/img032operators.png
new file mode 100644
index 0000000..7c9ae20
--- /dev/null
+++ b/src/kile/symbols/operators/img032operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img033operators.png b/src/kile/symbols/operators/img033operators.png
new file mode 100644
index 0000000..9c61408
--- /dev/null
+++ b/src/kile/symbols/operators/img033operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img034operators.png b/src/kile/symbols/operators/img034operators.png
new file mode 100644
index 0000000..7632b42
--- /dev/null
+++ b/src/kile/symbols/operators/img034operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img035operators.png b/src/kile/symbols/operators/img035operators.png
new file mode 100644
index 0000000..baa30a1
--- /dev/null
+++ b/src/kile/symbols/operators/img035operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img036operators.png b/src/kile/symbols/operators/img036operators.png
new file mode 100644
index 0000000..61401bc
--- /dev/null
+++ b/src/kile/symbols/operators/img036operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img037operators.png b/src/kile/symbols/operators/img037operators.png
new file mode 100644
index 0000000..e19a1d5
--- /dev/null
+++ b/src/kile/symbols/operators/img037operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img038operators.png b/src/kile/symbols/operators/img038operators.png
new file mode 100644
index 0000000..fb4d6ba
--- /dev/null
+++ b/src/kile/symbols/operators/img038operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img039operators.png b/src/kile/symbols/operators/img039operators.png
new file mode 100644
index 0000000..5019d55
--- /dev/null
+++ b/src/kile/symbols/operators/img039operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img040operators.png b/src/kile/symbols/operators/img040operators.png
new file mode 100644
index 0000000..3cfa720
--- /dev/null
+++ b/src/kile/symbols/operators/img040operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img041operators.png b/src/kile/symbols/operators/img041operators.png
new file mode 100644
index 0000000..5e68207
--- /dev/null
+++ b/src/kile/symbols/operators/img041operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img042operators.png b/src/kile/symbols/operators/img042operators.png
new file mode 100644
index 0000000..4a40a09
--- /dev/null
+++ b/src/kile/symbols/operators/img042operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img043operators.png b/src/kile/symbols/operators/img043operators.png
new file mode 100644
index 0000000..fba3160
--- /dev/null
+++ b/src/kile/symbols/operators/img043operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img044operators.png b/src/kile/symbols/operators/img044operators.png
new file mode 100644
index 0000000..cf492a7
--- /dev/null
+++ b/src/kile/symbols/operators/img044operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img045operators.png b/src/kile/symbols/operators/img045operators.png
new file mode 100644
index 0000000..721f56c
--- /dev/null
+++ b/src/kile/symbols/operators/img045operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img046operators.png b/src/kile/symbols/operators/img046operators.png
new file mode 100644
index 0000000..948c04c
--- /dev/null
+++ b/src/kile/symbols/operators/img046operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img047operators.png b/src/kile/symbols/operators/img047operators.png
new file mode 100644
index 0000000..31ebf70
--- /dev/null
+++ b/src/kile/symbols/operators/img047operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img048operators.png b/src/kile/symbols/operators/img048operators.png
new file mode 100644
index 0000000..39194dc
--- /dev/null
+++ b/src/kile/symbols/operators/img048operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img049operators.png b/src/kile/symbols/operators/img049operators.png
new file mode 100644
index 0000000..248814f
--- /dev/null
+++ b/src/kile/symbols/operators/img049operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img050operators.png b/src/kile/symbols/operators/img050operators.png
new file mode 100644
index 0000000..3e6b7ee
--- /dev/null
+++ b/src/kile/symbols/operators/img050operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img051operators.png b/src/kile/symbols/operators/img051operators.png
new file mode 100644
index 0000000..81a4039
--- /dev/null
+++ b/src/kile/symbols/operators/img051operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img052operators.png b/src/kile/symbols/operators/img052operators.png
new file mode 100644
index 0000000..1610430
--- /dev/null
+++ b/src/kile/symbols/operators/img052operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img053operators.png b/src/kile/symbols/operators/img053operators.png
new file mode 100644
index 0000000..12b7d14
--- /dev/null
+++ b/src/kile/symbols/operators/img053operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img054operators.png b/src/kile/symbols/operators/img054operators.png
new file mode 100644
index 0000000..f5fd690
--- /dev/null
+++ b/src/kile/symbols/operators/img054operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img055operators.png b/src/kile/symbols/operators/img055operators.png
new file mode 100644
index 0000000..836e62e
--- /dev/null
+++ b/src/kile/symbols/operators/img055operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img056operators.png b/src/kile/symbols/operators/img056operators.png
new file mode 100644
index 0000000..5a17bd0
--- /dev/null
+++ b/src/kile/symbols/operators/img056operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img057operators.png b/src/kile/symbols/operators/img057operators.png
new file mode 100644
index 0000000..91603ab
--- /dev/null
+++ b/src/kile/symbols/operators/img057operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img058operators.png b/src/kile/symbols/operators/img058operators.png
new file mode 100644
index 0000000..255a466
--- /dev/null
+++ b/src/kile/symbols/operators/img058operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img059operators.png b/src/kile/symbols/operators/img059operators.png
new file mode 100644
index 0000000..dc5acc9
--- /dev/null
+++ b/src/kile/symbols/operators/img059operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img060operators.png b/src/kile/symbols/operators/img060operators.png
new file mode 100644
index 0000000..5507cbf
--- /dev/null
+++ b/src/kile/symbols/operators/img060operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img061operators.png b/src/kile/symbols/operators/img061operators.png
new file mode 100644
index 0000000..5aa970f
--- /dev/null
+++ b/src/kile/symbols/operators/img061operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img062operators.png b/src/kile/symbols/operators/img062operators.png
new file mode 100644
index 0000000..fcc2ef0
--- /dev/null
+++ b/src/kile/symbols/operators/img062operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img063operators.png b/src/kile/symbols/operators/img063operators.png
new file mode 100644
index 0000000..72cce11
--- /dev/null
+++ b/src/kile/symbols/operators/img063operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img064operators.png b/src/kile/symbols/operators/img064operators.png
new file mode 100644
index 0000000..c82c497
--- /dev/null
+++ b/src/kile/symbols/operators/img064operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img065operators.png b/src/kile/symbols/operators/img065operators.png
new file mode 100644
index 0000000..ab5a3fd
--- /dev/null
+++ b/src/kile/symbols/operators/img065operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img066operators.png b/src/kile/symbols/operators/img066operators.png
new file mode 100644
index 0000000..359d485
--- /dev/null
+++ b/src/kile/symbols/operators/img066operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img067operators.png b/src/kile/symbols/operators/img067operators.png
new file mode 100644
index 0000000..a6a0c26
--- /dev/null
+++ b/src/kile/symbols/operators/img067operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img068operators.png b/src/kile/symbols/operators/img068operators.png
new file mode 100644
index 0000000..95756dc
--- /dev/null
+++ b/src/kile/symbols/operators/img068operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img069operators.png b/src/kile/symbols/operators/img069operators.png
new file mode 100644
index 0000000..3b8e31a
--- /dev/null
+++ b/src/kile/symbols/operators/img069operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img070operators.png b/src/kile/symbols/operators/img070operators.png
new file mode 100644
index 0000000..bb9e908
--- /dev/null
+++ b/src/kile/symbols/operators/img070operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img071operators.png b/src/kile/symbols/operators/img071operators.png
new file mode 100644
index 0000000..931b527
--- /dev/null
+++ b/src/kile/symbols/operators/img071operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img072operators.png b/src/kile/symbols/operators/img072operators.png
new file mode 100644
index 0000000..54b0048
--- /dev/null
+++ b/src/kile/symbols/operators/img072operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img073operators.png b/src/kile/symbols/operators/img073operators.png
new file mode 100644
index 0000000..cff87ba
--- /dev/null
+++ b/src/kile/symbols/operators/img073operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img074operators.png b/src/kile/symbols/operators/img074operators.png
new file mode 100644
index 0000000..7b20455
--- /dev/null
+++ b/src/kile/symbols/operators/img074operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img075operators.png b/src/kile/symbols/operators/img075operators.png
new file mode 100644
index 0000000..0603414
--- /dev/null
+++ b/src/kile/symbols/operators/img075operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img076operators.png b/src/kile/symbols/operators/img076operators.png
new file mode 100644
index 0000000..7aa2f5a
--- /dev/null
+++ b/src/kile/symbols/operators/img076operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img077operators.png b/src/kile/symbols/operators/img077operators.png
new file mode 100644
index 0000000..7dee868
--- /dev/null
+++ b/src/kile/symbols/operators/img077operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img078operators.png b/src/kile/symbols/operators/img078operators.png
new file mode 100644
index 0000000..4b0e586
--- /dev/null
+++ b/src/kile/symbols/operators/img078operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img079operators.png b/src/kile/symbols/operators/img079operators.png
new file mode 100644
index 0000000..d40a988
--- /dev/null
+++ b/src/kile/symbols/operators/img079operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img080operators.png b/src/kile/symbols/operators/img080operators.png
new file mode 100644
index 0000000..2f32da0
--- /dev/null
+++ b/src/kile/symbols/operators/img080operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img081operators.png b/src/kile/symbols/operators/img081operators.png
new file mode 100644
index 0000000..3047a11
--- /dev/null
+++ b/src/kile/symbols/operators/img081operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img082operators.png b/src/kile/symbols/operators/img082operators.png
new file mode 100644
index 0000000..834cb57
--- /dev/null
+++ b/src/kile/symbols/operators/img082operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img083operators.png b/src/kile/symbols/operators/img083operators.png
new file mode 100644
index 0000000..1ead86e
--- /dev/null
+++ b/src/kile/symbols/operators/img083operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img084operators.png b/src/kile/symbols/operators/img084operators.png
new file mode 100644
index 0000000..2631816
--- /dev/null
+++ b/src/kile/symbols/operators/img084operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img085operators.png b/src/kile/symbols/operators/img085operators.png
new file mode 100644
index 0000000..70dfa9c
--- /dev/null
+++ b/src/kile/symbols/operators/img085operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img086operators.png b/src/kile/symbols/operators/img086operators.png
new file mode 100644
index 0000000..91e8442
--- /dev/null
+++ b/src/kile/symbols/operators/img086operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img087operators.png b/src/kile/symbols/operators/img087operators.png
new file mode 100644
index 0000000..80faa4b
--- /dev/null
+++ b/src/kile/symbols/operators/img087operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img088operators.png b/src/kile/symbols/operators/img088operators.png
new file mode 100644
index 0000000..25e68bd
--- /dev/null
+++ b/src/kile/symbols/operators/img088operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img089operators.png b/src/kile/symbols/operators/img089operators.png
new file mode 100644
index 0000000..4a7f9ff
--- /dev/null
+++ b/src/kile/symbols/operators/img089operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img090operators.png b/src/kile/symbols/operators/img090operators.png
new file mode 100644
index 0000000..84684d8
--- /dev/null
+++ b/src/kile/symbols/operators/img090operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img091operators.png b/src/kile/symbols/operators/img091operators.png
new file mode 100644
index 0000000..476008b
--- /dev/null
+++ b/src/kile/symbols/operators/img091operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img092operators.png b/src/kile/symbols/operators/img092operators.png
new file mode 100644
index 0000000..0a78cff
--- /dev/null
+++ b/src/kile/symbols/operators/img092operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img093operators.png b/src/kile/symbols/operators/img093operators.png
new file mode 100644
index 0000000..a7a2b8d
--- /dev/null
+++ b/src/kile/symbols/operators/img093operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img094operators.png b/src/kile/symbols/operators/img094operators.png
new file mode 100644
index 0000000..88a3a62
--- /dev/null
+++ b/src/kile/symbols/operators/img094operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img095operators.png b/src/kile/symbols/operators/img095operators.png
new file mode 100644
index 0000000..c08e768
--- /dev/null
+++ b/src/kile/symbols/operators/img095operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img096operators.png b/src/kile/symbols/operators/img096operators.png
new file mode 100644
index 0000000..8298645
--- /dev/null
+++ b/src/kile/symbols/operators/img096operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img097operators.png b/src/kile/symbols/operators/img097operators.png
new file mode 100644
index 0000000..e7c18ae
--- /dev/null
+++ b/src/kile/symbols/operators/img097operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img098operators.png b/src/kile/symbols/operators/img098operators.png
new file mode 100644
index 0000000..a54e160
--- /dev/null
+++ b/src/kile/symbols/operators/img098operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img099operators.png b/src/kile/symbols/operators/img099operators.png
new file mode 100644
index 0000000..126f477
--- /dev/null
+++ b/src/kile/symbols/operators/img099operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img100operators.png b/src/kile/symbols/operators/img100operators.png
new file mode 100644
index 0000000..762d37f
--- /dev/null
+++ b/src/kile/symbols/operators/img100operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img101operators.png b/src/kile/symbols/operators/img101operators.png
new file mode 100644
index 0000000..60ded5f
--- /dev/null
+++ b/src/kile/symbols/operators/img101operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img102operators.png b/src/kile/symbols/operators/img102operators.png
new file mode 100644
index 0000000..6acec66
--- /dev/null
+++ b/src/kile/symbols/operators/img102operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img103operators.png b/src/kile/symbols/operators/img103operators.png
new file mode 100644
index 0000000..14c1f94
--- /dev/null
+++ b/src/kile/symbols/operators/img103operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img104operators.png b/src/kile/symbols/operators/img104operators.png
new file mode 100644
index 0000000..30df41d
--- /dev/null
+++ b/src/kile/symbols/operators/img104operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img105operators.png b/src/kile/symbols/operators/img105operators.png
new file mode 100644
index 0000000..2289ace
--- /dev/null
+++ b/src/kile/symbols/operators/img105operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img106operators.png b/src/kile/symbols/operators/img106operators.png
new file mode 100644
index 0000000..75ebaae
--- /dev/null
+++ b/src/kile/symbols/operators/img106operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img107operators.png b/src/kile/symbols/operators/img107operators.png
new file mode 100644
index 0000000..702a3e9
--- /dev/null
+++ b/src/kile/symbols/operators/img107operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img108operators.png b/src/kile/symbols/operators/img108operators.png
new file mode 100644
index 0000000..f584872
--- /dev/null
+++ b/src/kile/symbols/operators/img108operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img109operators.png b/src/kile/symbols/operators/img109operators.png
new file mode 100644
index 0000000..37c54fb
--- /dev/null
+++ b/src/kile/symbols/operators/img109operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img110operators.png b/src/kile/symbols/operators/img110operators.png
new file mode 100644
index 0000000..f653d23
--- /dev/null
+++ b/src/kile/symbols/operators/img110operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img111operators.png b/src/kile/symbols/operators/img111operators.png
new file mode 100644
index 0000000..91673a1
--- /dev/null
+++ b/src/kile/symbols/operators/img111operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img112operators.png b/src/kile/symbols/operators/img112operators.png
new file mode 100644
index 0000000..80d83aa
--- /dev/null
+++ b/src/kile/symbols/operators/img112operators.png
Binary files differ
diff --git a/src/kile/symbols/operators/img113operators.png b/src/kile/symbols/operators/img113operators.png
new file mode 100644
index 0000000..8a52c3e
--- /dev/null
+++ b/src/kile/symbols/operators/img113operators.png
Binary files differ
diff --git a/src/kile/symbols/relation.tex b/src/kile/symbols/relation.tex
new file mode 100644
index 0000000..708256b
--- /dev/null
+++ b/src/kile/symbols/relation.tex
@@ -0,0 +1,197 @@
+\documentclass[a4paper,10pt]{article}
+\usepackage{amssymb}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Author: Thomas Braun
+% begin: Sat 8 april 2006
+% last edit: Mo 9 april 2007
+% License: GPLv2 or later
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\iffalse
+\newcommand{\begin{neededpkgs}}[2][]{}
+\newcommand{\pkgs}[2][]{}
+\fi
+
+\input{definitions}
+
+\begin{document}
+
+\mathcommand{\bowtie}
+\pkgs{amssymb}\mathcommand{\Join}
+\mathcommand{\propto}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\varpropto}
+\mathcommand{\multimap}
+\mathcommand{\pitchfork}
+\mathcommand{\therefore}
+\mathcommand{\because}
+\end{neededpkgs}
+
+\mathcommand{=}
+\mathcommand{\neq}
+\mathcommand{\equiv}
+\begin{neededpkgs}{amssymb}
+\end{neededpkgs}
+\mathcommand{\approx}
+\mathcommand{\sim}
+\begin{neededpkgs}{amssymb}
+\end{neededpkgs}
+\mathcommand{\simeq}
+\pkgs{amssymb}\mathcommand{\backsimeq}
+\pkgs{amssymb}\mathcommand{\approxeq}
+\mathcommand{\cong}
+\pkgs{amssymb}\mathcommand{\ncong}
+
+\mathcommand{\smile}
+\mathcommand{\frown}
+\mathcommand{\asymp}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\smallfrown}
+\mathcommand{\smallsmile}
+\mathcommand{\between}
+\end{neededpkgs}
+\mathcommand{\prec}
+\mathcommand{\succ}
+\pkgs{amssymb}\mathcommand{\nprec}
+\pkgs{amssymb}\mathcommand{\nsucc}
+\mathcommand{\preceq}
+\mathcommand{\succeq}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\npreceq}
+\mathcommand{\nsucceq}
+
+\mathcommand{\preccurlyeq}
+\mathcommand{\succcurlyeq}
+\mathcommand{\curlyeqprec}
+\mathcommand{\curlyeqsucc}
+\mathcommand{\precsim}
+\mathcommand{\succsim}
+\mathcommand{\precnsim}
+\mathcommand{\succnsim}
+\mathcommand{\precapprox}
+\mathcommand{\succapprox}
+\mathcommand{\precnapprox}
+\mathcommand{\succnapprox}
+
+\end{neededpkgs}
+\mathcommand{\perp}
+\mathcommand{\vdash}
+\mathcommand{\dashv}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\nvdash}
+\mathcommand{\Vdash}
+\mathcommand{\Vvdash}
+\end{neededpkgs}
+\mathcommand{\models}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\vDash}
+\mathcommand{\nvDash}
+\mathcommand{\nVDash}
+\end{neededpkgs}
+
+\mathcommand{\mid}
+\pkgs{amssymb}\mathcommand{\nmid}
+\mathcommand{\parallel}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\nparallel}
+\mathcommand{\shortmid}
+\mathcommand{\nshortmid}
+\mathcommand{\shortparallel}
+\mathcommand{\nshortparallel}
+\end{neededpkgs}
+
+\mathcommand{<}
+\mathcommand{>}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\nless}
+\mathcommand{\ngtr}
+\mathcommand{\lessdot}
+\mathcommand{\gtrdot}
+\end{neededpkgs}
+
+\mathcommand{\ll}
+\mathcommand{\gg}
+\pkgs{amssymb}\mathcommand{\lll}
+\pkgs{amssymb}\mathcommand{\ggg}
+
+\mathcommand{\leq}
+\mathcommand{\geq}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\lneq}
+\mathcommand{\gneq}
+\mathcommand{\nleq}
+\mathcommand{\ngeq}
+\mathcommand{\leqq}
+\mathcommand{\geqq}
+\mathcommand{\lneqq}
+\mathcommand{\gneqq}
+\mathcommand{\lvertneqq}
+\mathcommand{\gvertneqq}
+\mathcommand{\nleqq}
+\mathcommand{\ngeqq}
+
+\mathcommand{\leqslant}
+\mathcommand{\geqslant}
+\mathcommand{\nleqslant}
+\mathcommand{\ngeqslant}
+\mathcommand{\eqslantless}
+\mathcommand{\eqslantgtr}
+
+\mathcommand{\lessgtr}
+\mathcommand{\gtrless}
+\mathcommand{\lesseqgtr}
+\mathcommand{\gtreqless}
+\mathcommand{\lesseqqgtr}
+\mathcommand{\gtreqqless}
+
+\mathcommand{\lesssim}
+\mathcommand{\gtrsim}
+\mathcommand{\lnsim}
+\mathcommand{\gnsim}
+\mathcommand{\lessapprox}
+\mathcommand{\gtrapprox}
+\mathcommand{\lnapprox}
+\mathcommand{\gnapprox}
+
+
+\mathcommand{\vartriangleleft}
+\mathcommand{\vartriangleright}
+\mathcommand{\ntriangleleft}
+\mathcommand{\ntriangleright}
+\mathcommand{\trianglelefteq}
+\mathcommand{\trianglerighteq}
+\mathcommand{\ntrianglelefteq}
+\mathcommand{\ntrianglerighteq}
+\mathcommand{\blacktriangleleft}
+\mathcommand{\blacktriangleright}
+\end{neededpkgs}
+
+\mathcommand{\subset}
+\mathcommand{\supset}
+\mathcommand{\subseteq}
+\mathcommand{\supseteq}
+\begin{neededpkgs}{amssymb}
+\mathcommand{\subsetneq}
+\mathcommand{\supsetneq}
+\mathcommand{\varsubsetneq}
+\mathcommand{\varsupsetneq}
+\mathcommand{\nsubseteq}
+\mathcommand{\nsupseteq}
+\mathcommand{\subseteqq}
+\mathcommand{\supseteqq}
+\mathcommand{\subsetneqq}
+\mathcommand{\supsetneqq}
+\mathcommand{\nsubseteqq}
+\mathcommand{\nsupseteqq}
+\mathcommand{\backepsilon}
+
+\mathcommand{\Subset}
+\mathcommand{\Supset}
+\mathcommand{\sqsubset}
+\mathcommand{\sqsupset}
+\end{neededpkgs}
+\mathcommand{\sqsubseteq}
+\mathcommand{\sqsupseteq}
+
+\end{document}
diff --git a/src/kile/symbols/relation/CMakeLists.txt b/src/kile/symbols/relation/CMakeLists.txt
new file mode 100644
index 0000000..2854e07
--- /dev/null
+++ b/src/kile/symbols/relation/CMakeLists.txt
@@ -0,0 +1,159 @@
+
+########### install files ###############
+
+SET( symbols
+ img001relation.png
+ img002relation.png
+ img003relation.png
+ img004relation.png
+ img005relation.png
+ img006relation.png
+ img007relation.png
+ img008relation.png
+ img009relation.png
+ img010relation.png
+ img011relation.png
+ img012relation.png
+ img013relation.png
+ img014relation.png
+ img015relation.png
+ img016relation.png
+ img017relation.png
+ img018relation.png
+ img019relation.png
+ img020relation.png
+ img021relation.png
+ img022relation.png
+ img023relation.png
+ img024relation.png
+ img025relation.png
+ img026relation.png
+ img027relation.png
+ img028relation.png
+ img029relation.png
+ img030relation.png
+ img031relation.png
+ img032relation.png
+ img033relation.png
+ img034relation.png
+ img035relation.png
+ img036relation.png
+ img037relation.png
+ img038relation.png
+ img039relation.png
+ img040relation.png
+ img041relation.png
+ img042relation.png
+ img043relation.png
+ img044relation.png
+ img045relation.png
+ img046relation.png
+ img047relation.png
+ img048relation.png
+ img049relation.png
+ img050relation.png
+ img051relation.png
+ img052relation.png
+ img053relation.png
+ img054relation.png
+ img055relation.png
+ img056relation.png
+ img057relation.png
+ img058relation.png
+ img059relation.png
+ img060relation.png
+ img061relation.png
+ img062relation.png
+ img063relation.png
+ img064relation.png
+ img065relation.png
+ img066relation.png
+ img067relation.png
+ img068relation.png
+ img069relation.png
+ img070relation.png
+ img071relation.png
+ img072relation.png
+ img073relation.png
+ img074relation.png
+ img075relation.png
+ img076relation.png
+ img077relation.png
+ img078relation.png
+ img079relation.png
+ img080relation.png
+ img081relation.png
+ img082relation.png
+ img083relation.png
+ img084relation.png
+ img085relation.png
+ img086relation.png
+ img087relation.png
+ img088relation.png
+ img089relation.png
+ img090relation.png
+ img091relation.png
+ img092relation.png
+ img093relation.png
+ img094relation.png
+ img095relation.png
+ img096relation.png
+ img097relation.png
+ img098relation.png
+ img099relation.png
+ img100relation.png
+ img101relation.png
+ img102relation.png
+ img103relation.png
+ img104relation.png
+ img105relation.png
+ img106relation.png
+ img107relation.png
+ img108relation.png
+ img109relation.png
+ img110relation.png
+ img111relation.png
+ img112relation.png
+ img113relation.png
+ img114relation.png
+ img115relation.png
+ img116relation.png
+ img117relation.png
+ img118relation.png
+ img119relation.png
+ img120relation.png
+ img121relation.png
+ img122relation.png
+ img123relation.png
+ img124relation.png
+ img125relation.png
+ img126relation.png
+ img127relation.png
+ img128relation.png
+ img129relation.png
+ img130relation.png
+ img131relation.png
+ img132relation.png
+ img133relation.png
+ img134relation.png
+ img135relation.png
+ img136relation.png
+ img137relation.png
+ img138relation.png
+ img139relation.png
+ img140relation.png
+ img141relation.png
+ img142relation.png
+ img143relation.png
+ img144relation.png
+ img145relation.png
+ img146relation.png
+ img147relation.png
+ img148relation.png
+ img149relation.png
+ img150relation.png
+ img151relation.png
+ img152relation.png
+)
+
+INSTALL( FILES ${symbols} DESTINATION share/apps/kile/mathsymbols/relation )
diff --git a/src/kile/symbols/relation/Makefile.am b/src/kile/symbols/relation/Makefile.am
new file mode 100644
index 0000000..da73e7d
--- /dev/null
+++ b/src/kile/symbols/relation/Makefile.am
@@ -0,0 +1,141 @@
+picsdir = $(kde_datadir)/kile/mathsymbols/relation
+
+pics_DATA = img001relation.png \
+ img002relation.png \
+ img003relation.png \
+ img004relation.png \
+ img005relation.png \
+ img006relation.png \
+ img007relation.png \
+ img008relation.png \
+ img009relation.png \
+ img010relation.png \
+ img011relation.png \
+ img012relation.png \
+ img013relation.png \
+ img014relation.png \
+ img015relation.png \
+ img016relation.png \
+ img017relation.png \
+ img018relation.png \
+ img019relation.png \
+ img020relation.png \
+ img021relation.png \
+ img022relation.png \
+ img023relation.png \
+ img024relation.png \
+ img025relation.png \
+ img026relation.png \
+ img027relation.png \
+ img028relation.png \
+ img029relation.png \
+ img030relation.png \
+ img031relation.png \
+ img032relation.png \
+ img033relation.png \
+ img034relation.png \
+ img035relation.png \
+ img036relation.png \
+ img037relation.png \
+ img038relation.png \
+ img039relation.png \
+ img040relation.png \
+ img041relation.png \
+ img042relation.png \
+ img043relation.png \
+ img044relation.png \
+ img045relation.png \
+ img046relation.png \
+ img047relation.png \
+ img048relation.png \
+ img049relation.png \
+ img050relation.png \
+ img051relation.png \
+ img052relation.png \
+ img053relation.png \
+ img054relation.png \
+ img055relation.png \
+ img056relation.png \
+ img057relation.png \
+ img058relation.png \
+ img059relation.png \
+ img060relation.png \
+ img061relation.png \
+ img062relation.png \
+ img063relation.png \
+ img064relation.png \
+ img065relation.png \
+ img066relation.png \
+ img067relation.png \
+ img068relation.png \
+ img069relation.png \
+ img070relation.png \
+ img071relation.png \
+ img072relation.png \
+ img073relation.png \
+ img074relation.png \
+ img075relation.png \
+ img076relation.png \
+ img077relation.png \
+ img078relation.png \
+ img079relation.png \
+ img080relation.png \
+ img081relation.png \
+ img082relation.png \
+ img083relation.png \
+ img084relation.png \
+ img085relation.png \
+ img086relation.png \
+ img087relation.png \
+ img088relation.png \
+ img089relation.png \
+ img090relation.png \
+ img091relation.png \
+ img092relation.png \
+ img093relation.png \
+ img094relation.png \
+ img095relation.png \
+ img096relation.png \
+ img097relation.png \
+ img098relation.png \
+ img099relation.png \
+ img100relation.png \
+ img101relation.png \
+ img102relation.png \
+ img103relation.png \
+ img104relation.png \
+ img105relation.png \
+ img106relation.png \
+ img107relation.png \
+ img108relation.png \
+ img109relation.png \
+ img110relation.png \
+ img111relation.png \
+ img112relation.png \
+ img113relation.png \
+ img114relation.png \
+ img115relation.png \
+ img116relation.png \
+ img117relation.png \
+ img118relation.png \
+ img119relation.png \
+ img120relation.png \
+ img121relation.png \
+ img122relation.png \
+ img123relation.png \
+ img124relation.png \
+ img125relation.png \
+ img126relation.png \
+ img127relation.png \
+ img128relation.png \
+ img129relation.png \
+ img130relation.png \
+ img131relation.png \
+ img132relation.png \
+ img133relation.png \
+ img134relation.png \
+ img135relation.png \
+ img136relation.png \
+ img137relation.png \
+ img138relation.png \
+ img139relation.png
diff --git a/src/kile/symbols/relation/img001relation.png b/src/kile/symbols/relation/img001relation.png
new file mode 100644
index 0000000..b5baa02
--- /dev/null
+++ b/src/kile/symbols/relation/img001relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img002relation.png b/src/kile/symbols/relation/img002relation.png
new file mode 100644
index 0000000..98231e9
--- /dev/null
+++ b/src/kile/symbols/relation/img002relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img003relation.png b/src/kile/symbols/relation/img003relation.png
new file mode 100644
index 0000000..ce58714
--- /dev/null
+++ b/src/kile/symbols/relation/img003relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img004relation.png b/src/kile/symbols/relation/img004relation.png
new file mode 100644
index 0000000..ec0ddb0
--- /dev/null
+++ b/src/kile/symbols/relation/img004relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img005relation.png b/src/kile/symbols/relation/img005relation.png
new file mode 100644
index 0000000..112b670
--- /dev/null
+++ b/src/kile/symbols/relation/img005relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img006relation.png b/src/kile/symbols/relation/img006relation.png
new file mode 100644
index 0000000..453c0d3
--- /dev/null
+++ b/src/kile/symbols/relation/img006relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img007relation.png b/src/kile/symbols/relation/img007relation.png
new file mode 100644
index 0000000..179ca61
--- /dev/null
+++ b/src/kile/symbols/relation/img007relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img008relation.png b/src/kile/symbols/relation/img008relation.png
new file mode 100644
index 0000000..318e863
--- /dev/null
+++ b/src/kile/symbols/relation/img008relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img009relation.png b/src/kile/symbols/relation/img009relation.png
new file mode 100644
index 0000000..32d8ed9
--- /dev/null
+++ b/src/kile/symbols/relation/img009relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img010relation.png b/src/kile/symbols/relation/img010relation.png
new file mode 100644
index 0000000..2de0d30
--- /dev/null
+++ b/src/kile/symbols/relation/img010relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img011relation.png b/src/kile/symbols/relation/img011relation.png
new file mode 100644
index 0000000..e5160fc
--- /dev/null
+++ b/src/kile/symbols/relation/img011relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img012relation.png b/src/kile/symbols/relation/img012relation.png
new file mode 100644
index 0000000..50e851a
--- /dev/null
+++ b/src/kile/symbols/relation/img012relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img013relation.png b/src/kile/symbols/relation/img013relation.png
new file mode 100644
index 0000000..ed9cd9c
--- /dev/null
+++ b/src/kile/symbols/relation/img013relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img014relation.png b/src/kile/symbols/relation/img014relation.png
new file mode 100644
index 0000000..01d168d
--- /dev/null
+++ b/src/kile/symbols/relation/img014relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img015relation.png b/src/kile/symbols/relation/img015relation.png
new file mode 100644
index 0000000..cb7e6ff
--- /dev/null
+++ b/src/kile/symbols/relation/img015relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img016relation.png b/src/kile/symbols/relation/img016relation.png
new file mode 100644
index 0000000..14ab7ef
--- /dev/null
+++ b/src/kile/symbols/relation/img016relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img017relation.png b/src/kile/symbols/relation/img017relation.png
new file mode 100644
index 0000000..0809432
--- /dev/null
+++ b/src/kile/symbols/relation/img017relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img018relation.png b/src/kile/symbols/relation/img018relation.png
new file mode 100644
index 0000000..0766145
--- /dev/null
+++ b/src/kile/symbols/relation/img018relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img019relation.png b/src/kile/symbols/relation/img019relation.png
new file mode 100644
index 0000000..e1bb8af
--- /dev/null
+++ b/src/kile/symbols/relation/img019relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img020relation.png b/src/kile/symbols/relation/img020relation.png
new file mode 100644
index 0000000..b56a08c
--- /dev/null
+++ b/src/kile/symbols/relation/img020relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img021relation.png b/src/kile/symbols/relation/img021relation.png
new file mode 100644
index 0000000..807f13d
--- /dev/null
+++ b/src/kile/symbols/relation/img021relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img022relation.png b/src/kile/symbols/relation/img022relation.png
new file mode 100644
index 0000000..c28624d
--- /dev/null
+++ b/src/kile/symbols/relation/img022relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img023relation.png b/src/kile/symbols/relation/img023relation.png
new file mode 100644
index 0000000..250742e
--- /dev/null
+++ b/src/kile/symbols/relation/img023relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img024relation.png b/src/kile/symbols/relation/img024relation.png
new file mode 100644
index 0000000..21b005e
--- /dev/null
+++ b/src/kile/symbols/relation/img024relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img025relation.png b/src/kile/symbols/relation/img025relation.png
new file mode 100644
index 0000000..16d60f2
--- /dev/null
+++ b/src/kile/symbols/relation/img025relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img026relation.png b/src/kile/symbols/relation/img026relation.png
new file mode 100644
index 0000000..b6d17ac
--- /dev/null
+++ b/src/kile/symbols/relation/img026relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img027relation.png b/src/kile/symbols/relation/img027relation.png
new file mode 100644
index 0000000..10f7550
--- /dev/null
+++ b/src/kile/symbols/relation/img027relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img028relation.png b/src/kile/symbols/relation/img028relation.png
new file mode 100644
index 0000000..c4a3364
--- /dev/null
+++ b/src/kile/symbols/relation/img028relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img029relation.png b/src/kile/symbols/relation/img029relation.png
new file mode 100644
index 0000000..f63ec4e
--- /dev/null
+++ b/src/kile/symbols/relation/img029relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img030relation.png b/src/kile/symbols/relation/img030relation.png
new file mode 100644
index 0000000..2238481
--- /dev/null
+++ b/src/kile/symbols/relation/img030relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img031relation.png b/src/kile/symbols/relation/img031relation.png
new file mode 100644
index 0000000..f759e0e
--- /dev/null
+++ b/src/kile/symbols/relation/img031relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img032relation.png b/src/kile/symbols/relation/img032relation.png
new file mode 100644
index 0000000..7a3ccc6
--- /dev/null
+++ b/src/kile/symbols/relation/img032relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img033relation.png b/src/kile/symbols/relation/img033relation.png
new file mode 100644
index 0000000..941fa3a
--- /dev/null
+++ b/src/kile/symbols/relation/img033relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img034relation.png b/src/kile/symbols/relation/img034relation.png
new file mode 100644
index 0000000..beee66d
--- /dev/null
+++ b/src/kile/symbols/relation/img034relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img035relation.png b/src/kile/symbols/relation/img035relation.png
new file mode 100644
index 0000000..906dc0e
--- /dev/null
+++ b/src/kile/symbols/relation/img035relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img036relation.png b/src/kile/symbols/relation/img036relation.png
new file mode 100644
index 0000000..e0ceb59
--- /dev/null
+++ b/src/kile/symbols/relation/img036relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img037relation.png b/src/kile/symbols/relation/img037relation.png
new file mode 100644
index 0000000..466ffca
--- /dev/null
+++ b/src/kile/symbols/relation/img037relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img038relation.png b/src/kile/symbols/relation/img038relation.png
new file mode 100644
index 0000000..80bf1aa
--- /dev/null
+++ b/src/kile/symbols/relation/img038relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img039relation.png b/src/kile/symbols/relation/img039relation.png
new file mode 100644
index 0000000..16da745
--- /dev/null
+++ b/src/kile/symbols/relation/img039relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img040relation.png b/src/kile/symbols/relation/img040relation.png
new file mode 100644
index 0000000..0db1015
--- /dev/null
+++ b/src/kile/symbols/relation/img040relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img041relation.png b/src/kile/symbols/relation/img041relation.png
new file mode 100644
index 0000000..eec4e28
--- /dev/null
+++ b/src/kile/symbols/relation/img041relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img042relation.png b/src/kile/symbols/relation/img042relation.png
new file mode 100644
index 0000000..06bda58
--- /dev/null
+++ b/src/kile/symbols/relation/img042relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img043relation.png b/src/kile/symbols/relation/img043relation.png
new file mode 100644
index 0000000..76a53ff
--- /dev/null
+++ b/src/kile/symbols/relation/img043relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img044relation.png b/src/kile/symbols/relation/img044relation.png
new file mode 100644
index 0000000..9aaa458
--- /dev/null
+++ b/src/kile/symbols/relation/img044relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img045relation.png b/src/kile/symbols/relation/img045relation.png
new file mode 100644
index 0000000..1997a5d
--- /dev/null
+++ b/src/kile/symbols/relation/img045relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img046relation.png b/src/kile/symbols/relation/img046relation.png
new file mode 100644
index 0000000..fd9137e
--- /dev/null
+++ b/src/kile/symbols/relation/img046relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img047relation.png b/src/kile/symbols/relation/img047relation.png
new file mode 100644
index 0000000..ad71330
--- /dev/null
+++ b/src/kile/symbols/relation/img047relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img048relation.png b/src/kile/symbols/relation/img048relation.png
new file mode 100644
index 0000000..e250562
--- /dev/null
+++ b/src/kile/symbols/relation/img048relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img049relation.png b/src/kile/symbols/relation/img049relation.png
new file mode 100644
index 0000000..8b846ac
--- /dev/null
+++ b/src/kile/symbols/relation/img049relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img050relation.png b/src/kile/symbols/relation/img050relation.png
new file mode 100644
index 0000000..f8cfbe8
--- /dev/null
+++ b/src/kile/symbols/relation/img050relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img051relation.png b/src/kile/symbols/relation/img051relation.png
new file mode 100644
index 0000000..ca3c82f
--- /dev/null
+++ b/src/kile/symbols/relation/img051relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img052relation.png b/src/kile/symbols/relation/img052relation.png
new file mode 100644
index 0000000..e67071c
--- /dev/null
+++ b/src/kile/symbols/relation/img052relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img053relation.png b/src/kile/symbols/relation/img053relation.png
new file mode 100644
index 0000000..68b007b
--- /dev/null
+++ b/src/kile/symbols/relation/img053relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img054relation.png b/src/kile/symbols/relation/img054relation.png
new file mode 100644
index 0000000..a2e5d76
--- /dev/null
+++ b/src/kile/symbols/relation/img054relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img055relation.png b/src/kile/symbols/relation/img055relation.png
new file mode 100644
index 0000000..178616f
--- /dev/null
+++ b/src/kile/symbols/relation/img055relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img056relation.png b/src/kile/symbols/relation/img056relation.png
new file mode 100644
index 0000000..8d1cb7f
--- /dev/null
+++ b/src/kile/symbols/relation/img056relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img057relation.png b/src/kile/symbols/relation/img057relation.png
new file mode 100644
index 0000000..272669c
--- /dev/null
+++ b/src/kile/symbols/relation/img057relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img058relation.png b/src/kile/symbols/relation/img058relation.png
new file mode 100644
index 0000000..28995e6
--- /dev/null
+++ b/src/kile/symbols/relation/img058relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img059relation.png b/src/kile/symbols/relation/img059relation.png
new file mode 100644
index 0000000..4075ca8
--- /dev/null
+++ b/src/kile/symbols/relation/img059relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img060relation.png b/src/kile/symbols/relation/img060relation.png
new file mode 100644
index 0000000..456951f
--- /dev/null
+++ b/src/kile/symbols/relation/img060relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img061relation.png b/src/kile/symbols/relation/img061relation.png
new file mode 100644
index 0000000..344ab1b
--- /dev/null
+++ b/src/kile/symbols/relation/img061relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img062relation.png b/src/kile/symbols/relation/img062relation.png
new file mode 100644
index 0000000..2a1687b
--- /dev/null
+++ b/src/kile/symbols/relation/img062relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img063relation.png b/src/kile/symbols/relation/img063relation.png
new file mode 100644
index 0000000..86dab1a
--- /dev/null
+++ b/src/kile/symbols/relation/img063relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img064relation.png b/src/kile/symbols/relation/img064relation.png
new file mode 100644
index 0000000..d015521
--- /dev/null
+++ b/src/kile/symbols/relation/img064relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img065relation.png b/src/kile/symbols/relation/img065relation.png
new file mode 100644
index 0000000..28bf4f4
--- /dev/null
+++ b/src/kile/symbols/relation/img065relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img066relation.png b/src/kile/symbols/relation/img066relation.png
new file mode 100644
index 0000000..2b79835
--- /dev/null
+++ b/src/kile/symbols/relation/img066relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img067relation.png b/src/kile/symbols/relation/img067relation.png
new file mode 100644
index 0000000..8cc6af4
--- /dev/null
+++ b/src/kile/symbols/relation/img067relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img068relation.png b/src/kile/symbols/relation/img068relation.png
new file mode 100644
index 0000000..314e650
--- /dev/null
+++ b/src/kile/symbols/relation/img068relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img069relation.png b/src/kile/symbols/relation/img069relation.png
new file mode 100644
index 0000000..1e2d77e
--- /dev/null
+++ b/src/kile/symbols/relation/img069relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img070relation.png b/src/kile/symbols/relation/img070relation.png
new file mode 100644
index 0000000..95750c6
--- /dev/null
+++ b/src/kile/symbols/relation/img070relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img071relation.png b/src/kile/symbols/relation/img071relation.png
new file mode 100644
index 0000000..01e1960
--- /dev/null
+++ b/src/kile/symbols/relation/img071relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img072relation.png b/src/kile/symbols/relation/img072relation.png
new file mode 100644
index 0000000..a86834f
--- /dev/null
+++ b/src/kile/symbols/relation/img072relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img073relation.png b/src/kile/symbols/relation/img073relation.png
new file mode 100644
index 0000000..3b2636f
--- /dev/null
+++ b/src/kile/symbols/relation/img073relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img074relation.png b/src/kile/symbols/relation/img074relation.png
new file mode 100644
index 0000000..5e09320
--- /dev/null
+++ b/src/kile/symbols/relation/img074relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img075relation.png b/src/kile/symbols/relation/img075relation.png
new file mode 100644
index 0000000..a5262f1
--- /dev/null
+++ b/src/kile/symbols/relation/img075relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img076relation.png b/src/kile/symbols/relation/img076relation.png
new file mode 100644
index 0000000..4317763
--- /dev/null
+++ b/src/kile/symbols/relation/img076relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img077relation.png b/src/kile/symbols/relation/img077relation.png
new file mode 100644
index 0000000..7993245
--- /dev/null
+++ b/src/kile/symbols/relation/img077relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img078relation.png b/src/kile/symbols/relation/img078relation.png
new file mode 100644
index 0000000..e78d5c4
--- /dev/null
+++ b/src/kile/symbols/relation/img078relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img079relation.png b/src/kile/symbols/relation/img079relation.png
new file mode 100644
index 0000000..0c5d60d
--- /dev/null
+++ b/src/kile/symbols/relation/img079relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img080relation.png b/src/kile/symbols/relation/img080relation.png
new file mode 100644
index 0000000..aa93ebb
--- /dev/null
+++ b/src/kile/symbols/relation/img080relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img081relation.png b/src/kile/symbols/relation/img081relation.png
new file mode 100644
index 0000000..02e87ac
--- /dev/null
+++ b/src/kile/symbols/relation/img081relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img082relation.png b/src/kile/symbols/relation/img082relation.png
new file mode 100644
index 0000000..6178d3e
--- /dev/null
+++ b/src/kile/symbols/relation/img082relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img083relation.png b/src/kile/symbols/relation/img083relation.png
new file mode 100644
index 0000000..7ec5971
--- /dev/null
+++ b/src/kile/symbols/relation/img083relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img084relation.png b/src/kile/symbols/relation/img084relation.png
new file mode 100644
index 0000000..41ca567
--- /dev/null
+++ b/src/kile/symbols/relation/img084relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img085relation.png b/src/kile/symbols/relation/img085relation.png
new file mode 100644
index 0000000..698ed9d
--- /dev/null
+++ b/src/kile/symbols/relation/img085relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img086relation.png b/src/kile/symbols/relation/img086relation.png
new file mode 100644
index 0000000..fd060c4
--- /dev/null
+++ b/src/kile/symbols/relation/img086relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img087relation.png b/src/kile/symbols/relation/img087relation.png
new file mode 100644
index 0000000..4f4c10b
--- /dev/null
+++ b/src/kile/symbols/relation/img087relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img088relation.png b/src/kile/symbols/relation/img088relation.png
new file mode 100644
index 0000000..c913e2b
--- /dev/null
+++ b/src/kile/symbols/relation/img088relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img089relation.png b/src/kile/symbols/relation/img089relation.png
new file mode 100644
index 0000000..7eb1ed9
--- /dev/null
+++ b/src/kile/symbols/relation/img089relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img090relation.png b/src/kile/symbols/relation/img090relation.png
new file mode 100644
index 0000000..e2a7af3
--- /dev/null
+++ b/src/kile/symbols/relation/img090relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img091relation.png b/src/kile/symbols/relation/img091relation.png
new file mode 100644
index 0000000..e4e5485
--- /dev/null
+++ b/src/kile/symbols/relation/img091relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img092relation.png b/src/kile/symbols/relation/img092relation.png
new file mode 100644
index 0000000..616c01b
--- /dev/null
+++ b/src/kile/symbols/relation/img092relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img093relation.png b/src/kile/symbols/relation/img093relation.png
new file mode 100644
index 0000000..212ecaa
--- /dev/null
+++ b/src/kile/symbols/relation/img093relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img094relation.png b/src/kile/symbols/relation/img094relation.png
new file mode 100644
index 0000000..00f47ff
--- /dev/null
+++ b/src/kile/symbols/relation/img094relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img095relation.png b/src/kile/symbols/relation/img095relation.png
new file mode 100644
index 0000000..d0ed6cd
--- /dev/null
+++ b/src/kile/symbols/relation/img095relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img096relation.png b/src/kile/symbols/relation/img096relation.png
new file mode 100644
index 0000000..2427711
--- /dev/null
+++ b/src/kile/symbols/relation/img096relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img097relation.png b/src/kile/symbols/relation/img097relation.png
new file mode 100644
index 0000000..172789e
--- /dev/null
+++ b/src/kile/symbols/relation/img097relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img098relation.png b/src/kile/symbols/relation/img098relation.png
new file mode 100644
index 0000000..b8be5a8
--- /dev/null
+++ b/src/kile/symbols/relation/img098relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img099relation.png b/src/kile/symbols/relation/img099relation.png
new file mode 100644
index 0000000..c6a3662
--- /dev/null
+++ b/src/kile/symbols/relation/img099relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img100relation.png b/src/kile/symbols/relation/img100relation.png
new file mode 100644
index 0000000..b1e8a0f
--- /dev/null
+++ b/src/kile/symbols/relation/img100relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img101relation.png b/src/kile/symbols/relation/img101relation.png
new file mode 100644
index 0000000..49812fc
--- /dev/null
+++ b/src/kile/symbols/relation/img101relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img102relation.png b/src/kile/symbols/relation/img102relation.png
new file mode 100644
index 0000000..9f9b67b
--- /dev/null
+++ b/src/kile/symbols/relation/img102relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img103relation.png b/src/kile/symbols/relation/img103relation.png
new file mode 100644
index 0000000..ad96f4e
--- /dev/null
+++ b/src/kile/symbols/relation/img103relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img104relation.png b/src/kile/symbols/relation/img104relation.png
new file mode 100644
index 0000000..9608fe7
--- /dev/null
+++ b/src/kile/symbols/relation/img104relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img105relation.png b/src/kile/symbols/relation/img105relation.png
new file mode 100644
index 0000000..5568ad6
--- /dev/null
+++ b/src/kile/symbols/relation/img105relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img106relation.png b/src/kile/symbols/relation/img106relation.png
new file mode 100644
index 0000000..e4e0c7e
--- /dev/null
+++ b/src/kile/symbols/relation/img106relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img107relation.png b/src/kile/symbols/relation/img107relation.png
new file mode 100644
index 0000000..df46e81
--- /dev/null
+++ b/src/kile/symbols/relation/img107relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img108relation.png b/src/kile/symbols/relation/img108relation.png
new file mode 100644
index 0000000..2d25771
--- /dev/null
+++ b/src/kile/symbols/relation/img108relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img109relation.png b/src/kile/symbols/relation/img109relation.png
new file mode 100644
index 0000000..f2af330
--- /dev/null
+++ b/src/kile/symbols/relation/img109relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img110relation.png b/src/kile/symbols/relation/img110relation.png
new file mode 100644
index 0000000..1332768
--- /dev/null
+++ b/src/kile/symbols/relation/img110relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img111relation.png b/src/kile/symbols/relation/img111relation.png
new file mode 100644
index 0000000..547bf29
--- /dev/null
+++ b/src/kile/symbols/relation/img111relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img112relation.png b/src/kile/symbols/relation/img112relation.png
new file mode 100644
index 0000000..b801114
--- /dev/null
+++ b/src/kile/symbols/relation/img112relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img113relation.png b/src/kile/symbols/relation/img113relation.png
new file mode 100644
index 0000000..5271ac5
--- /dev/null
+++ b/src/kile/symbols/relation/img113relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img114relation.png b/src/kile/symbols/relation/img114relation.png
new file mode 100644
index 0000000..6bf8807
--- /dev/null
+++ b/src/kile/symbols/relation/img114relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img115relation.png b/src/kile/symbols/relation/img115relation.png
new file mode 100644
index 0000000..f39df66
--- /dev/null
+++ b/src/kile/symbols/relation/img115relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img116relation.png b/src/kile/symbols/relation/img116relation.png
new file mode 100644
index 0000000..ca3682e
--- /dev/null
+++ b/src/kile/symbols/relation/img116relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img117relation.png b/src/kile/symbols/relation/img117relation.png
new file mode 100644
index 0000000..76e0e26
--- /dev/null
+++ b/src/kile/symbols/relation/img117relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img118relation.png b/src/kile/symbols/relation/img118relation.png
new file mode 100644
index 0000000..1250089
--- /dev/null
+++ b/src/kile/symbols/relation/img118relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img119relation.png b/src/kile/symbols/relation/img119relation.png
new file mode 100644
index 0000000..9fc543b
--- /dev/null
+++ b/src/kile/symbols/relation/img119relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img120relation.png b/src/kile/symbols/relation/img120relation.png
new file mode 100644
index 0000000..712b146
--- /dev/null
+++ b/src/kile/symbols/relation/img120relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img121relation.png b/src/kile/symbols/relation/img121relation.png
new file mode 100644
index 0000000..6ef53fa
--- /dev/null
+++ b/src/kile/symbols/relation/img121relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img122relation.png b/src/kile/symbols/relation/img122relation.png
new file mode 100644
index 0000000..33cfdf8
--- /dev/null
+++ b/src/kile/symbols/relation/img122relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img123relation.png b/src/kile/symbols/relation/img123relation.png
new file mode 100644
index 0000000..675e008
--- /dev/null
+++ b/src/kile/symbols/relation/img123relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img124relation.png b/src/kile/symbols/relation/img124relation.png
new file mode 100644
index 0000000..0a718b8
--- /dev/null
+++ b/src/kile/symbols/relation/img124relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img125relation.png b/src/kile/symbols/relation/img125relation.png
new file mode 100644
index 0000000..392d275
--- /dev/null
+++ b/src/kile/symbols/relation/img125relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img126relation.png b/src/kile/symbols/relation/img126relation.png
new file mode 100644
index 0000000..6b23d0c
--- /dev/null
+++ b/src/kile/symbols/relation/img126relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img127relation.png b/src/kile/symbols/relation/img127relation.png
new file mode 100644
index 0000000..3123d1d
--- /dev/null
+++ b/src/kile/symbols/relation/img127relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img128relation.png b/src/kile/symbols/relation/img128relation.png
new file mode 100644
index 0000000..b06ddbc
--- /dev/null
+++ b/src/kile/symbols/relation/img128relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img129relation.png b/src/kile/symbols/relation/img129relation.png
new file mode 100644
index 0000000..afd195b
--- /dev/null
+++ b/src/kile/symbols/relation/img129relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img130relation.png b/src/kile/symbols/relation/img130relation.png
new file mode 100644
index 0000000..a4235c9
--- /dev/null
+++ b/src/kile/symbols/relation/img130relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img131relation.png b/src/kile/symbols/relation/img131relation.png
new file mode 100644
index 0000000..39b566c
--- /dev/null
+++ b/src/kile/symbols/relation/img131relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img132relation.png b/src/kile/symbols/relation/img132relation.png
new file mode 100644
index 0000000..f97c844
--- /dev/null
+++ b/src/kile/symbols/relation/img132relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img133relation.png b/src/kile/symbols/relation/img133relation.png
new file mode 100644
index 0000000..e205c57
--- /dev/null
+++ b/src/kile/symbols/relation/img133relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img134relation.png b/src/kile/symbols/relation/img134relation.png
new file mode 100644
index 0000000..2473157
--- /dev/null
+++ b/src/kile/symbols/relation/img134relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img135relation.png b/src/kile/symbols/relation/img135relation.png
new file mode 100644
index 0000000..e8d523f
--- /dev/null
+++ b/src/kile/symbols/relation/img135relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img136relation.png b/src/kile/symbols/relation/img136relation.png
new file mode 100644
index 0000000..42e145b
--- /dev/null
+++ b/src/kile/symbols/relation/img136relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img137relation.png b/src/kile/symbols/relation/img137relation.png
new file mode 100644
index 0000000..62f04e9
--- /dev/null
+++ b/src/kile/symbols/relation/img137relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img138relation.png b/src/kile/symbols/relation/img138relation.png
new file mode 100644
index 0000000..6367556
--- /dev/null
+++ b/src/kile/symbols/relation/img138relation.png
Binary files differ
diff --git a/src/kile/symbols/relation/img139relation.png b/src/kile/symbols/relation/img139relation.png
new file mode 100644
index 0000000..90f8141
--- /dev/null
+++ b/src/kile/symbols/relation/img139relation.png
Binary files differ
diff --git a/src/kile/symbols/special.tex b/src/kile/symbols/special.tex
new file mode 100644
index 0000000..1d01374
--- /dev/null
+++ b/src/kile/symbols/special.tex
@@ -0,0 +1,196 @@
+\documentclass[a4paper,10pt]{article}
+\usepackage[latin10]{inputenc}
+\usepackage[T1]{fontenc}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Author: Thomas Braun
+% begin: Sat Nov 12 2005
+% last edit: Fri april 7 2006
+% License: GPLv2 or later
+%
+% covers latin1, latin2 and latin4
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\include{definitions}
+
+\begin{document}
+%
+\command{\"{A}}
+\command{\H{A}}
+\command{\'{A}}
+\command{\`{A}}
+\command{\~{A}}
+\command{\^{A}}
+\command{\v{A}}
+\command{\u{A}}
+\command{\={A}}
+\command{\AA{}}
+\pkgs[T1]{fontenc} \command{\k{A}}
+\command{\AE{}}
+\command{\"{a}}
+\command{\H{a}}
+\command{\'{a}}
+\command{\`{a}}
+\command{\~{a}}
+\command{\^{a}}
+\command{\v{a}}
+\command{\u{a}}
+\command{\={a}}
+\command{\aa{}}
+\pkgs[T1]{fontenc} \command{\k{a}}
+\command{\ae{}} \par
+\command{\'{C}}
+\command{\u{C}}
+\command{\c{C}}
+\command{\'{c}}
+\command{\u{c}}
+\command{\c{c}} \par
+\command{\v{D}}
+\pkgs[T1]{fontenc} \command{\DJ}
+\pkgs[T1]{fontenc} \command{\DH}
+\command{\v{d}}
+\pkgs[T1]{fontenc} \command{\dj}
+\pkgs[T1]{fontenc} \command{\dh} \par
+\command{\"{E}}
+\command{\H{E}}
+\command{\.{E}}
+\command{\'{E}}
+\command{\`{E}}
+\command{\^{E}}
+\command{\v{E}}
+\command{\u{E}}
+\command{\={E}}
+\pkgs[T1]{fontenc} \command{\k{E}}
+\command{\"{e}}
+\command{\H{e}}
+\command{\.{e}}
+\command{\'{e}}
+\command{\`{e}}
+\command{\^{e}}
+\command{\v{e}}
+\command{\u{e}}
+\command{\={e}}
+\pkgs[T1]{fontenc} \command{\k{e}} \par
+\command{\c{G}}
+\command{\'{G}}
+\command{\c{g}}
+\command{\'{g}} \par
+\command{\"{I}}
+\command{\H{I}}
+\command{\'{I}}
+\command{\`{I}}
+\command{\~{I}}
+\command{\^{I}}
+\command{\={I}}
+\pkgs[T1]{fontenc} \command{\k{I}}
+\command{\"{\i}}
+\command{\H{\i}}
+\command{\'{\i}}
+\command{\`{\i}}
+\command{\~{\i}}
+\command{\^{\i}}
+\command{\={\i}}
+\pkgs[T1]{fontenc} \command{\k{\i}} \par
+\command{\c{K}}
+\command{\c{k}} \par
+\command{\c{L}}
+\command{\'{L}}
+\command{\u{L}}
+\command{\v{L}}
+\command{\L}
+\command{\c{l}}
+\command{\'{l}}
+\command{\u{l}}
+\command{\v{l}}
+\command{\l} \par
+\command{\c{N}}
+\command{\'{N}}
+\command{\~{N}}
+\command{\v{N}}
+\command{\u{N}}
+\pkgs[T1]{fontenc} \command{\NG}
+\command{\c{n}}
+\command{\'{n}}
+\command{\~{n}}
+\command{\v{n}}
+\command{\u{n}}
+\pkgs[T1]{fontenc} \command{\ng} \par
+\command{\"{O}}
+\command{\H{O}}
+\command{\'{O}}
+\command{\`{O}}
+\command{\~{O}}
+\command{\^{O}}
+\command{\v{O}}
+\command{\u{O}}
+\command{\={O}}
+\command{\O{}}
+\command{\OE}
+\pkgs[T1]{fontenc} \command{\k{O}}
+\command{\"{o}}
+\command{\H{o}}
+\command{\'{o}}
+\command{\`{o}}
+\command{\~{o}}
+\command{\^{o}}
+\command{\v{o}}
+\command{\u{o}}
+\command{\={o}}
+\command{\o{}}
+\command{\oe}
+\pkgs[T1]{fontenc} \command{\k{o}} \par
+\pkgs[T1]{fontenc} \command{\TH}
+\pkgs[T1]{fontenc} \command{\th} \par
+\command{\c{R}}
+\command{\'{R}}
+\command{\v{R}}
+\command{\c{r}}
+\command{\'{r}}
+\command{\v{r}} \par
+\command{\c{S}}
+\pkgs[latin10]{inputenc} \command{\textcommabelow{S}}
+\command{\'{S}}
+\command{\v{S}}
+\command{\c{s}}
+\pkgs[latin10]{inputenc} \command{\textcommabelow{s}}
+\command{\'{s}}
+\command{\v{s}}
+\command{\ss} \par
+\command{\c{T}}
+\pkgs[latin10]{inputenc} \command{\textcommabelow{T}}
+\command{\v{T}}
+\command{\mbox{T\hspace{-.5em}-}} % hint from samin.dtx (babel package)
+\command{\c{t}}
+\pkgs[latin10]{inputenc} \command{\textcommabelow{t}}
+\command{\v{t}}
+\command{\mbox{t\hspace{-.35em}-}} \par
+\command{\"{U}}
+\command{\H{U}}
+\command{\'{U}}
+\command{\`{U}}
+\command{\~{U}}
+\command{\^{U}}
+\command{\={U}}
+\command{\r{U}}
+\pkgs[T1]{fontenc} \command{\k{U}}
+\command{\"{u}}
+\command{\H{u}}
+\command{\'{u}}
+\command{\`{u}}
+\command{\~{u}}
+\command{\^{u}}
+\command{\={u}}
+\command{\r{u}}
+\pkgs[T1]{fontenc} \command{\k{u}} \par
+\command{\"{Y}}
+\command{\'{Y}}
+\command{\"{y}}
+\command{\'{y}} \par
+\command{\.{Z}}
+\command{\'{Z}}
+\command{\v{Z}}
+\command{\.{z}}
+\command{\'{z}}
+\command{\v{z}} \par
+\end{document}
+
diff --git a/src/kile/symbols/special/CMakeLists.txt b/src/kile/symbols/special/CMakeLists.txt
new file mode 100644
index 0000000..fd33f03
--- /dev/null
+++ b/src/kile/symbols/special/CMakeLists.txt
@@ -0,0 +1,184 @@
+
+########### install files ###############
+
+SET( symbols
+ img001special.png
+ img002special.png
+ img003special.png
+ img004special.png
+ img005special.png
+ img006special.png
+ img007special.png
+ img008special.png
+ img009special.png
+ img010special.png
+ img011special.png
+ img012special.png
+ img013special.png
+ img014special.png
+ img015special.png
+ img016special.png
+ img017special.png
+ img018special.png
+ img019special.png
+ img020special.png
+ img021special.png
+ img022special.png
+ img023special.png
+ img024special.png
+ img025special.png
+ img026special.png
+ img027special.png
+ img028special.png
+ img029special.png
+ img030special.png
+ img031special.png
+ img032special.png
+ img033special.png
+ img034special.png
+ img035special.png
+ img036special.png
+ img037special.png
+ img038special.png
+ img039special.png
+ img040special.png
+ img041special.png
+ img042special.png
+ img043special.png
+ img044special.png
+ img045special.png
+ img046special.png
+ img047special.png
+ img048special.png
+ img049special.png
+ img050special.png
+ img051special.png
+ img052special.png
+ img053special.png
+ img054special.png
+ img055special.png
+ img056special.png
+ img057special.png
+ img058special.png
+ img059special.png
+ img060special.png
+ img061special.png
+ img062special.png
+ img063special.png
+ img064special.png
+ img065special.png
+ img066special.png
+ img067special.png
+ img068special.png
+ img069special.png
+ img070special.png
+ img071special.png
+ img072special.png
+ img073special.png
+ img074special.png
+ img075special.png
+ img076special.png
+ img077special.png
+ img078special.png
+ img079special.png
+ img080special.png
+ img081special.png
+ img082special.png
+ img083special.png
+ img084special.png
+ img085special.png
+ img086special.png
+ img087special.png
+ img088special.png
+ img089special.png
+ img090special.png
+ img091special.png
+ img092special.png
+ img093special.png
+ img094special.png
+ img095special.png
+ img096special.png
+ img097special.png
+ img098special.png
+ img099special.png
+ img100special.png
+ img101special.png
+ img102special.png
+ img103special.png
+ img104special.png
+ img105special.png
+ img106special.png
+ img107special.png
+ img108special.png
+ img109special.png
+ img110special.png
+ img111special.png
+ img112special.png
+ img113special.png
+ img114special.png
+ img115special.png
+ img116special.png
+ img117special.png
+ img118special.png
+ img119special.png
+ img120special.png
+ img121special.png
+ img122special.png
+ img123special.png
+ img124special.png
+ img125special.png
+ img126special.png
+ img127special.png
+ img128special.png
+ img129special.png
+ img130special.png
+ img131special.png
+ img132special.png
+ img133special.png
+ img134special.png
+ img135special.png
+ img136special.png
+ img137special.png
+ img138special.png
+ img139special.png
+ img140special.png
+ img141special.png
+ img142special.png
+ img143special.png
+ img144special.png
+ img145special.png
+ img146special.png
+ img147special.png
+ img148special.png
+ img149special.png
+ img150special.png
+ img151special.png
+ img152special.png
+ img153special.png
+ img154special.png
+ img155special.png
+ img156special.png
+ img157special.png
+ img158special.png
+ img159special.png
+ img160special.png
+ img161special.png
+ img162special.png
+ img163special.png
+ img164special.png
+ img165special.png
+ img166special.png
+ img167special.png
+ img168special.png
+ img169special.png
+ img170special.png
+ img171special.png
+ img172special.png
+ img173special.png
+ img174special.png
+ img175special.png
+ img176special.png
+ img177special.png
+)
+
+INSTALL( FILES ${symbols} DESTINATION share/apps/kile/mathsymbols/special )
diff --git a/src/kile/symbols/special/Makefile.am b/src/kile/symbols/special/Makefile.am
new file mode 100644
index 0000000..3bef83f
--- /dev/null
+++ b/src/kile/symbols/special/Makefile.am
@@ -0,0 +1,179 @@
+picsdir = $(kde_datadir)/kile/mathsymbols/special
+
+pics_DATA = img001special.png \
+ img002special.png \
+ img003special.png \
+ img004special.png \
+ img005special.png \
+ img006special.png \
+ img007special.png \
+ img008special.png \
+ img009special.png \
+ img010special.png \
+ img011special.png \
+ img012special.png \
+ img013special.png \
+ img014special.png \
+ img015special.png \
+ img016special.png \
+ img017special.png \
+ img018special.png \
+ img019special.png \
+ img020special.png \
+ img021special.png \
+ img022special.png \
+ img023special.png \
+ img024special.png \
+ img025special.png \
+ img026special.png \
+ img027special.png \
+ img028special.png \
+ img029special.png \
+ img030special.png \
+ img031special.png \
+ img032special.png \
+ img033special.png \
+ img034special.png \
+ img035special.png \
+ img036special.png \
+ img037special.png \
+ img038special.png \
+ img039special.png \
+ img040special.png \
+ img041special.png \
+ img042special.png \
+ img043special.png \
+ img044special.png \
+ img045special.png \
+ img046special.png \
+ img047special.png \
+ img048special.png \
+ img049special.png \
+ img050special.png \
+ img051special.png \
+ img052special.png \
+ img053special.png \
+ img054special.png \
+ img055special.png \
+ img056special.png \
+ img057special.png \
+ img058special.png \
+ img059special.png \
+ img060special.png \
+ img061special.png \
+ img062special.png \
+ img063special.png \
+ img064special.png \
+ img065special.png \
+ img066special.png \
+ img067special.png \
+ img068special.png \
+ img069special.png \
+ img070special.png \
+ img071special.png \
+ img072special.png \
+ img073special.png \
+ img074special.png \
+ img075special.png \
+ img076special.png \
+ img077special.png \
+ img078special.png \
+ img079special.png \
+ img080special.png \
+ img081special.png \
+ img082special.png \
+ img083special.png \
+ img084special.png \
+ img085special.png \
+ img086special.png \
+ img087special.png \
+ img088special.png \
+ img089special.png \
+ img090special.png \
+ img091special.png \
+ img092special.png \
+ img093special.png \
+ img094special.png \
+ img095special.png \
+ img096special.png \
+ img097special.png \
+ img098special.png \
+ img099special.png \
+ img100special.png \
+ img101special.png \
+ img102special.png \
+ img103special.png \
+ img104special.png \
+ img105special.png \
+ img106special.png \
+ img107special.png \
+ img108special.png \
+ img109special.png \
+ img110special.png \
+ img111special.png \
+ img112special.png \
+ img113special.png \
+ img114special.png \
+ img115special.png \
+ img116special.png \
+ img117special.png \
+ img118special.png \
+ img119special.png \
+ img120special.png \
+ img121special.png \
+ img122special.png \
+ img123special.png \
+ img124special.png \
+ img125special.png \
+ img126special.png \
+ img127special.png \
+ img128special.png \
+ img129special.png \
+ img130special.png \
+ img131special.png \
+ img132special.png \
+ img133special.png \
+ img134special.png \
+ img135special.png \
+ img136special.png \
+ img137special.png \
+ img138special.png \
+ img139special.png \
+ img140special.png \
+ img141special.png \
+ img142special.png \
+ img143special.png \
+ img144special.png \
+ img145special.png \
+ img146special.png \
+ img147special.png \
+ img148special.png \
+ img149special.png \
+ img150special.png \
+ img151special.png \
+ img152special.png \
+ img153special.png \
+ img154special.png \
+ img155special.png \
+ img156special.png \
+ img157special.png \
+ img158special.png \
+ img159special.png \
+ img160special.png \
+ img161special.png \
+ img162special.png \
+ img163special.png \
+ img164special.png \
+ img165special.png \
+ img166special.png \
+ img167special.png \
+ img168special.png \
+ img169special.png \
+ img170special.png \
+ img171special.png \
+ img172special.png \
+ img173special.png \
+ img174special.png \
+ img175special.png \
+ img176special.png \
+ img177special.png
diff --git a/src/kile/symbols/special/img001special.png b/src/kile/symbols/special/img001special.png
new file mode 100644
index 0000000..a5b5956
--- /dev/null
+++ b/src/kile/symbols/special/img001special.png
Binary files differ
diff --git a/src/kile/symbols/special/img002special.png b/src/kile/symbols/special/img002special.png
new file mode 100644
index 0000000..7fd7182
--- /dev/null
+++ b/src/kile/symbols/special/img002special.png
Binary files differ
diff --git a/src/kile/symbols/special/img003special.png b/src/kile/symbols/special/img003special.png
new file mode 100644
index 0000000..f2ed2c5
--- /dev/null
+++ b/src/kile/symbols/special/img003special.png
Binary files differ
diff --git a/src/kile/symbols/special/img004special.png b/src/kile/symbols/special/img004special.png
new file mode 100644
index 0000000..5bcd415
--- /dev/null
+++ b/src/kile/symbols/special/img004special.png
Binary files differ
diff --git a/src/kile/symbols/special/img005special.png b/src/kile/symbols/special/img005special.png
new file mode 100644
index 0000000..559b25d
--- /dev/null
+++ b/src/kile/symbols/special/img005special.png
Binary files differ
diff --git a/src/kile/symbols/special/img006special.png b/src/kile/symbols/special/img006special.png
new file mode 100644
index 0000000..3ced26c
--- /dev/null
+++ b/src/kile/symbols/special/img006special.png
Binary files differ
diff --git a/src/kile/symbols/special/img007special.png b/src/kile/symbols/special/img007special.png
new file mode 100644
index 0000000..8ac4c61
--- /dev/null
+++ b/src/kile/symbols/special/img007special.png
Binary files differ
diff --git a/src/kile/symbols/special/img008special.png b/src/kile/symbols/special/img008special.png
new file mode 100644
index 0000000..f304765
--- /dev/null
+++ b/src/kile/symbols/special/img008special.png
Binary files differ
diff --git a/src/kile/symbols/special/img009special.png b/src/kile/symbols/special/img009special.png
new file mode 100644
index 0000000..9353975
--- /dev/null
+++ b/src/kile/symbols/special/img009special.png
Binary files differ
diff --git a/src/kile/symbols/special/img010special.png b/src/kile/symbols/special/img010special.png
new file mode 100644
index 0000000..27ef154
--- /dev/null
+++ b/src/kile/symbols/special/img010special.png
Binary files differ
diff --git a/src/kile/symbols/special/img011special.png b/src/kile/symbols/special/img011special.png
new file mode 100644
index 0000000..c5c62b7
--- /dev/null
+++ b/src/kile/symbols/special/img011special.png
Binary files differ
diff --git a/src/kile/symbols/special/img012special.png b/src/kile/symbols/special/img012special.png
new file mode 100644
index 0000000..c6219ae
--- /dev/null
+++ b/src/kile/symbols/special/img012special.png
Binary files differ
diff --git a/src/kile/symbols/special/img013special.png b/src/kile/symbols/special/img013special.png
new file mode 100644
index 0000000..0306758
--- /dev/null
+++ b/src/kile/symbols/special/img013special.png
Binary files differ
diff --git a/src/kile/symbols/special/img014special.png b/src/kile/symbols/special/img014special.png
new file mode 100644
index 0000000..5077427
--- /dev/null
+++ b/src/kile/symbols/special/img014special.png
Binary files differ
diff --git a/src/kile/symbols/special/img015special.png b/src/kile/symbols/special/img015special.png
new file mode 100644
index 0000000..b3ae0d9
--- /dev/null
+++ b/src/kile/symbols/special/img015special.png
Binary files differ
diff --git a/src/kile/symbols/special/img016special.png b/src/kile/symbols/special/img016special.png
new file mode 100644
index 0000000..1d7be94
--- /dev/null
+++ b/src/kile/symbols/special/img016special.png
Binary files differ
diff --git a/src/kile/symbols/special/img017special.png b/src/kile/symbols/special/img017special.png
new file mode 100644
index 0000000..85748c1
--- /dev/null
+++ b/src/kile/symbols/special/img017special.png
Binary files differ
diff --git a/src/kile/symbols/special/img018special.png b/src/kile/symbols/special/img018special.png
new file mode 100644
index 0000000..cb65c40
--- /dev/null
+++ b/src/kile/symbols/special/img018special.png
Binary files differ
diff --git a/src/kile/symbols/special/img019special.png b/src/kile/symbols/special/img019special.png
new file mode 100644
index 0000000..6359ba9
--- /dev/null
+++ b/src/kile/symbols/special/img019special.png
Binary files differ
diff --git a/src/kile/symbols/special/img020special.png b/src/kile/symbols/special/img020special.png
new file mode 100644
index 0000000..49f7d3e
--- /dev/null
+++ b/src/kile/symbols/special/img020special.png
Binary files differ
diff --git a/src/kile/symbols/special/img021special.png b/src/kile/symbols/special/img021special.png
new file mode 100644
index 0000000..c508c51
--- /dev/null
+++ b/src/kile/symbols/special/img021special.png
Binary files differ
diff --git a/src/kile/symbols/special/img022special.png b/src/kile/symbols/special/img022special.png
new file mode 100644
index 0000000..1ba428a
--- /dev/null
+++ b/src/kile/symbols/special/img022special.png
Binary files differ
diff --git a/src/kile/symbols/special/img023special.png b/src/kile/symbols/special/img023special.png
new file mode 100644
index 0000000..e7eccba
--- /dev/null
+++ b/src/kile/symbols/special/img023special.png
Binary files differ
diff --git a/src/kile/symbols/special/img024special.png b/src/kile/symbols/special/img024special.png
new file mode 100644
index 0000000..56523ff
--- /dev/null
+++ b/src/kile/symbols/special/img024special.png
Binary files differ
diff --git a/src/kile/symbols/special/img025special.png b/src/kile/symbols/special/img025special.png
new file mode 100644
index 0000000..97fa86b
--- /dev/null
+++ b/src/kile/symbols/special/img025special.png
Binary files differ
diff --git a/src/kile/symbols/special/img026special.png b/src/kile/symbols/special/img026special.png
new file mode 100644
index 0000000..5bc62d2
--- /dev/null
+++ b/src/kile/symbols/special/img026special.png
Binary files differ
diff --git a/src/kile/symbols/special/img027special.png b/src/kile/symbols/special/img027special.png
new file mode 100644
index 0000000..d0ea45d
--- /dev/null
+++ b/src/kile/symbols/special/img027special.png
Binary files differ
diff --git a/src/kile/symbols/special/img028special.png b/src/kile/symbols/special/img028special.png
new file mode 100644
index 0000000..e5f23c1
--- /dev/null
+++ b/src/kile/symbols/special/img028special.png
Binary files differ
diff --git a/src/kile/symbols/special/img029special.png b/src/kile/symbols/special/img029special.png
new file mode 100644
index 0000000..f5086ce
--- /dev/null
+++ b/src/kile/symbols/special/img029special.png
Binary files differ
diff --git a/src/kile/symbols/special/img030special.png b/src/kile/symbols/special/img030special.png
new file mode 100644
index 0000000..3e5f1c9
--- /dev/null
+++ b/src/kile/symbols/special/img030special.png
Binary files differ
diff --git a/src/kile/symbols/special/img031special.png b/src/kile/symbols/special/img031special.png
new file mode 100644
index 0000000..7808174
--- /dev/null
+++ b/src/kile/symbols/special/img031special.png
Binary files differ
diff --git a/src/kile/symbols/special/img032special.png b/src/kile/symbols/special/img032special.png
new file mode 100644
index 0000000..5f1cd8c
--- /dev/null
+++ b/src/kile/symbols/special/img032special.png
Binary files differ
diff --git a/src/kile/symbols/special/img033special.png b/src/kile/symbols/special/img033special.png
new file mode 100644
index 0000000..f898f3c
--- /dev/null
+++ b/src/kile/symbols/special/img033special.png
Binary files differ
diff --git a/src/kile/symbols/special/img034special.png b/src/kile/symbols/special/img034special.png
new file mode 100644
index 0000000..0325737
--- /dev/null
+++ b/src/kile/symbols/special/img034special.png
Binary files differ
diff --git a/src/kile/symbols/special/img035special.png b/src/kile/symbols/special/img035special.png
new file mode 100644
index 0000000..e60b4f0
--- /dev/null
+++ b/src/kile/symbols/special/img035special.png
Binary files differ
diff --git a/src/kile/symbols/special/img036special.png b/src/kile/symbols/special/img036special.png
new file mode 100644
index 0000000..0187bff
--- /dev/null
+++ b/src/kile/symbols/special/img036special.png
Binary files differ
diff --git a/src/kile/symbols/special/img037special.png b/src/kile/symbols/special/img037special.png
new file mode 100644
index 0000000..7db247c
--- /dev/null
+++ b/src/kile/symbols/special/img037special.png
Binary files differ
diff --git a/src/kile/symbols/special/img038special.png b/src/kile/symbols/special/img038special.png
new file mode 100644
index 0000000..3d7d656
--- /dev/null
+++ b/src/kile/symbols/special/img038special.png
Binary files differ
diff --git a/src/kile/symbols/special/img039special.png b/src/kile/symbols/special/img039special.png
new file mode 100644
index 0000000..c408f20
--- /dev/null
+++ b/src/kile/symbols/special/img039special.png
Binary files differ
diff --git a/src/kile/symbols/special/img040special.png b/src/kile/symbols/special/img040special.png
new file mode 100644
index 0000000..31d54a0
--- /dev/null
+++ b/src/kile/symbols/special/img040special.png
Binary files differ
diff --git a/src/kile/symbols/special/img041special.png b/src/kile/symbols/special/img041special.png
new file mode 100644
index 0000000..21b59c8
--- /dev/null
+++ b/src/kile/symbols/special/img041special.png
Binary files differ
diff --git a/src/kile/symbols/special/img042special.png b/src/kile/symbols/special/img042special.png
new file mode 100644
index 0000000..3b50ffb
--- /dev/null
+++ b/src/kile/symbols/special/img042special.png
Binary files differ
diff --git a/src/kile/symbols/special/img043special.png b/src/kile/symbols/special/img043special.png
new file mode 100644
index 0000000..506d418
--- /dev/null
+++ b/src/kile/symbols/special/img043special.png
Binary files differ
diff --git a/src/kile/symbols/special/img044special.png b/src/kile/symbols/special/img044special.png
new file mode 100644
index 0000000..dad83e5
--- /dev/null
+++ b/src/kile/symbols/special/img044special.png
Binary files differ
diff --git a/src/kile/symbols/special/img045special.png b/src/kile/symbols/special/img045special.png
new file mode 100644
index 0000000..dfec729
--- /dev/null
+++ b/src/kile/symbols/special/img045special.png
Binary files differ
diff --git a/src/kile/symbols/special/img046special.png b/src/kile/symbols/special/img046special.png
new file mode 100644
index 0000000..5bb5e64
--- /dev/null
+++ b/src/kile/symbols/special/img046special.png
Binary files differ
diff --git a/src/kile/symbols/special/img047special.png b/src/kile/symbols/special/img047special.png
new file mode 100644
index 0000000..b6282a1
--- /dev/null
+++ b/src/kile/symbols/special/img047special.png
Binary files differ
diff --git a/src/kile/symbols/special/img048special.png b/src/kile/symbols/special/img048special.png
new file mode 100644
index 0000000..e1a6a87
--- /dev/null
+++ b/src/kile/symbols/special/img048special.png
Binary files differ
diff --git a/src/kile/symbols/special/img049special.png b/src/kile/symbols/special/img049special.png
new file mode 100644
index 0000000..8c4f9cd
--- /dev/null
+++ b/src/kile/symbols/special/img049special.png
Binary files differ
diff --git a/src/kile/symbols/special/img050special.png b/src/kile/symbols/special/img050special.png
new file mode 100644
index 0000000..0b14d42
--- /dev/null
+++ b/src/kile/symbols/special/img050special.png
Binary files differ
diff --git a/src/kile/symbols/special/img051special.png b/src/kile/symbols/special/img051special.png
new file mode 100644
index 0000000..bf3addb
--- /dev/null
+++ b/src/kile/symbols/special/img051special.png
Binary files differ
diff --git a/src/kile/symbols/special/img052special.png b/src/kile/symbols/special/img052special.png
new file mode 100644
index 0000000..249d7b8
--- /dev/null
+++ b/src/kile/symbols/special/img052special.png
Binary files differ
diff --git a/src/kile/symbols/special/img053special.png b/src/kile/symbols/special/img053special.png
new file mode 100644
index 0000000..4942cf8
--- /dev/null
+++ b/src/kile/symbols/special/img053special.png
Binary files differ
diff --git a/src/kile/symbols/special/img054special.png b/src/kile/symbols/special/img054special.png
new file mode 100644
index 0000000..c79e5a8
--- /dev/null
+++ b/src/kile/symbols/special/img054special.png
Binary files differ
diff --git a/src/kile/symbols/special/img055special.png b/src/kile/symbols/special/img055special.png
new file mode 100644
index 0000000..92c9849
--- /dev/null
+++ b/src/kile/symbols/special/img055special.png
Binary files differ
diff --git a/src/kile/symbols/special/img056special.png b/src/kile/symbols/special/img056special.png
new file mode 100644
index 0000000..6147c68
--- /dev/null
+++ b/src/kile/symbols/special/img056special.png
Binary files differ
diff --git a/src/kile/symbols/special/img057special.png b/src/kile/symbols/special/img057special.png
new file mode 100644
index 0000000..8558ca3
--- /dev/null
+++ b/src/kile/symbols/special/img057special.png
Binary files differ
diff --git a/src/kile/symbols/special/img058special.png b/src/kile/symbols/special/img058special.png
new file mode 100644
index 0000000..801135b
--- /dev/null
+++ b/src/kile/symbols/special/img058special.png
Binary files differ
diff --git a/src/kile/symbols/special/img059special.png b/src/kile/symbols/special/img059special.png
new file mode 100644
index 0000000..87f2550
--- /dev/null
+++ b/src/kile/symbols/special/img059special.png
Binary files differ
diff --git a/src/kile/symbols/special/img060special.png b/src/kile/symbols/special/img060special.png
new file mode 100644
index 0000000..cf097ae
--- /dev/null
+++ b/src/kile/symbols/special/img060special.png
Binary files differ
diff --git a/src/kile/symbols/special/img061special.png b/src/kile/symbols/special/img061special.png
new file mode 100644
index 0000000..14571ba
--- /dev/null
+++ b/src/kile/symbols/special/img061special.png
Binary files differ
diff --git a/src/kile/symbols/special/img062special.png b/src/kile/symbols/special/img062special.png
new file mode 100644
index 0000000..4b63ce3
--- /dev/null
+++ b/src/kile/symbols/special/img062special.png
Binary files differ
diff --git a/src/kile/symbols/special/img063special.png b/src/kile/symbols/special/img063special.png
new file mode 100644
index 0000000..915ad31
--- /dev/null
+++ b/src/kile/symbols/special/img063special.png
Binary files differ
diff --git a/src/kile/symbols/special/img064special.png b/src/kile/symbols/special/img064special.png
new file mode 100644
index 0000000..9148f62
--- /dev/null
+++ b/src/kile/symbols/special/img064special.png
Binary files differ
diff --git a/src/kile/symbols/special/img065special.png b/src/kile/symbols/special/img065special.png
new file mode 100644
index 0000000..dca61b5
--- /dev/null
+++ b/src/kile/symbols/special/img065special.png
Binary files differ
diff --git a/src/kile/symbols/special/img066special.png b/src/kile/symbols/special/img066special.png
new file mode 100644
index 0000000..4216967
--- /dev/null
+++ b/src/kile/symbols/special/img066special.png
Binary files differ
diff --git a/src/kile/symbols/special/img067special.png b/src/kile/symbols/special/img067special.png
new file mode 100644
index 0000000..a277cf4
--- /dev/null
+++ b/src/kile/symbols/special/img067special.png
Binary files differ
diff --git a/src/kile/symbols/special/img068special.png b/src/kile/symbols/special/img068special.png
new file mode 100644
index 0000000..025f3a7
--- /dev/null
+++ b/src/kile/symbols/special/img068special.png
Binary files differ
diff --git a/src/kile/symbols/special/img069special.png b/src/kile/symbols/special/img069special.png
new file mode 100644
index 0000000..0e62f38
--- /dev/null
+++ b/src/kile/symbols/special/img069special.png
Binary files differ
diff --git a/src/kile/symbols/special/img070special.png b/src/kile/symbols/special/img070special.png
new file mode 100644
index 0000000..8a6fb5c
--- /dev/null
+++ b/src/kile/symbols/special/img070special.png
Binary files differ
diff --git a/src/kile/symbols/special/img071special.png b/src/kile/symbols/special/img071special.png
new file mode 100644
index 0000000..e0af401
--- /dev/null
+++ b/src/kile/symbols/special/img071special.png
Binary files differ
diff --git a/src/kile/symbols/special/img072special.png b/src/kile/symbols/special/img072special.png
new file mode 100644
index 0000000..71c43a1
--- /dev/null
+++ b/src/kile/symbols/special/img072special.png
Binary files differ
diff --git a/src/kile/symbols/special/img073special.png b/src/kile/symbols/special/img073special.png
new file mode 100644
index 0000000..f5d7d55
--- /dev/null
+++ b/src/kile/symbols/special/img073special.png
Binary files differ
diff --git a/src/kile/symbols/special/img074special.png b/src/kile/symbols/special/img074special.png
new file mode 100644
index 0000000..28f025d
--- /dev/null
+++ b/src/kile/symbols/special/img074special.png
Binary files differ
diff --git a/src/kile/symbols/special/img075special.png b/src/kile/symbols/special/img075special.png
new file mode 100644
index 0000000..360c38d
--- /dev/null
+++ b/src/kile/symbols/special/img075special.png
Binary files differ
diff --git a/src/kile/symbols/special/img076special.png b/src/kile/symbols/special/img076special.png
new file mode 100644
index 0000000..9d757b1
--- /dev/null
+++ b/src/kile/symbols/special/img076special.png
Binary files differ
diff --git a/src/kile/symbols/special/img077special.png b/src/kile/symbols/special/img077special.png
new file mode 100644
index 0000000..e25c261
--- /dev/null
+++ b/src/kile/symbols/special/img077special.png
Binary files differ
diff --git a/src/kile/symbols/special/img078special.png b/src/kile/symbols/special/img078special.png
new file mode 100644
index 0000000..eb89ae2
--- /dev/null
+++ b/src/kile/symbols/special/img078special.png
Binary files differ
diff --git a/src/kile/symbols/special/img079special.png b/src/kile/symbols/special/img079special.png
new file mode 100644
index 0000000..d43dc38
--- /dev/null
+++ b/src/kile/symbols/special/img079special.png
Binary files differ
diff --git a/src/kile/symbols/special/img080special.png b/src/kile/symbols/special/img080special.png
new file mode 100644
index 0000000..8c3e93f
--- /dev/null
+++ b/src/kile/symbols/special/img080special.png
Binary files differ
diff --git a/src/kile/symbols/special/img081special.png b/src/kile/symbols/special/img081special.png
new file mode 100644
index 0000000..777f254
--- /dev/null
+++ b/src/kile/symbols/special/img081special.png
Binary files differ
diff --git a/src/kile/symbols/special/img082special.png b/src/kile/symbols/special/img082special.png
new file mode 100644
index 0000000..6a3f770
--- /dev/null
+++ b/src/kile/symbols/special/img082special.png
Binary files differ
diff --git a/src/kile/symbols/special/img083special.png b/src/kile/symbols/special/img083special.png
new file mode 100644
index 0000000..9477330
--- /dev/null
+++ b/src/kile/symbols/special/img083special.png
Binary files differ
diff --git a/src/kile/symbols/special/img084special.png b/src/kile/symbols/special/img084special.png
new file mode 100644
index 0000000..6dbaad6
--- /dev/null
+++ b/src/kile/symbols/special/img084special.png
Binary files differ
diff --git a/src/kile/symbols/special/img085special.png b/src/kile/symbols/special/img085special.png
new file mode 100644
index 0000000..d83122e
--- /dev/null
+++ b/src/kile/symbols/special/img085special.png
Binary files differ
diff --git a/src/kile/symbols/special/img086special.png b/src/kile/symbols/special/img086special.png
new file mode 100644
index 0000000..8d52cd2
--- /dev/null
+++ b/src/kile/symbols/special/img086special.png
Binary files differ
diff --git a/src/kile/symbols/special/img087special.png b/src/kile/symbols/special/img087special.png
new file mode 100644
index 0000000..ab18c38
--- /dev/null
+++ b/src/kile/symbols/special/img087special.png
Binary files differ
diff --git a/src/kile/symbols/special/img088special.png b/src/kile/symbols/special/img088special.png
new file mode 100644
index 0000000..196bd62
--- /dev/null
+++ b/src/kile/symbols/special/img088special.png
Binary files differ
diff --git a/src/kile/symbols/special/img089special.png b/src/kile/symbols/special/img089special.png
new file mode 100644
index 0000000..8b71aaf
--- /dev/null
+++ b/src/kile/symbols/special/img089special.png
Binary files differ
diff --git a/src/kile/symbols/special/img090special.png b/src/kile/symbols/special/img090special.png
new file mode 100644
index 0000000..7894aae
--- /dev/null
+++ b/src/kile/symbols/special/img090special.png
Binary files differ
diff --git a/src/kile/symbols/special/img091special.png b/src/kile/symbols/special/img091special.png
new file mode 100644
index 0000000..b6b68cd
--- /dev/null
+++ b/src/kile/symbols/special/img091special.png
Binary files differ
diff --git a/src/kile/symbols/special/img092special.png b/src/kile/symbols/special/img092special.png
new file mode 100644
index 0000000..50d30f5
--- /dev/null
+++ b/src/kile/symbols/special/img092special.png
Binary files differ
diff --git a/src/kile/symbols/special/img093special.png b/src/kile/symbols/special/img093special.png
new file mode 100644
index 0000000..ed06fd4
--- /dev/null
+++ b/src/kile/symbols/special/img093special.png
Binary files differ
diff --git a/src/kile/symbols/special/img094special.png b/src/kile/symbols/special/img094special.png
new file mode 100644
index 0000000..42ab7ca
--- /dev/null
+++ b/src/kile/symbols/special/img094special.png
Binary files differ
diff --git a/src/kile/symbols/special/img095special.png b/src/kile/symbols/special/img095special.png
new file mode 100644
index 0000000..e3f64b0
--- /dev/null
+++ b/src/kile/symbols/special/img095special.png
Binary files differ
diff --git a/src/kile/symbols/special/img096special.png b/src/kile/symbols/special/img096special.png
new file mode 100644
index 0000000..5f795d7
--- /dev/null
+++ b/src/kile/symbols/special/img096special.png
Binary files differ
diff --git a/src/kile/symbols/special/img097special.png b/src/kile/symbols/special/img097special.png
new file mode 100644
index 0000000..f1b7031
--- /dev/null
+++ b/src/kile/symbols/special/img097special.png
Binary files differ
diff --git a/src/kile/symbols/special/img098special.png b/src/kile/symbols/special/img098special.png
new file mode 100644
index 0000000..80a7d59
--- /dev/null
+++ b/src/kile/symbols/special/img098special.png
Binary files differ
diff --git a/src/kile/symbols/special/img099special.png b/src/kile/symbols/special/img099special.png
new file mode 100644
index 0000000..dc4409e
--- /dev/null
+++ b/src/kile/symbols/special/img099special.png
Binary files differ
diff --git a/src/kile/symbols/special/img100special.png b/src/kile/symbols/special/img100special.png
new file mode 100644
index 0000000..1cc7d89
--- /dev/null
+++ b/src/kile/symbols/special/img100special.png
Binary files differ
diff --git a/src/kile/symbols/special/img101special.png b/src/kile/symbols/special/img101special.png
new file mode 100644
index 0000000..5487233
--- /dev/null
+++ b/src/kile/symbols/special/img101special.png
Binary files differ
diff --git a/src/kile/symbols/special/img102special.png b/src/kile/symbols/special/img102special.png
new file mode 100644
index 0000000..d681ef6
--- /dev/null
+++ b/src/kile/symbols/special/img102special.png
Binary files differ
diff --git a/src/kile/symbols/special/img103special.png b/src/kile/symbols/special/img103special.png
new file mode 100644
index 0000000..cde8398
--- /dev/null
+++ b/src/kile/symbols/special/img103special.png
Binary files differ
diff --git a/src/kile/symbols/special/img104special.png b/src/kile/symbols/special/img104special.png
new file mode 100644
index 0000000..c62706e
--- /dev/null
+++ b/src/kile/symbols/special/img104special.png
Binary files differ
diff --git a/src/kile/symbols/special/img105special.png b/src/kile/symbols/special/img105special.png
new file mode 100644
index 0000000..7e633fd
--- /dev/null
+++ b/src/kile/symbols/special/img105special.png
Binary files differ
diff --git a/src/kile/symbols/special/img106special.png b/src/kile/symbols/special/img106special.png
new file mode 100644
index 0000000..bb47d89
--- /dev/null
+++ b/src/kile/symbols/special/img106special.png
Binary files differ
diff --git a/src/kile/symbols/special/img107special.png b/src/kile/symbols/special/img107special.png
new file mode 100644
index 0000000..7f1d1fd
--- /dev/null
+++ b/src/kile/symbols/special/img107special.png
Binary files differ
diff --git a/src/kile/symbols/special/img108special.png b/src/kile/symbols/special/img108special.png
new file mode 100644
index 0000000..ca4517d
--- /dev/null
+++ b/src/kile/symbols/special/img108special.png
Binary files differ
diff --git a/src/kile/symbols/special/img109special.png b/src/kile/symbols/special/img109special.png
new file mode 100644
index 0000000..078f765
--- /dev/null
+++ b/src/kile/symbols/special/img109special.png
Binary files differ
diff --git a/src/kile/symbols/special/img110special.png b/src/kile/symbols/special/img110special.png
new file mode 100644
index 0000000..1d1e7df
--- /dev/null
+++ b/src/kile/symbols/special/img110special.png
Binary files differ
diff --git a/src/kile/symbols/special/img111special.png b/src/kile/symbols/special/img111special.png
new file mode 100644
index 0000000..8bff25d
--- /dev/null
+++ b/src/kile/symbols/special/img111special.png
Binary files differ
diff --git a/src/kile/symbols/special/img112special.png b/src/kile/symbols/special/img112special.png
new file mode 100644
index 0000000..283a096
--- /dev/null
+++ b/src/kile/symbols/special/img112special.png
Binary files differ
diff --git a/src/kile/symbols/special/img113special.png b/src/kile/symbols/special/img113special.png
new file mode 100644
index 0000000..fc0703a
--- /dev/null
+++ b/src/kile/symbols/special/img113special.png
Binary files differ
diff --git a/src/kile/symbols/special/img114special.png b/src/kile/symbols/special/img114special.png
new file mode 100644
index 0000000..740235a
--- /dev/null
+++ b/src/kile/symbols/special/img114special.png
Binary files differ
diff --git a/src/kile/symbols/special/img115special.png b/src/kile/symbols/special/img115special.png
new file mode 100644
index 0000000..c2f6d57
--- /dev/null
+++ b/src/kile/symbols/special/img115special.png
Binary files differ
diff --git a/src/kile/symbols/special/img116special.png b/src/kile/symbols/special/img116special.png
new file mode 100644
index 0000000..d3e761c
--- /dev/null
+++ b/src/kile/symbols/special/img116special.png
Binary files differ
diff --git a/src/kile/symbols/special/img117special.png b/src/kile/symbols/special/img117special.png
new file mode 100644
index 0000000..5c1bc14
--- /dev/null
+++ b/src/kile/symbols/special/img117special.png
Binary files differ
diff --git a/src/kile/symbols/special/img118special.png b/src/kile/symbols/special/img118special.png
new file mode 100644
index 0000000..f74d6a4
--- /dev/null
+++ b/src/kile/symbols/special/img118special.png
Binary files differ
diff --git a/src/kile/symbols/special/img119special.png b/src/kile/symbols/special/img119special.png
new file mode 100644
index 0000000..9dab823
--- /dev/null
+++ b/src/kile/symbols/special/img119special.png
Binary files differ
diff --git a/src/kile/symbols/special/img120special.png b/src/kile/symbols/special/img120special.png
new file mode 100644
index 0000000..7003889
--- /dev/null
+++ b/src/kile/symbols/special/img120special.png
Binary files differ
diff --git a/src/kile/symbols/special/img121special.png b/src/kile/symbols/special/img121special.png
new file mode 100644
index 0000000..6f1800b
--- /dev/null
+++ b/src/kile/symbols/special/img121special.png
Binary files differ
diff --git a/src/kile/symbols/special/img122special.png b/src/kile/symbols/special/img122special.png
new file mode 100644
index 0000000..d159c73
--- /dev/null
+++ b/src/kile/symbols/special/img122special.png
Binary files differ
diff --git a/src/kile/symbols/special/img123special.png b/src/kile/symbols/special/img123special.png
new file mode 100644
index 0000000..f4fae6c
--- /dev/null
+++ b/src/kile/symbols/special/img123special.png
Binary files differ
diff --git a/src/kile/symbols/special/img124special.png b/src/kile/symbols/special/img124special.png
new file mode 100644
index 0000000..db6d4f7
--- /dev/null
+++ b/src/kile/symbols/special/img124special.png
Binary files differ
diff --git a/src/kile/symbols/special/img125special.png b/src/kile/symbols/special/img125special.png
new file mode 100644
index 0000000..4666ca3
--- /dev/null
+++ b/src/kile/symbols/special/img125special.png
Binary files differ
diff --git a/src/kile/symbols/special/img126special.png b/src/kile/symbols/special/img126special.png
new file mode 100644
index 0000000..2cbb77f
--- /dev/null
+++ b/src/kile/symbols/special/img126special.png
Binary files differ
diff --git a/src/kile/symbols/special/img127special.png b/src/kile/symbols/special/img127special.png
new file mode 100644
index 0000000..47c33f7
--- /dev/null
+++ b/src/kile/symbols/special/img127special.png
Binary files differ
diff --git a/src/kile/symbols/special/img128special.png b/src/kile/symbols/special/img128special.png
new file mode 100644
index 0000000..c22f0a9
--- /dev/null
+++ b/src/kile/symbols/special/img128special.png
Binary files differ
diff --git a/src/kile/symbols/special/img129special.png b/src/kile/symbols/special/img129special.png
new file mode 100644
index 0000000..0ca64c6
--- /dev/null
+++ b/src/kile/symbols/special/img129special.png
Binary files differ
diff --git a/src/kile/symbols/special/img130special.png b/src/kile/symbols/special/img130special.png
new file mode 100644
index 0000000..bea9022
--- /dev/null
+++ b/src/kile/symbols/special/img130special.png
Binary files differ
diff --git a/src/kile/symbols/special/img131special.png b/src/kile/symbols/special/img131special.png
new file mode 100644
index 0000000..4cfaef4
--- /dev/null
+++ b/src/kile/symbols/special/img131special.png
Binary files differ
diff --git a/src/kile/symbols/special/img132special.png b/src/kile/symbols/special/img132special.png
new file mode 100644
index 0000000..69777aa
--- /dev/null
+++ b/src/kile/symbols/special/img132special.png
Binary files differ
diff --git a/src/kile/symbols/special/img133special.png b/src/kile/symbols/special/img133special.png
new file mode 100644
index 0000000..3547c06
--- /dev/null
+++ b/src/kile/symbols/special/img133special.png
Binary files differ
diff --git a/src/kile/symbols/special/img134special.png b/src/kile/symbols/special/img134special.png
new file mode 100644
index 0000000..4927106
--- /dev/null
+++ b/src/kile/symbols/special/img134special.png
Binary files differ
diff --git a/src/kile/symbols/special/img135special.png b/src/kile/symbols/special/img135special.png
new file mode 100644
index 0000000..8aed4aa
--- /dev/null
+++ b/src/kile/symbols/special/img135special.png
Binary files differ
diff --git a/src/kile/symbols/special/img136special.png b/src/kile/symbols/special/img136special.png
new file mode 100644
index 0000000..459389c
--- /dev/null
+++ b/src/kile/symbols/special/img136special.png
Binary files differ
diff --git a/src/kile/symbols/special/img137special.png b/src/kile/symbols/special/img137special.png
new file mode 100644
index 0000000..ed546d1
--- /dev/null
+++ b/src/kile/symbols/special/img137special.png
Binary files differ
diff --git a/src/kile/symbols/special/img138special.png b/src/kile/symbols/special/img138special.png
new file mode 100644
index 0000000..36c8c58
--- /dev/null
+++ b/src/kile/symbols/special/img138special.png
Binary files differ
diff --git a/src/kile/symbols/special/img139special.png b/src/kile/symbols/special/img139special.png
new file mode 100644
index 0000000..c2d4fbb
--- /dev/null
+++ b/src/kile/symbols/special/img139special.png
Binary files differ
diff --git a/src/kile/symbols/special/img140special.png b/src/kile/symbols/special/img140special.png
new file mode 100644
index 0000000..cc9cb81
--- /dev/null
+++ b/src/kile/symbols/special/img140special.png
Binary files differ
diff --git a/src/kile/symbols/special/img141special.png b/src/kile/symbols/special/img141special.png
new file mode 100644
index 0000000..0347783
--- /dev/null
+++ b/src/kile/symbols/special/img141special.png
Binary files differ
diff --git a/src/kile/symbols/special/img142special.png b/src/kile/symbols/special/img142special.png
new file mode 100644
index 0000000..1220775
--- /dev/null
+++ b/src/kile/symbols/special/img142special.png
Binary files differ
diff --git a/src/kile/symbols/special/img143special.png b/src/kile/symbols/special/img143special.png
new file mode 100644
index 0000000..33ba3c9
--- /dev/null
+++ b/src/kile/symbols/special/img143special.png
Binary files differ
diff --git a/src/kile/symbols/special/img144special.png b/src/kile/symbols/special/img144special.png
new file mode 100644
index 0000000..d1b2b30
--- /dev/null
+++ b/src/kile/symbols/special/img144special.png
Binary files differ
diff --git a/src/kile/symbols/special/img145special.png b/src/kile/symbols/special/img145special.png
new file mode 100644
index 0000000..85e1c01
--- /dev/null
+++ b/src/kile/symbols/special/img145special.png
Binary files differ
diff --git a/src/kile/symbols/special/img146special.png b/src/kile/symbols/special/img146special.png
new file mode 100644
index 0000000..56cd853
--- /dev/null
+++ b/src/kile/symbols/special/img146special.png
Binary files differ
diff --git a/src/kile/symbols/special/img147special.png b/src/kile/symbols/special/img147special.png
new file mode 100644
index 0000000..9028975
--- /dev/null
+++ b/src/kile/symbols/special/img147special.png
Binary files differ
diff --git a/src/kile/symbols/special/img148special.png b/src/kile/symbols/special/img148special.png
new file mode 100644
index 0000000..e667e93
--- /dev/null
+++ b/src/kile/symbols/special/img148special.png
Binary files differ
diff --git a/src/kile/symbols/special/img149special.png b/src/kile/symbols/special/img149special.png
new file mode 100644
index 0000000..49594e4
--- /dev/null
+++ b/src/kile/symbols/special/img149special.png
Binary files differ
diff --git a/src/kile/symbols/special/img150special.png b/src/kile/symbols/special/img150special.png
new file mode 100644
index 0000000..53a8513
--- /dev/null
+++ b/src/kile/symbols/special/img150special.png
Binary files differ
diff --git a/src/kile/symbols/special/img151special.png b/src/kile/symbols/special/img151special.png
new file mode 100644
index 0000000..8c2eead
--- /dev/null
+++ b/src/kile/symbols/special/img151special.png
Binary files differ
diff --git a/src/kile/symbols/special/img152special.png b/src/kile/symbols/special/img152special.png
new file mode 100644
index 0000000..5e0b927
--- /dev/null
+++ b/src/kile/symbols/special/img152special.png
Binary files differ
diff --git a/src/kile/symbols/special/img153special.png b/src/kile/symbols/special/img153special.png
new file mode 100644
index 0000000..11358f3
--- /dev/null
+++ b/src/kile/symbols/special/img153special.png
Binary files differ
diff --git a/src/kile/symbols/special/img154special.png b/src/kile/symbols/special/img154special.png
new file mode 100644
index 0000000..a5c1aec
--- /dev/null
+++ b/src/kile/symbols/special/img154special.png
Binary files differ
diff --git a/src/kile/symbols/special/img155special.png b/src/kile/symbols/special/img155special.png
new file mode 100644
index 0000000..97289bc
--- /dev/null
+++ b/src/kile/symbols/special/img155special.png
Binary files differ
diff --git a/src/kile/symbols/special/img156special.png b/src/kile/symbols/special/img156special.png
new file mode 100644
index 0000000..5d3dd84
--- /dev/null
+++ b/src/kile/symbols/special/img156special.png
Binary files differ
diff --git a/src/kile/symbols/special/img157special.png b/src/kile/symbols/special/img157special.png
new file mode 100644
index 0000000..b456c77
--- /dev/null
+++ b/src/kile/symbols/special/img157special.png
Binary files differ
diff --git a/src/kile/symbols/special/img158special.png b/src/kile/symbols/special/img158special.png
new file mode 100644
index 0000000..5177436
--- /dev/null
+++ b/src/kile/symbols/special/img158special.png
Binary files differ
diff --git a/src/kile/symbols/special/img159special.png b/src/kile/symbols/special/img159special.png
new file mode 100644
index 0000000..12ee3b8
--- /dev/null
+++ b/src/kile/symbols/special/img159special.png
Binary files differ
diff --git a/src/kile/symbols/special/img160special.png b/src/kile/symbols/special/img160special.png
new file mode 100644
index 0000000..7749060
--- /dev/null
+++ b/src/kile/symbols/special/img160special.png
Binary files differ
diff --git a/src/kile/symbols/special/img161special.png b/src/kile/symbols/special/img161special.png
new file mode 100644
index 0000000..764e265
--- /dev/null
+++ b/src/kile/symbols/special/img161special.png
Binary files differ
diff --git a/src/kile/symbols/special/img162special.png b/src/kile/symbols/special/img162special.png
new file mode 100644
index 0000000..d9117f8
--- /dev/null
+++ b/src/kile/symbols/special/img162special.png
Binary files differ
diff --git a/src/kile/symbols/special/img163special.png b/src/kile/symbols/special/img163special.png
new file mode 100644
index 0000000..2f0256a
--- /dev/null
+++ b/src/kile/symbols/special/img163special.png
Binary files differ
diff --git a/src/kile/symbols/special/img164special.png b/src/kile/symbols/special/img164special.png
new file mode 100644
index 0000000..286799f
--- /dev/null
+++ b/src/kile/symbols/special/img164special.png
Binary files differ
diff --git a/src/kile/symbols/special/img165special.png b/src/kile/symbols/special/img165special.png
new file mode 100644
index 0000000..7bec735
--- /dev/null
+++ b/src/kile/symbols/special/img165special.png
Binary files differ
diff --git a/src/kile/symbols/special/img166special.png b/src/kile/symbols/special/img166special.png
new file mode 100644
index 0000000..96a54ce
--- /dev/null
+++ b/src/kile/symbols/special/img166special.png
Binary files differ
diff --git a/src/kile/symbols/special/img167special.png b/src/kile/symbols/special/img167special.png
new file mode 100644
index 0000000..4fd575d
--- /dev/null
+++ b/src/kile/symbols/special/img167special.png
Binary files differ
diff --git a/src/kile/symbols/special/img168special.png b/src/kile/symbols/special/img168special.png
new file mode 100644
index 0000000..9e12968
--- /dev/null
+++ b/src/kile/symbols/special/img168special.png
Binary files differ
diff --git a/src/kile/symbols/special/img169special.png b/src/kile/symbols/special/img169special.png
new file mode 100644
index 0000000..2720e9f
--- /dev/null
+++ b/src/kile/symbols/special/img169special.png
Binary files differ
diff --git a/src/kile/symbols/special/img170special.png b/src/kile/symbols/special/img170special.png
new file mode 100644
index 0000000..9fac20c
--- /dev/null
+++ b/src/kile/symbols/special/img170special.png
Binary files differ
diff --git a/src/kile/symbols/special/img171special.png b/src/kile/symbols/special/img171special.png
new file mode 100644
index 0000000..952a311
--- /dev/null
+++ b/src/kile/symbols/special/img171special.png
Binary files differ
diff --git a/src/kile/symbols/special/img172special.png b/src/kile/symbols/special/img172special.png
new file mode 100644
index 0000000..f7a9af6
--- /dev/null
+++ b/src/kile/symbols/special/img172special.png
Binary files differ
diff --git a/src/kile/symbols/special/img173special.png b/src/kile/symbols/special/img173special.png
new file mode 100644
index 0000000..a80a66a
--- /dev/null
+++ b/src/kile/symbols/special/img173special.png
Binary files differ
diff --git a/src/kile/symbols/special/img174special.png b/src/kile/symbols/special/img174special.png
new file mode 100644
index 0000000..e499e62
--- /dev/null
+++ b/src/kile/symbols/special/img174special.png
Binary files differ
diff --git a/src/kile/symbols/special/img175special.png b/src/kile/symbols/special/img175special.png
new file mode 100644
index 0000000..aeb0cc3
--- /dev/null
+++ b/src/kile/symbols/special/img175special.png
Binary files differ
diff --git a/src/kile/symbols/special/img176special.png b/src/kile/symbols/special/img176special.png
new file mode 100644
index 0000000..f19c3d9
--- /dev/null
+++ b/src/kile/symbols/special/img176special.png
Binary files differ
diff --git a/src/kile/symbols/special/img177special.png b/src/kile/symbols/special/img177special.png
new file mode 100644
index 0000000..48a3bcc
--- /dev/null
+++ b/src/kile/symbols/special/img177special.png
Binary files differ
diff --git a/src/kile/symbols/symbols.kilepr b/src/kile/symbols/symbols.kilepr
new file mode 100644
index 0000000..15f66d6
--- /dev/null
+++ b/src/kile/symbols/symbols.kilepr
@@ -0,0 +1,124 @@
+[General]
+img_extIsRegExp=false
+img_extensions=.eps .jpg .jpeg .png .pdf .ps .fig .gif .dvi
+kileprversion=2
+kileversion=2.0
+lastDocument=relation.tex
+masterDocument=
+name=symbols
+pkg_extIsRegExp=false
+pkg_extensions=.cls .sty
+src_extIsRegExp=false
+src_extensions=.tex .ltx .latex .dtx .ins .bib .mp
+
+[Tools]
+MakeIndex=
+QuickBuild=
+
+[item:arrows.tex]
+archive=true
+column=0
+encoding=UTF-8
+highlight=LaTeX
+line=10
+open=true
+order=0
+
+[item:cyrillic.tex]
+archive=true
+column=0
+encoding=UTF-8
+highlight=LaTeX
+line=0
+open=false
+order=0
+
+[item:definitions.tex]
+archive=true
+column=13
+encoding=UTF-8
+highlight=LaTeX
+line=10
+open=true
+order=1
+
+[item:delimiters.tex]
+archive=true
+column=0
+encoding=UTF-8
+highlight=LaTeX
+line=0
+open=false
+order=4
+
+[item:greek.tex]
+archive=true
+column=37
+encoding=ISO 8859-15
+highlight=LaTeX
+line=0
+open=false
+order=-1
+
+[item:misc-math.tex]
+archive=true
+column=0
+encoding=UTF-8
+highlight=LaTeX
+line=73
+open=true
+order=3
+
+[item:misc-text.tex]
+archive=true
+column=0
+encoding=ISO 8859-15
+highlight=LaTeX
+line=0
+open=false
+order=0
+
+[item:operators.tex]
+archive=true
+column=0
+encoding=UTF-8
+highlight=LaTeX
+line=152
+open=true
+order=4
+
+[item:relation.tex]
+archive=true
+column=0
+encoding=UTF-8
+highlight=LaTeX
+line=0
+open=true
+order=2
+
+[item:special.tex]
+archive=true
+column=9
+encoding=UTF-8
+highlight=LaTeX
+line=13
+open=false
+order=1
+
+[item:symbols.kilepr]
+archive=true
+column=0
+encoding=ISO 8859-15
+highlight=None
+line=0
+open=false
+order=-1
+
+[item:testfile.tex]
+archive=true
+column=0
+encoding=UTF-8
+highlight=LaTeX
+line=45
+open=true
+order=5
diff --git a/src/kile/symbols/testfile.tex b/src/kile/symbols/testfile.tex
new file mode 100644
index 0000000..59dfe54
--- /dev/null
+++ b/src/kile/symbols/testfile.tex
@@ -0,0 +1,57 @@
+\documentclass[a4paper,10pt]{article}
+\usepackage[T1]{fontenc}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Author: Thomas Braun
+% begin: Fri april 7 2006
+% last edit: Sun august 13 2006
+% License: GPL2 or later
+%
+% desc: testfile for the parser
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{definitions}
+
+\begin{document}
+\pagestyle{empty}
+
+% - The basic command is \command{\symbolname}, additionaly the command \mathcommand{...} is defined which insert its argument in math mode.
+% - Needed packages can be specified using \pkgs[package-opt-argument]{package-name} for a single command or with \begin{neededpkgs}[pkgs-args,]{pkgs,} ... \end{neededpkgs} for all enclosed commands.
+% - The \pkgs command has to be in front of the \command command and overrides any pkg specification by the neededpkgs enviroment.
+% - The optional argument of \command and \mathcommand can hold a different command for insertion, e.g. useful for stuff like \mathcommand[\stackrel{}{}]{\stackrel{abc}{=}}
+% After writing your custom tex file mysymbols.tex , you have to issue `gesymb mysymbols.tex user` and if everything went well copy the files to "$HOME/.kde/share/apps/kile/mathsymbols/user".
+% After restarting kile you should see your icons in the "User defined`` symbol list.
+\begin{neededpkgs}{envpkg-blubb}
+\command{a}
+\pkgs{cmdpkg-blubb}\command{b}
+\command{c}
+\pkgs[cmdpkg-blubb3-optarg]{cmdpkg-blubb3}\command{d}
+\command{dd}
+\end{neededpkgs}
+
+\begin{neededpkgs}[envpkg-blubb2-optarg]{envpkg-blubb2}
+\command{e}
+\pkgs{cmdpkg-blubb2}\command{f}
+\command{g}
+\pkgs[cmdpkg-blubb5-optarg]{cmdpkg-blubb5}\command{h}
+\command{hh}
+\end{neededpkgs}
+
+\command{i}
+\pkgs{cmdpkg-blubb4}\command{j}
+\command{k}
+\pkgs[cmdpkg-blubb6-optarg]{cmdpkg-blubb6}\command{l}
+\command{m}
+\command{n}
+\end{document}
+
+% \begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
+%
+% \end{neededpkgs}
+% this would need to include the packages
+% \usepackage{mathtext}
+% \usepackage[T2C]{fontenc}
+% \usepackage[russian]{babel}
+% \usepackage[koi8-r]{inputenc}
+% just to explain the format
+
diff --git a/src/kile/symbolview.cpp b/src/kile/symbolview.cpp
new file mode 100644
index 0000000..b68526f
--- /dev/null
+++ b/src/kile/symbolview.cpp
@@ -0,0 +1,385 @@
+/***************************************************************************
+ begin : Fri Aug 1 2003
+ edit : Fri April 6 2007
+ copyright : (C) 2003 by Jeroen Wijnhout, 2006 - 2007 by Thomas Braun
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+/*
+dani 2005-11-22
+ - add some new symbols
+ - rearranged source
+
+tbraun 2006-07-01
+ - added tooltips which show the keys, copied from kfileiconview
+ - reorganized the hole thing, more flexible png loading, removing the old big code_array, more groups
+
+tbraun 2007-06-04
+ - Send a warning in the logwidget if needed packages are not included for the command
+tbraun 2007-06-13
+ - Added Most frequently used symbolview, including remembering icons upon restart, removing of least popular item and configurable max item count
+*/
+
+#include "symbolview.h"
+#include "kileconfig.h"
+
+#include <qimage.h>
+#include <qstringlist.h>
+#include <kimageeffect.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include "kiledebug.h"
+
+#include <kconfig.h>
+
+#include <qregexp.h>
+#include <qtooltip.h>
+#include <qlabel.h>
+#include <qrect.h>
+#include <qapplication.h>
+
+
+SymbolView::SymbolView(QWidget *parent, int type, const char *name): KIconView( parent, name ),m_toolTip(0L)
+{
+ setGridX( 36 );
+ setGridY( 36);
+ setSpacing(5);
+ setWordWrapIconText (false);
+ setShowToolTips (false);
+ setResizeMode( Adjust );
+ setHScrollBarMode( AlwaysOff );
+ setVScrollBarMode( Auto );
+ setAutoArrange(true);
+ setSorting(false);
+ setItemsMovable(false);
+ setArrangement(LeftToRight);
+ setAcceptDrops(false);
+ initPage(type);
+ connect( this, SIGNAL( onItem( QIconViewItem * ) ),SLOT( showToolTip( QIconViewItem * ) ) );
+ connect( this, SIGNAL( onViewport() ),SLOT( removeToolTip() ) );
+}
+
+SymbolView::~SymbolView()
+{
+ removeToolTip();
+}
+
+void SymbolView::extract(const QString& key, int& refCnt)
+{
+ if(!key.isEmpty())
+ refCnt = key.section('%',0,0).toInt();
+
+ return;
+}
+
+void SymbolView::extract(const QString& key, int& refCnt, QString &cmd, QStringList &args, QStringList &pkgs)
+{
+ if(key.isEmpty())
+ return;
+
+ extract(key,refCnt);
+
+ QRegExp rePkgs("(?:\\[(.*)\\])?\\{(.*)\\}");
+
+ args.clear();
+ pkgs.clear();
+
+ cmd = key.section('%',1,1);
+ QString text = key.section('%',2,2);
+
+ if( text.find(rePkgs) != -1 )
+ {
+ args = QStringList::split(",",rePkgs.cap(1));
+ pkgs = QStringList::split(",",rePkgs.cap(2));
+ }
+}
+
+void SymbolView::showToolTip( QIconViewItem *item )
+{
+ removeToolTip();
+
+ if ( !item )
+ return;
+
+ QString cmd, label;
+ QStringList pkgs, args;
+ int refCnt;
+
+ extract(item->key(),refCnt,cmd,args,pkgs);
+
+ label = i18n("Command: ") + cmd + "\n";
+
+ if( pkgs.count() > 0 )
+ {
+ if(pkgs.count() == 1)
+ label += i18n("Package: ");
+ else
+ label += i18n("Packages: ");
+
+ for( uint i = 0; i < pkgs.count() ; i++ )
+ {
+ if( i < args.count() )
+ label = label + "[" + args[i] + "]" + pkgs[i] + "\n";
+ else
+ label = label + pkgs[i] + "\n";
+ }
+ }
+
+ m_toolTip = new QLabel(label, 0,"myToolTip",
+ WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM );
+ m_toolTip->setFrameStyle( QFrame::Plain | QFrame::Box );
+ m_toolTip->setLineWidth( 1 );
+ m_toolTip->setAlignment( AlignLeft | AlignTop );
+ m_toolTip->move( QCursor::pos() + QPoint( 14, 14 ) );
+ m_toolTip->adjustSize();
+ QRect screen = QApplication::desktop()->screenGeometry(
+ QApplication::desktop()->screenNumber(QCursor::pos()));
+ if (m_toolTip->x()+m_toolTip->width() > screen.right()) {
+ m_toolTip->move(m_toolTip->x()+screen.right()-m_toolTip->x()-m_toolTip->width(), m_toolTip->y());
+ }
+ if (m_toolTip->y()+m_toolTip->height() > screen.bottom()) {
+ m_toolTip->move(m_toolTip->x(), screen.bottom()-m_toolTip->y()-m_toolTip->height()+m_toolTip->y());
+ }
+ m_toolTip->setFont( QToolTip::font() );
+ m_toolTip->setPalette( QToolTip::palette(), true );
+ m_toolTip->show();
+}
+
+void SymbolView::removeToolTip()
+{
+ delete m_toolTip;
+ m_toolTip = 0;
+}
+
+void SymbolView::hideEvent( QHideEvent *e )
+{
+ removeToolTip();
+ KIconView::hideEvent( e );
+}
+
+void SymbolView::initPage(int page)
+{
+ switch (page)
+ {
+ case MFUS:
+ fillWidget(MFUSprefix);
+ break;
+
+ case Relation:
+ fillWidget("relation");
+ break;
+
+ case Operator:
+ fillWidget("operators");
+ break;
+
+ case Arrow:
+ fillWidget("arrows");
+ break;
+
+ case MiscMath:
+ fillWidget("misc-math");
+ break;
+
+ case MiscText:
+ fillWidget("misc-text");
+ break;
+
+ case Delimiters:
+ fillWidget("delimiters");
+ break;
+
+ case Greek:
+ fillWidget("greek");
+ break;
+
+ case Special:
+ fillWidget("special");
+ break;
+
+ case Cyrillic:
+ fillWidget("cyrillic");
+ break;
+
+ case User:
+ fillWidget("user");
+ break;
+
+ default:
+ kdWarning() << "wrong argument in initPage()" << endl;
+ break;
+ }
+}
+
+void SymbolView::contentsMousePressEvent(QMouseEvent *e)
+{
+ KILE_DEBUG() << "===SymbolView::contentsMousePressEvent(QMouseEvent *e)===" << endl;
+
+ QString code_symbol;
+ QStringList args, pkgs;
+ QIconViewItem *item = NULL;
+ int count;
+ bool math=false, bracket=false;
+
+ if( (e->button() & Qt::LeftButton) == Qt::LeftButton && ( item = findItem( e->pos() ) ) )
+ {
+ bracket = (e->state() & Qt::ControlButton) == Qt::ControlButton;
+ math = (e->state() & Qt::ShiftButton) == Qt::ShiftButton;
+
+ extract(item->key(),count,code_symbol,args,pkgs);
+
+ if (math == bracket)
+ ;
+ else if(math)
+ code_symbol = '$' + code_symbol + '$';
+ else if(bracket)
+ code_symbol = '{' + code_symbol + '}';
+
+ emit(insertText(code_symbol,pkgs));
+ emit(addToList(item));
+ }
+
+ KILE_DEBUG() << "math is " << math << ", bracket is " << bracket << " and item->key() is " << ( item ? item->key() : "" ) << endl;
+}
+
+void SymbolView::fillWidget(const QString& prefix)
+{
+ KILE_DEBUG() << "===SymbolView::fillWidget(const QString& " << prefix << " )===" << endl;
+ QImage image;
+ KIconViewItem* item;
+ QStringList refCnts,paths;
+
+ if( prefix == MFUSprefix)
+ {
+ KConfig *config = KGlobal::config();
+ config->setGroup(MFUSGroup);
+ QString configPaths = config->readEntry("paths");
+ QString configrefCnts = config->readEntry("counts");
+ paths = QStringList::split(',',configPaths);
+ refCnts = QStringList::split(',',configrefCnts);
+ KILE_DEBUG() << "Read " << paths.count() << " paths and " << refCnts.count() << " refCnts" << endl;
+ if( paths.count() != refCnts.count() )
+ {
+ KILE_DEBUG() << "error in saved LRU list" << endl;
+ paths.clear();
+ refCnts.clear();
+ }
+ }
+ else
+ {
+ paths = KGlobal::dirs()->findAllResources("app_symbols", prefix + "/*.png",false,true);
+ paths.sort();
+ for( uint i = 0 ; i < paths.count() ; i++ )
+ refCnts.append("1");
+ }
+ for ( uint i = 0; i < paths.count(); i++ )
+ {
+ if ( image.load(paths[i]) )
+ {
+// KILE_DEBUG() << "path is " << paths[i] << endl;
+ item = new KIconViewItem(this);
+ item->setPixmap(image);
+ item->setKey( refCnts[i] + '%' + image.text("Command") + '%' + image.text("Packages") + '%' + paths[i] );
+ image = KImageEffect::blend(colorGroup().text(), image, 1); // destroys our png comments, so we do it after reading the comments
+ }
+ else
+ KILE_DEBUG() << "Loading file " << paths[i] << " failed" << endl;
+ }
+}
+
+void SymbolView::writeConfig()
+{
+ QIconViewItem *item;
+ QStringList paths,refCnts;
+
+
+ KConfig *config = KGlobal::config();
+ config->setGroup(MFUSGroup);
+
+ if( KileConfig::clearMFUS() )
+ {
+ config->deleteEntry("paths");
+ config->deleteEntry("counts");
+ }
+ else
+ {
+ for ( item = this->firstItem(); item; item = item->nextItem() )
+ {
+ refCnts.append(item->key().section('%',0,0));
+ paths.append(item->key().section('%',3,3));
+ KILE_DEBUG() << "path=" << paths.last() << ", count is " << refCnts.last() << endl;
+ }
+ config->writeEntry("paths",paths);
+ config->writeEntry("counts",refCnts);
+ }
+}
+
+void SymbolView::slotAddToList(const QIconViewItem *item)
+{
+ if( !item || !item->pixmap() )
+ return;
+
+ QIconViewItem *tmpItem;
+ bool found=false;
+ const QRegExp reCnt("^\\d+");
+
+ KILE_DEBUG() << "===void SymbolView::slotAddToList(const QIconViewItem *" << item << " )===" << endl;
+
+ for ( tmpItem = this->firstItem(); tmpItem; tmpItem = tmpItem->nextItem() )
+ {
+ if( item->key().section('%',1) == tmpItem->key().section('%',1) )
+ {
+ found=true;
+ break;
+ }
+ }
+
+ if( !found && ( this->count() + 1 ) > KileConfig::numSymbolsMFUS() ) // we check before adding the symbol
+ {
+ int refCnt, minRefCnt=10000;
+ QIconViewItem *unpopularItem = 0L;
+
+ KILE_DEBUG() << "Removing most unpopular item" << endl;
+
+ for ( tmpItem = this->firstItem(); tmpItem; tmpItem = tmpItem->nextItem() )
+ {
+ extract(tmpItem->key(),refCnt);
+
+ if( refCnt < minRefCnt )
+ {
+ refCnt = minRefCnt;
+ unpopularItem = tmpItem;
+ }
+ }
+ KILE_DEBUG() << " minRefCnt is " << minRefCnt << endl;
+ delete unpopularItem;
+ }
+
+ if( found )
+ {
+ KILE_DEBUG() << "item is already in the iconview" << endl;
+
+ int refCnt;
+ extract(tmpItem->key(),refCnt);
+
+ QString key = tmpItem->key();
+ key.replace(reCnt,QString::number(refCnt+1));
+ tmpItem->setKey(key);
+ }
+ else
+ {
+ tmpItem = new KIconViewItem(this,QString::null,*(item->pixmap()));
+ tmpItem->setKey(item->key());
+ }
+}
+
+#include "symbolview.moc"
diff --git a/src/kile/symbolview.h b/src/kile/symbolview.h
new file mode 100644
index 0000000..be90c5f
--- /dev/null
+++ b/src/kile/symbolview.h
@@ -0,0 +1,61 @@
+/***************************************************************************
+ begin : Fri Aug 1 2003
+ edit : Fri April 6 2007
+ copyright : (C) 2002 - 2003 by Pascal Brachet, 2003 Jeroen Wijnhout, 2006 - 2007 Thomas Braun
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef SYMBOLVIEW_H
+#define SYMBOLVIEW_H
+
+#include <qiconview.h>
+
+#include <kiconview.h>
+#include <qscrollview.h>
+#include <qstring.h>
+#include <qlabel.h>
+
+static const QString MFUSGroup = "MostFrequentlyUsedSymbols";
+static const QString MFUSprefix = "MFUS";
+
+class SymbolView : public KIconView
+{
+ Q_OBJECT
+
+public:
+ SymbolView(QWidget *parent=0,int type = -1, const char *name=0);
+ ~SymbolView();
+ enum { MFUS = 0, Relation, Operator, Arrow, MiscMath, MiscText, Delimiters, Greek, Special, Cyrillic, User };
+ void writeConfig();
+
+private:
+ void fillWidget(const QString &prefix);
+ void hideEvent( QHideEvent * );
+ void contentsMousePressEvent(QMouseEvent *e);
+ void extract(const QString& key, int& count, QString &cmd, QStringList &args, QStringList &pkgs);
+ void extract(const QString& key, int& count);
+ void initPage(int page);
+
+signals:
+ void insertText(const QString& text,const QStringList &pkgs);
+ void addToList(const QIconViewItem *item);
+
+private slots:
+ void showToolTip( QIconViewItem *item );
+ void slotAddToList(const QIconViewItem *item);
+ void removeToolTip();
+
+private:
+ QLabel *m_toolTip;
+};
+
+#endif
diff --git a/src/kile/symbolviewconfig.ui b/src/kile/symbolviewconfig.ui
new file mode 100644
index 0000000..79ac81a
--- /dev/null
+++ b/src/kile/symbolviewconfig.ui
@@ -0,0 +1,142 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KileWidgetSymbolViewConfig</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KileWidgetSymbolViewConfig</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>529</width>
+ <height>140</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Symbol View</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Most Used Symbols</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIntNumInput">
+ <property name="name">
+ <cstring>kcfg_numSymbolsMFUS</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="value">
+ <number>30</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>kcfg_clearMFUS</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Clear the list of symbols whilst closing Kile</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>kcfg_displayMFUS</cstring>
+ </property>
+ <property name="text">
+ <string>Display the vie&amp;w</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Number of symbols to show</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<tabstops>
+ <tabstop>kcfg_numSymbolsMFUS</tabstop>
+ <tabstop>kcfg_displayMFUS</tabstop>
+ <tabstop>kcfg_clearMFUS</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/src/kile/syntax/CMakeLists.txt b/src/kile/syntax/CMakeLists.txt
new file mode 100644
index 0000000..9fb2a47
--- /dev/null
+++ b/src/kile/syntax/CMakeLists.txt
@@ -0,0 +1,4 @@
+
+########### install files ###############
+
+INSTALL( FILES latex.xml bibtex.xml DESTINATION share/apps/katepart/syntax )
diff --git a/src/kile/syntax/Makefile.am b/src/kile/syntax/Makefile.am
new file mode 100644
index 0000000..927e546
--- /dev/null
+++ b/src/kile/syntax/Makefile.am
@@ -0,0 +1,3 @@
+syntaxdir = $(kde_datadir)/katepart/syntax
+syntax_DATA = latex.xml bibtex.xml
+
diff --git a/src/kile/syntax/bibtex.xml b/src/kile/syntax/bibtex.xml
new file mode 100644
index 0000000..85e6edf
--- /dev/null
+++ b/src/kile/syntax/bibtex.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="BibTeX" version="1.12" extensions="*.bib" section="Markup" mimetype="text/x-bib" casesensitive="1" author="Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)" license="LGPL">
+ <highlighting>
+ <list name="kw_entry">
+ <item>@article</item>
+ <item>@book</item>
+ <item>@booklet</item>
+ <item>@conference</item>
+ <item>@inbook</item>
+ <item>@incollection</item>
+ <item>@inproceedings</item>
+ <item>@manual</item>
+ <item>@mastersthesis</item>
+ <item>@misc</item>
+ <item>@phdthesis</item>
+ <item>@proceedings</item>
+ <item>@techreport</item>
+ <item>@unpublished</item>
+ <item>@collection</item>
+ <item>@patent</item>
+ </list>
+ <list name="kw_command">
+ <item>@string</item>
+ <item>@preamble</item>
+ <item>@comment</item>
+ </list>
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr String="^\s*([a-zA-Z]+)\s*=" attribute="Field" context="#stay"/>
+ <keyword String="kw_entry" attribute="Entry" context="Entry"/>
+ <keyword String="kw_command" attribute="Command" context="#stay"/>
+ <DetectChar char="{" attribute="Normal Text" context="#stay" beginRegion="block" />
+ <DetectChar char="}" attribute="Normal Text" context="#stay" endRegion="block" />
+ <RegExpr String="\\([a-zA-Z]+|.)" attribute="Char" context="#stay"/>
+ <DetectChar char="&quot;" attribute="String" context="String"/>
+ </context>
+
+ <context name="Entry" attribute="Ref Key" lineEndContext="#stay">
+ <DetectChar char="," attribute="Normal Text" context="#pop"/>
+ <DetectChar char="{" attribute="Normal Text" context="#stay" beginRegion="block" />
+ <DetectChar char="}" attribute="Normal Text" context="#stay" endRegion="block" />
+ <RegExpr String="\\([a-zA-Z]+|.)" attribute="Char" context="#stay"/>
+ <DetectChar char="&quot;" attribute="String" context="#pop"/>
+ </context>
+
+ <context name="String" attribute="String" lineEndContext="#stay">
+ <RegExpr String="\\([a-zA-Z]+|.)" attribute="Char" context="#stay"/>
+ <DetectChar char="&quot;" attribute="String" context="#pop"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Entry" defStyleNum="dsKeyword" color="#0000ff"/>
+ <itemData name="Command" defStyleNum="dsFunction"/>
+ <itemData name="Field" defStyleNum="dsDataType"/>
+ <itemData name="Ref Key" defStyleNum="dsOthers"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="0" weakDeliminator="\" wordWrapDeliminator=",{}[]"/>
+ </general>
+</language>
diff --git a/src/kile/syntax/latex.xml b/src/kile/syntax/latex.xml
new file mode 100644
index 0000000..46af46a
--- /dev/null
+++ b/src/kile/syntax/latex.xml
@@ -0,0 +1,406 @@
+<?xml version="1.01" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="LaTeX" version="1.28" section="Markup" kateversion="2.3" extensions="*.tex; *.ltx; *.dtx; *.sty; *.cls;" mimetype="text/x-tex" casesensitive="1" author="Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)+Holger Danielsson (holger.danielsson@versanet.de)+Michel Ludwig (michel.ludwig@kdemail.net)+Thomas Braun (braun@physik.fu-berlin.de)" license="LGPL" >
+ <highlighting>
+ <contexts>
+ <!-- Normal text -->
+ <context name="Normal Text" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr String="\\begin(?=[^a-zA-Z])" attribute="Structure" context="FindEnvironment" beginRegion="block" />
+ <RegExpr String="\\end(?=[^a-zA-Z])" attribute="Structure" context="FindEnvironment" endRegion="block" />
+ <RegExpr String="\\(label|pageref|ref|vpageref|vref|cite)(?=[^a-zA-Z])" attribute="Structure" context="Label"/>
+ <RegExpr String="\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)\*?\s*(?=[\{\[])" attribute="Structure" context="Sectioning"/>
+ <RegExpr String="\\(footnote)\*?\s*(?=[\{\[])" attribute="Footnote" context="Footnoting"/>
+ <RegExpr String="\\(re)?newcommand(?=[^a-zA-Z])" attribute="Keyword" context="NewCommand"/>
+ <RegExpr String="\\(e|g|x)?def(?=[^a-zA-Z])" attribute="Keyword" context="DefCommand"/>
+ <RegExpr String="&lt;&lt;.*&gt;&gt;=" attribute="Normal Text" context="NoWeb" />
+ <StringDetect String="\(" attribute="Math" context="MathMode" beginRegion="mathMode" />
+ <StringDetect String="\[" attribute="Math" context="MathModeEquation" beginRegion="mathMode" />
+ <DetectChar char="\" attribute="Keyword" context="ContrSeq"/>
+ <StringDetect String="$$" attribute="Math" context="MathModeDisplay" beginRegion="mathMode" />
+ <DetectChar char="$" attribute="Math" context="MathMode" beginRegion="mathMode" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <RegExpr String="%\s*BEGIN.*$" attribute="Region Marker" context="#stay" beginRegion="regionMarker" firstNonSpace="true" />
+ <RegExpr String="%\s*END.*$" attribute="Region Marker" context="#stay" endRegion="regionMarker" firstNonSpace="true" />
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ </context>
+
+ <!-- NoWeb -->
+ <context name="NoWeb" attribute="Normal Text" lineEndContext="#stay" >
+ <RegExpr String="^\s*@\s*" attribute="Normal Text" context="#pop" />
+ </context>
+
+ <!-- LaTeX sectioning commands -->
+ <context name="Sectioning" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\[[^\]]*\]" attribute="Normal Text" context="#stay"/>
+ <DetectChar char=" " attribute="Normal Text" context="#stay"/>
+ <DetectChar char="{" attribute="Normal Text" context="SectioningInside"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop"/>
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ </context>
+ <context name="SectioningInside" attribute="Structure Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Normal Text" context="SectioningInside"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop"/>
+ <StringDetect String="\(" attribute="Structure Math" context="SectioningMathMode" beginRegion="mathMode" />
+ <DetectChar char="\" attribute="Structure Keyword" context="SectioningContrSeq"/>
+ <DetectChar char="$" attribute="Structure Math" context="SectioningMathMode" beginRegion="mathMode" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ </context>
+ <context name="SectioningContrSeq" attribute="Keyword" lineEndContext="#pop">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[a-zA-Z]+(\+?|\*{0,3})" attribute="Structure Keyword" context="#pop"/>
+ <RegExpr String="[^a-zA-Z]" attribute="Structure Keyword" context="#pop" />
+ </context>
+ <context name="SectioningMathMode" attribute="Structure Math" lineEndContext="#stay">
+ <StringDetect String="$$" attribute="Error" context="#stay" />
+ <DetectChar char="$" attribute="Structure Math" context="#pop" endRegion="mathMode" />
+ <Detect2Chars char="\" char1=")" attribute="Structure Math" context="#pop" endRegion="mathMode" />
+ <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" />
+ <DetectChar char="\" attribute="Structure Keyword Mathmode" context="SectioningMathContrSeq"/>
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ </context>
+ <context name="SectioningMathContrSeq" attribute="Structure Keyword Mathmode" lineEndContext="#pop">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[a-zA-Z]+\*?" attribute="Structure Keyword Mathmode" context="#pop"/>
+ <RegExpr String="[^a-zA-Z]" attribute="Structure Keyword Mathmode" context="#pop" />
+ </context>
+
+ <!-- LaTeX Footnote commands -->
+ <context name="Footnoting" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\[[^\]]*\]" attribute="Normal Text" context="#stay"/>
+ <DetectChar char=" " attribute="Normal Text" context="#stay"/>
+ <DetectChar char="{" attribute="Normal Text" context="FootnotingInside"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop"/>
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ </context>
+ <context name="FootnotingInside" attribute="Footnote Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Normal Text" context="FootnotingInside"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop"/>
+ <StringDetect String="\(" attribute="Footnote Math" context="FootnotingMathMode" beginRegion="mathMode" />
+ <DetectChar char="\" attribute="Footnote Keyword" context="FootnotingContrSeq"/>
+ <DetectChar char="$" attribute="Footnote Math" context="FootnotingMathMode" beginRegion="mathMode" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ </context>
+ <context name="FootnotingContrSeq" attribute="Keyword" lineEndContext="#pop">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[a-zA-Z]+(\+?|\*{0,3})" attribute="Footnote Keyword" context="#pop"/>
+ <RegExpr String="[^a-zA-Z]" attribute="Footnote Keyword" context="#pop" />
+ </context>
+ <context name="FootnotingMathMode" attribute="Footnote Math" lineEndContext="#stay">
+ <StringDetect String="$$" attribute="Error" context="#stay" />
+ <DetectChar char="$" attribute="Footnote Math" context="#pop" endRegion="mathMode" />
+ <Detect2Chars char="\" char1=")" attribute="Footnote Math" context="#pop" endRegion="mathMode" />
+ <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" />
+ <DetectChar char="\" attribute="Footnote Keyword Mathmode" context="FootnotingMathContrSeq"/>
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ </context>
+ <context name="FootnotingMathContrSeq" attribute="Footnote Keyword Mathmode" lineEndContext="#pop">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[a-zA-Z]+\*?" attribute="Footnote Keyword Mathmode" context="#pop"/>
+ <RegExpr String="[^a-zA-Z]" attribute="Footnote Keyword Mathmode" context="#pop" />
+ </context>
+
+ <!-- LaTeX commands \newcommand and \renewcommand -->
+ <context name="NewCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\s*\{\s*\\[a-zA-Z]+\s*\}(\[\d\](\[[^\]]+\])?)?\{" attribute="Normal Text" context="CommandParameterStart"/>
+ <DetectChar char="}" attribute="Error" context="#pop"/>
+ </context>
+
+ <!-- LaTeX command \def -->
+ <context name="DefCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\s*\\[a-zA-Z]+[^\{]*\{" attribute="Normal Text" context="CommandParameterStart"/>
+ <DetectChar char="}" attribute="Error" context="#pop"/>
+ </context>
+
+ <!-- parse command argument -->
+ <context name="CommandParameterStart" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Normal Text" context="CommandParameter"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/>
+ <RegExpr String="\\." attribute="Normal Text" context="#stay" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ </context>
+ <context name="CommandParameter" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Normal Text" context="CommandParameter"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop"/>
+ <RegExpr String="\\." attribute="Normal Text" context="#stay" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ </context>
+
+ <!-- LaTeX command in text mode -->
+ <context name="ContrSeq" attribute="Keyword" lineEndContext="#pop">
+ <StringDetect String="verb*" attribute="Keyword" context="Verb"/>
+ <RegExpr String="verb(?=[^a-zA-Z])" attribute="Keyword" context="Verb"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[a-zA-Z]+(\+?|\*{0,3})" attribute="Keyword" context="#pop"/>
+ <RegExpr String="[^a-zA-Z]" attribute="Keyword" context="#pop" />
+ </context>
+ <context name="ToEndOfLine" attribute="Normal Text" lineEndContext="#pop">
+ </context>
+
+ <!-- verb command -->
+ <context name="Verb" attribute="Verbatim" lineEndContext="#pop#pop" >
+ <RegExpr String="(.)" attribute="Normal Text" dynamic="true" context="VerbEnd" />
+ </context>
+ <context name="VerbEnd" attribute="Verbatim" lineEndContext="#pop#pop#pop" dynamic="true" >
+ <StringDetect String="%1" attribute="Normal Text" context="#pop#pop#pop" dynamic="true" />
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[^%1\xd7]*" attribute="Verbatim" context="#stay" dynamic="true" />
+ </context>
+
+ <!-- label -->
+ <context name="Label" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr String="\s*\{\s*" attribute="Normal Text" context="LabelParameter"/>
+ <RegExpr String="\s*\[\s*" attribute="Normal Text" context="LabelOption"/>
+ <RegExpr String="[^\[\{]+" attribute="Error" context="#stay"/>
+ </context>
+
+ <context name="LabelOption" attribute="Normal Text" lineEndContext="#stay">
+ <StringDetect String="\(" attribute="Math" context="MathMode" beginRegion="mathMode" />
+ <DetectChar char="\" attribute="Keyword" context="ContrSeq"/>
+ <DetectChar char="$" attribute="Math" context="MathMode" beginRegion="mathMode" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="\s*\]\s*" attribute="Normal Text" context="#pop"/>
+ </context>
+
+ <context name="LabelParameter" attribute="Environment" lineEndContext="#stay">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="\s*\}\s*" attribute="Normal Text" context="#pop#pop"/>
+ </context>
+
+ <!-- start of an environment -->
+ <context name="FindEnvironment" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Normal Text" context="Environment"/>
+ <RegExpr String="\S" attribute="Normal Text" context="#pop"/>
+ </context>
+
+ <!-- filter the environment name and check the type -->
+ <context name="Environment" attribute="Environment" lineEndContext="#stay">
+ <RegExpr String="(lstlisting|(B|L)?Verbatim)" attribute="Environment" context="VerbatimEnvParam"/>
+ <RegExpr String="(verbatim|boxedverbatim)" attribute="Environment" context="VerbatimEnv"/>
+ <RegExpr String="(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|flalign)" attribute="Environment" context="MathEnv"/>
+ <RegExpr String="(alignat|xalignat|xxalignat)" attribute="Environment" context="MathEnvParam"/>
+ <RegExpr String="(tabular|supertabular|mpsupertabular|xtabular|mpxtabular|longtable)" attribute="Environment" context="TabEnv"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[a-zA-Z]" attribute="Environment" context="LatexEnv"/>
+ <RegExpr String="\s+" attribute="Error" context="#pop"/>
+ <RegExpr String="[^a-zA-Z\xd7]" attribute="Error" context="#pop"/>
+ </context>
+
+ <!-- environment type 1: normal -->
+ <context name="LatexEnv" attribute="Environment" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop"/>
+ <RegExpr String="[a-zA-Z]+" attribute="Environment" context="#stay"/>
+ <RegExpr String="\s+" attribute="Error" context="#stay"/>
+ <IncludeRules context="EnvCommon" />
+ </context>
+
+ <!-- environment type 2: verbatim without parameter -->
+ <context name="VerbatimEnv" attribute="Environment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop">
+ <DetectChar char="}" attribute="Normal Text" context="Verbatim"/>
+ <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/>
+ <IncludeRules context="EnvCommon" />
+ </context>
+
+ <!-- environment type 3: verbatim with optional parameter -->
+ <context name="VerbatimEnvParam" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars char="}" char1="[" attribute="Normal Text" context="#stay" />
+ <DetectChar char="}" attribute="Normal Text" context="Verbatim"/>
+ <DetectChar char="]" attribute="Normal Text" context="Verbatim"/>
+ </context>
+
+ <!-- parse verbatim text -->
+ <context name="Verbatim" attribute="Verbatim" lineEndContext="#stay">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="\\end(?=\s*\{(verbatim|lstlisting|boxedverbatim|(B|L)?Verbatim)\*?\})" attribute="Structure" context="VerbFindEnd"/>
+ </context>
+
+ <!-- end of verbatim environment -->
+ <context name="VerbFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/>
+ <RegExpr String="(verbatim|lstlisting|boxedverbatim|(B|L)?Verbatim)\*?" attribute="Environment" context="#stay"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/>
+ </context>
+
+ <!-- environment type 4: math environment with its own mathmode -->
+ <context name="MathEnv" attribute="Environment" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Normal Text" context="MathModeEnv"/>
+ <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/>
+ <IncludeRules context="EnvCommon" />
+ </context>
+
+ <!-- environment type 5: math environment with its own mathmode and parameter -->
+ <context name="MathEnvParam" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr String="\}\{[^\}]*\}" attribute="Normal Text" context="MathModeEnv"/>
+ <DetectChar char="}" attribute="Normal Text" context="MathModeEnv"/>
+ <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/>
+ <IncludeRules context="EnvCommon" />
+ </context>
+
+ <!-- environment common -->
+ <context name="EnvCommon" attribute="Environment" lineEndContext="#stay">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="\*(?=\})" attribute="Environment" context="#stay"/>
+ <RegExpr String="\*[^\}]*" attribute="Error" context="#pop#pop#pop"/>
+ <RegExpr String="[^a-zA-Z\xd7][^\}]*" attribute="Error" context="#pop#pop#pop"/>
+ </context>
+
+ <!-- parse math environment -->
+ <context name="MathModeEnv" attribute="Math" lineEndContext="#stay">
+ <RegExpr String="\\end(?=\s*\{(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|flalign|alignat|xalignat|xxalignat)\*?\})" attribute="Structure" context="MathFindEnd"/>
+ <RegExpr String="\\begin(?=[^a-zA-Z])" attribute="Keyword Mathmode" context="#stay" beginRegion="block" />
+ <RegExpr String="\\end(?=[^a-zA-Z])" attribute="Keyword Mathmode" context="#stay" endRegion="block" />
+ <StringDetect String="\(" attribute="Error" context="#stay" />
+ <StringDetect String="\[" attribute="Error" context="#stay" />
+ <StringDetect String="\)" attribute="Error" context="#stay" />
+ <StringDetect String="\]" attribute="Error" context="#stay" />
+ <RegExpr String="\\(text|intertext|mbox)\s*(?=\{)" attribute="Keyword Mathmode" context="MathModeText" />
+ <DetectChar char="\" attribute="Keyword Mathmode" context="MathContrSeq"/>
+ <StringDetect String="$$" attribute="Error" context="#stay" />
+ <DetectChar char="$" attribute="Error" context="#stay" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <RegExpr String="%\s*BEGIN.*$" attribute="Region Marker" context="#stay" beginRegion="regionMarker" firstNonSpace="true"/>
+ <RegExpr String="%\s*END.*$" attribute="Region Marker" context="#stay" endRegion="regionMarker" firstNonSpace="true"/>
+ </context>
+
+ <!-- end of math environment -->
+ <context name="MathFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/>
+ <RegExpr String="(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|flalign|alignat|xalignat|xxalignat)\*?" attribute="Environment" context="#stay"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/>
+ </context>
+
+ <!-- environment type 9: tabular -->
+ <context name="TabEnv" attribute="Environment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop">
+ <DetectChar char="}" attribute="Normal Text" context="Tab"/>
+ <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/>
+ <IncludeRules context="EnvCommon" />
+ </context>
+
+ <!-- parse tabular text -->
+ <context name="Tab" attribute="Tab" lineEndContext="#stay">
+ <DetectChar char="&amp;" attribute="Ampersand" context="#stay"/>
+ <RegExpr String="@\{.*\}" minimal="true" attribute="Column Separator" context="#stay"/>
+ <RegExpr String="\\end(?=\s*\{(tabular|supertabular|mpsupertabular|xtabular|mpxtabular|longtable)\*?\})" attribute="Structure" context="TabFindEnd"/>
+ <IncludeRules context="Normal Text" />
+ </context>
+
+ <!-- end of tabular environment -->
+ <context name="TabFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/>
+ <RegExpr String="(tabular|supertabular|mpsupertabular|xtabular|mpxtabular|longtable)\*?" attribute="Environment" context="#stay"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/>
+ </context>
+
+ <!-- math mode: starting with $ or \( -->
+ <context name="MathMode" attribute="Math" lineEndContext="#stay">
+ <StringDetect String="$$" attribute="Error" context="#stay" />
+ <DetectChar char="$" attribute="Math" context="#pop" endRegion="mathMode" />
+ <Detect2Chars char="\" char1=")" attribute="Math" context="#pop" endRegion="mathMode" />
+ <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" />
+ <IncludeRules context="MathModeCommon" />
+ </context>
+
+ <!-- math mode: starting with $$ -->
+ <context name="MathModeDisplay" attribute="Math" lineEndContext="#stay">
+ <StringDetect String="$$" attribute="Math" context="#pop" endRegion="mathMode" />
+ <DetectChar char="$" attribute="Error" context="#stay" />
+ <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" />
+ <Detect2Chars char="\" char1=")" attribute="Error" context="#stay" />
+ <IncludeRules context="MathModeCommon" />
+ </context>
+
+ <!-- math mode: starting with \[ -->
+ <context name="MathModeEquation" attribute="Math" lineEndContext="#stay">
+ <Detect2Chars char="\" char1="]" attribute="Math" context="#pop" endRegion="mathMode" />
+ <StringDetect String="$$" attribute="Error" context="#stay" />
+ <DetectChar char="$" attribute="Error" context="#stay" />
+ <Detect2Chars char="\" char1=")" attribute="Error" context="#stay" />
+ <IncludeRules context="MathModeCommon" />
+ </context>
+
+ <!-- math mode common -->
+ <context name="MathModeCommon" attribute="Math" lineEndContext="#stay">
+ <RegExpr String="\\(begin|end)\s*\{(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|flalign|alignat|xalignat|xxalignat)\*?\}" attribute="Error" context="#stay"/>
+ <RegExpr String="\\begin(?=[^a-zA-Z])" attribute="Keyword Mathmode" context="#stay" beginRegion="block" />
+ <RegExpr String="\\end(?=[^a-zA-Z])" attribute="Keyword Mathmode" context="#stay" endRegion="block" />
+ <RegExpr String="\\(text|intertext|mbox)\s*(?=\{)" attribute="Keyword Mathmode" context="MathModeText" />
+ <DetectChar char="\" attribute="Keyword Mathmode" context="MathContrSeq"/>
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <RegExpr String="%\s*BEGIN.*$" attribute="Region Marker" context="#stay" beginRegion="regionMarker" firstNonSpace="true"/>
+ <RegExpr String="%\s*END.*$" attribute="Region Marker" context="#stay" endRegion="regionMarker" firstNonSpace="true"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ </context>
+
+ <!-- command in mathmode -->
+ <context name="MathContrSeq" attribute="Keyword Mathmode" lineEndContext="#pop">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[a-zA-Z]+\*?" attribute="Keyword Mathmode" context="#pop"/>
+ <RegExpr String="[^a-zA-Z]" attribute="Keyword Mathmode" context="#pop" />
+ </context>
+
+ <!-- text in mathmode -->
+ <context name="MathModeText" attribute="Normal Text" lineEndContext="#stay" >
+ <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameterStart"/>
+ </context>
+
+ <context name="MathModeTextParameterStart" attribute="Normal Text" lineEndContext="#stay" >
+ <RegExpr String="\\." attribute="Normal Text" context="#stay"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameter"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/>
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ </context>
+
+ <context name="MathModeTextParameter" attribute="Normal Text" lineEndContext="#stay" >
+ <RegExpr String="\\." attribute="Normal Text" context="#stay"/>
+ <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameter"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ </context>
+
+ <!-- comment -->
+ <context name="Comment" attribute="Comment" lineEndContext="#pop">
+ <RegExpr String="(FIXME|TODO):?" attribute="Alert" context="#stay"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsNormal" color="#800000" selColor="#60FFFF" bold="0" italic="0"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Error" defStyleNum="dsAlert"/>
+ <itemData name="Math" defStyleNum="dsNormal" color="#00A000" selColor="#FF40FF" bold="0" italic="0"/>
+ <itemData name="Structure" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
+ <itemData name="Keyword Mathmode" defStyleNum="dsNormal" color="#606000" selColor="#FFD0FF" bold="0" italic="0"/>
+ <itemData name="Environment" defStyleNum="dsNormal" color="#0000D0" selColor="#FFFF90" bold="0" italic="0"/>
+ <itemData name="Verbatim" defStyleNum="dsNormal" color="#a08000" selColor="#80D0FF" bold="0" italic="0"/>
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
+ <itemData name="Bullet" defStyleNum="dsNormal" color="#FF00C4" bold="1" underline="1"/>
+ <itemData name="Ampersand" defStyleNum="dsNormal" color="#002793" bold="1" />
+ <itemData name="Column Separator" defStyleNum="dsNormal" color="#002793" />
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ <itemData name="Structure Text" defStyleNum="dsNormal" color="#000000" selColor="#FFFFFF" bold="1" italic="0"/>
+ <itemData name="Structure Keyword" defStyleNum="dsNormal" color="#800000" selColor="#60FFFF" bold="1" italic="0"/>
+ <itemData name="Structure Math" defStyleNum="dsNormal" color="#00A000" selColor="#FF40FF" bold="1" italic="0"/>
+ <itemData name="Structure Keyword Mathmode" defStyleNum="dsNormal" color="#606000" selColor="#FFD0FF" bold="1" italic="0"/>
+ <itemData name="Footnote" defStyleNum="dsNormal" color="#800000" selColor="#60FFFF" bold="0" italic="0"/>
+ <itemData name="Footnote Text" defStyleNum="dsNormal" color="#000000" selColor="#FFFFFF" bold="0" italic="0"/>
+ <itemData name="Footnote Keyword" defStyleNum="dsNormal" color="#800000" selColor="#60FFFF" bold="0" italic="0"/>
+ <itemData name="Footnote Math" defStyleNum="dsNormal" color="#00A000" selColor="#FF40FF" bold="0" italic="0"/>
+ <itemData name="Footnote Keyword Mathmode" defStyleNum="dsNormal" color="#606000" selColor="#FFD0FF" bold="0" italic="0"/>
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <keywords weakDeliminator="\" wordWrapDeliminator=",{}[]"/>
+ <comments>
+ <comment name="singleLine" start="%" />
+ </comments>
+ </general>
+</language>
diff --git a/src/kile/tabbingdialog.cpp b/src/kile/tabbingdialog.cpp
new file mode 100644
index 0000000..d7d670e
--- /dev/null
+++ b/src/kile/tabbingdialog.cpp
@@ -0,0 +1,102 @@
+/***************************************************************************
+ begin : dim jui 14 2002
+ copyright : (C) 2002 - 2003 by Pascal Brachet, 2003 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "tabbingdialog.h"
+#include "kileedit.h"
+
+#include <qspinbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+
+#include <klineedit.h>
+#include <kpushbutton.h>
+#include <klocale.h>
+
+
+namespace KileDialog
+{
+ QuickTabbing::QuickTabbing(KConfig *config, KileInfo *ki, QWidget *parent, const char *name, const QString &caption ) : Wizard(config, parent,name, caption), m_ki(ki)
+ {
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+
+ QGridLayout *gbox = new QGridLayout( page, 4, 2,5,5,"");
+ gbox->addRowSpacing( 0, fontMetrics().lineSpacing() );
+
+ QLabel *lb = new QLabel(page);
+ lb->setText(i18n("Num of columns:"));
+ gbox->addWidget(lb, 0, 0);
+ m_spCols = new QSpinBox(page);
+ lb->setBuddy(m_spCols);
+ m_spCols ->setValue(2);
+ m_spCols ->setRange(2,99);
+ gbox->addWidget( m_spCols , 0, 1 );
+
+ lb = new QLabel(page);
+ lb->setText(i18n("Num of &rows:"));
+ gbox->addWidget(lb, 1, 0 );
+ m_spRows = new QSpinBox(page);
+ lb->setBuddy(m_spRows);
+ m_spRows->setValue(1);
+ m_spRows->setRange(1,99);
+ gbox->addWidget( m_spRows, 1, 1 );
+
+ lb= new QLabel(page);
+ lb->setText(i18n("&Spacing:"));
+ gbox->addWidget(lb, 2, 0 );
+ m_leSpacing = new KLineEdit(page);
+ m_leSpacing->setFixedWidth(80);
+ lb->setBuddy(m_leSpacing);
+ gbox->addWidget(m_leSpacing, 2, 1 );
+
+ resize(130,120);
+ }
+
+ QuickTabbing::~QuickTabbing()
+ {}
+
+ void QuickTabbing::slotOk()
+ {
+ int x = m_spCols->value();
+ int y = m_spRows->value();
+ QString s= m_leSpacing->text();
+ QString indent = m_ki->editorExtension()->autoIndentEnvironment();
+
+ m_td.tagBegin = "\\begin{tabbing}\n";
+ m_td.tagBegin += indent;
+
+ for ( int j=1; j<x ; ++j) m_td.tagBegin += "\\hspace{"+s+"}\\=";
+
+ m_td.tagBegin += "\\kill\n";
+
+ for ( int i=0;i<y-1;++i)
+ {
+ m_td.tagBegin += indent;
+ for ( int j=1;j<x;++j) m_td.tagBegin +=" \\> ";
+ m_td.tagBegin += "\\\\ \n";
+ }
+
+ m_td.tagBegin += indent;
+ for ( int j=1;j<x;++j) m_td.tagBegin += " \\> ";
+
+ m_td.tagEnd = "\n\\end{tabbing}";
+ m_td.dy=1;
+ m_td.dx=indent.length();
+
+ accept();
+ }
+}
+
+#include "tabbingdialog.moc"
diff --git a/src/kile/tabbingdialog.h b/src/kile/tabbingdialog.h
new file mode 100644
index 0000000..2ca5c82
--- /dev/null
+++ b/src/kile/tabbingdialog.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ begin : dim jui 14 2002
+ copyright : (C) 2002 - 2003 by Pascal Brachet, (C) 2003 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef TABBINGDIALOG_H
+#define TABBINGDIALOG_H
+
+#include "kilewizard.h"
+#include "kileinfo.h"
+
+#include <qdialog.h>
+
+class QSpinBox;
+class KLineEdit;
+
+/**
+ *@author Pascal Brachet
+ *@author Jeroen Wijnhout
+ */
+
+namespace KileDialog
+{
+ class QuickTabbing : public Wizard
+ {
+ Q_OBJECT
+
+ public:
+ QuickTabbing(KConfig *config, KileInfo *ki, QWidget *parent=0, const char *name=0, const QString &caption = QString::null);
+ ~QuickTabbing();
+
+ public slots:
+ void slotOk();
+
+ public:
+ KileInfo *m_ki;
+ QSpinBox *m_spCols, *m_spRows;
+ KLineEdit *m_leSpacing;
+ };
+}
+
+#endif
diff --git a/src/kile/tabulardialog.cpp b/src/kile/tabulardialog.cpp
new file mode 100644
index 0000000..006bfac
--- /dev/null
+++ b/src/kile/tabulardialog.cpp
@@ -0,0 +1,2554 @@
+/***************************************************************************
+ tabulardialog.cpp
+----------------------------------------------------------------------------
+ date : Sep 17 2006
+ version : 0.26
+ copyright : (C) 2005-2006 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "tabulardialog.h"
+#include "codecompletion.h"
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qstyle.h>
+#include <qframe.h>
+#include <qgroupbox.h>
+#include <qbuttongroup.h>
+#include <qwhatsthis.h>
+#include <qcursor.h>
+#include <qmap.h>
+
+#include <kmessagebox.h>
+#include <klocale.h>
+#include "kiledebug.h"
+
+namespace KileDialog
+{
+
+static const char * const all_border_xpm[] = {
+"14 14 2 1",
+"# c #000000",
+". c #ffffff",
+"##############",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"##############"
+};
+
+static const char * const lr_border_xpm[] = {
+"14 14 2 1",
+"# c #000000",
+". c #ffffff",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#",
+"#............#"
+};
+
+static const char * const tb_border_xpm[] = {
+"14 14 2 1",
+"# c #000000",
+". c #ffffff",
+"##############",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"##############"
+};
+
+static const char * const no_border_xpm[] = {
+"14 14 2 1",
+"# c #000000",
+". c #ffffff",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+"..............",
+".............."
+};
+
+
+////////////////////////////// TabCellFrame //////////////////////////////
+
+TabCellFrame::TabCellFrame(QWidget* parent) : QFrame(parent)
+{
+ m_border = TabularCell::cbNone;
+
+ setBackgroundColor(Qt::white);
+ setFixedWidth(120);
+ setFixedHeight(120);
+ setLineWidth(2);
+ setFrameStyle(QFrame::Box | QFrame::Raised);
+
+ QRect r = contentsRect();
+ int x1 = r.left();
+ int y1 = r.top();
+ int x2 = r.right();
+ int y2 = r.bottom();
+
+ m_left.setRect(x1,y1+20,20,y2-43);
+ m_top.setRect(x1+20,y1,x2-43,20);
+ m_right.setRect(x2-20,y1+20,20,y2-43);
+ m_bottom.setRect(x1+20,y2-20,x2-43,20);
+
+}
+
+void TabCellFrame::setBorder(int value)
+{
+ m_border = value;
+ update();
+}
+
+void TabCellFrame::drawContents(QPainter *p)
+{
+ p->save();
+
+ QRect r = contentsRect();
+ int x1 = r.left();
+ int y1 = r.top();
+ int x2 = r.right();
+ int y2 = r.bottom();
+
+ // left/top
+ p->setPen(Qt::black);
+ p->drawLine(x1+6,y1+14,x1+14,y1+14);
+ p->drawLine(x1+14,y1+14,x1+14,y1+6);
+
+ // left/bottom
+ p->drawLine(x1+6,y2-14,x1+14,y2-14);
+ p->drawLine(x1+14,y2-14,x1+14,y2-6);
+
+ // right/top
+ p->drawLine(x2-6,y1+14,x2-14,y1+14);
+ p->drawLine(x2-14,y1+14,x2-14,y1+6);
+
+ // right/bottom
+ p->drawLine(x2-6,y2-14,x2-14,y2-14);
+ p->drawLine(x2-14,y2-14,x2-14,y2-6);
+
+ // centered rectangle
+ p->setPen(Qt::gray);
+ p->setBrush(Qt::gray);
+ p->drawRect(x1+20,y1+20,x2-43,y2-43);
+
+ //QPen pen = QPen(Qt::red,4);
+ QPen pen = QPen(Qt::black,4);
+ p->setPen(pen);
+ if ( m_border & TabularCell::cbLeft )
+ p->drawLine(x1+10,y1+20,x1+10,y2-20);
+ if ( m_border & TabularCell::cbTop )
+ p->drawLine(x1+20,y1+10,x2-20,y1+10);
+ if ( m_border & TabularCell::cbRight )
+ p->drawLine(x2-10,y1+20,x2-10,y2-20);
+ if ( m_border & TabularCell::cbBottom )
+ p->drawLine(x1+20,y2-10,x2-20,y2-10);
+
+ p->restore();
+}
+
+void TabCellFrame::mousePressEvent(QMouseEvent *event)
+{
+ if ( event->button() != Qt::LeftButton )
+ return;
+
+ int x = event->x();
+ int y = event->y();
+ //KILE_DEBUG() << "left mouse button: x=" << x << " y=" << endl;
+
+ int state = 0;
+ if ( m_left.contains(x,y) )
+ state = TabularCell::cbLeft;
+ else if ( m_top.contains(x,y) )
+ state = TabularCell::cbTop;
+ else if ( m_right.contains(x,y) )
+ state = TabularCell::cbRight;
+ else if ( m_bottom.contains(x,y) )
+ state = TabularCell::cbBottom;
+
+ if ( state > 0 )
+ {
+ if ( m_border & state )
+ {
+ m_border &= ~state;
+ }
+ else
+ {
+ m_border |= state;
+ }
+ update();
+ }
+}
+
+void TabCellFrame::mouseDoubleClickEvent(QMouseEvent *event)
+{
+ event->accept();
+}
+
+//////////////////////////////////////////////////////////////////////
+
+//BEGIN TabCellDialog
+
+TabCellDialog::TabCellDialog(QWidget *parent, TabularCell::Data *data,
+ const QString &headerlabel, const QStringList &alignlist)
+ : KDialogBase( parent,0, true, i18n("Cell Properties"),
+ Ok | Cancel | User1, Ok, true )
+{
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+
+ if ( headerlabel.isEmpty() )
+ {
+ m_header = false;
+ m_headerlabel = "l";
+ }
+ else
+ {
+ m_header = true;
+ m_headerlabel = headerlabel;
+ }
+
+ QGridLayout *grid = new QGridLayout( page, 4,2, 6,6);
+
+ // font group
+ QGroupBox *fontgroup = new QGroupBox( i18n("Font"),page);
+ fontgroup->setColumnLayout(0, Qt::Vertical );
+ fontgroup->layout()->setSpacing( 6 );
+ fontgroup->layout()->setMargin( 11 );
+
+ m_cbBold = new QCheckBox(i18n("Bold"),fontgroup);
+ m_cbItalic = new QCheckBox(i18n("Italic"),fontgroup);
+
+ QVBoxLayout *fontgrouplayout = new QVBoxLayout( fontgroup->layout() );
+ fontgrouplayout->setAlignment( Qt::AlignTop );
+ fontgrouplayout->addWidget( m_cbBold );
+ fontgrouplayout->addWidget( m_cbItalic );
+
+ // color group
+ QGroupBox *colorgroup = new QGroupBox( i18n("Color"),page);
+ colorgroup->setColumnLayout(0, Qt::Vertical );
+ colorgroup->layout()->setSpacing( 6 );
+ colorgroup->layout()->setMargin( 11 );
+
+ QLabel *label1 = new QLabel(i18n("Background:"),colorgroup);
+ QLabel *label2 = new QLabel(i18n("Textcolor:"),colorgroup);
+ m_ccBgcolor = new KColorCombo(colorgroup);
+ m_ccTextcolor = new KColorCombo(colorgroup);
+
+ QGridLayout *colorgrouplayout = new QGridLayout( colorgroup->layout() );
+ colorgrouplayout->setAlignment( Qt::AlignTop );
+ colorgrouplayout->addWidget( label1,0,0 );
+ colorgrouplayout->addWidget( label2,1,0 );
+ colorgrouplayout->addWidget( m_ccBgcolor,0,1 );
+ colorgrouplayout->addWidget( m_ccTextcolor,1,1 );
+
+ // alignment group
+ QButtonGroup *aligngroup = new QButtonGroup( i18n("Alignment"),page);
+ aligngroup->setColumnLayout(0, Qt::Vertical );
+ aligngroup->layout()->setSpacing( 6 );
+ aligngroup->layout()->setMargin( 11 );
+
+ m_rbAlignleft = new QRadioButton(i18n("Left"),aligngroup);
+ m_rbAligncenter = new QRadioButton(i18n("Center"),aligngroup);
+ m_rbAlignright = new QRadioButton(i18n("Right"),aligngroup);
+
+ QVBoxLayout *aligngrouplayout = new QVBoxLayout( aligngroup->layout() );
+ aligngrouplayout->setAlignment( Qt::AlignTop );
+ aligngrouplayout->addWidget( m_rbAlignleft );
+ aligngrouplayout->addWidget( m_rbAligncenter );
+ aligngrouplayout->addWidget( m_rbAlignright );
+
+ // frame group
+ QGroupBox *framegroup = new QGroupBox( i18n("Frame"),page);
+ framegroup->setColumnLayout(0, Qt::Vertical );
+ framegroup->layout()->setSpacing( 6 );
+ framegroup->layout()->setMargin( 11 );
+
+ QLabel *label3 = new QLabel(i18n("Standard:"),framegroup);
+ QLabel *label4 = new QLabel(i18n("User defined:"),framegroup);
+
+ QWidget *lineframe = new QWidget(framegroup);
+ m_pbFrame1 = new KPushButton("x",lineframe,"pb_no_border");
+ m_pbFrame2 = new KPushButton("",lineframe,"pb_lr_border");
+ m_pbFrame3 = new KPushButton("",lineframe,"pb_tb_border");
+ m_pbFrame4 = new KPushButton("",lineframe,"pb_all_border");
+
+ QHBoxLayout *linebox = new QHBoxLayout(lineframe);
+ linebox->addWidget(m_pbFrame1);
+ linebox->addSpacing(4);
+ linebox->addWidget(m_pbFrame2);
+ linebox->addSpacing(4);
+ linebox->addWidget(m_pbFrame3);
+ linebox->addSpacing(4);
+ linebox->addWidget(m_pbFrame4);
+ linebox->addStretch(1);
+
+ QWidget *borderframe = new QWidget(framegroup);
+ m_cellframe = new TabCellFrame(borderframe);
+
+ QHBoxLayout *borderbox = new QHBoxLayout(borderframe);
+ borderbox->addStretch(1);
+ borderbox->addWidget(m_cellframe);
+ borderbox->addStretch(1);
+
+ QVBoxLayout *framegrouplayout = new QVBoxLayout( framegroup->layout() );
+ framegrouplayout->setAlignment( Qt::AlignTop );
+ framegrouplayout->addWidget( label3 );
+ framegrouplayout->addWidget( lineframe );
+ framegrouplayout->addSpacing( 10 );
+ framegrouplayout->addWidget( label4 );
+ framegrouplayout->addWidget( borderframe );
+
+ // preamble group
+ QGroupBox *preamblegroup = new QGroupBox( i18n("Preamble"),page);
+ preamblegroup->setColumnLayout(0, Qt::Vertical );
+ preamblegroup->layout()->setSpacing( 6 );
+ preamblegroup->layout()->setMargin( 11 );
+
+ m_cbPre = new QCheckBox(i18n(">{decl}: insert before"),preamblegroup,"cb_pre");
+ m_cbPost = new QCheckBox(i18n("<{decl}: insert after"),preamblegroup,"cb_post");
+ m_cbAt = new QCheckBox(i18n("@{decl}: suppress space"),preamblegroup,"cb_at");
+ m_cbSep = new QCheckBox(i18n("!{decl}: do not suppress space"),preamblegroup,"cb_sep");
+
+ QVBoxLayout *preamblegrouplayout = new QVBoxLayout( preamblegroup->layout() );
+ preamblegrouplayout->setAlignment( Qt::AlignTop );
+ preamblegrouplayout->addWidget( m_cbPre );
+ preamblegrouplayout->addWidget( m_cbPost );
+ preamblegrouplayout->addWidget( m_cbAt );
+ preamblegrouplayout->addWidget( m_cbSep );
+
+ // header group
+ QGroupBox *headergroup = new QGroupBox( i18n("Alignment"),page);
+ headergroup->setColumnLayout(0, Qt::Vertical );
+ headergroup->layout()->setSpacing( 6 );
+ headergroup->layout()->setMargin( 11 );
+
+ m_coHeader = new QComboBox(headergroup);
+
+ QVBoxLayout *headergrouplayout = new QVBoxLayout( headergroup->layout() );
+ headergrouplayout->setAlignment( Qt::AlignTop );
+ headergrouplayout->addStretch(1);
+ headergrouplayout->addWidget(m_coHeader);
+ headergrouplayout->addStretch(1);
+
+ // add widgets
+ if ( m_header )
+ {
+ grid->addWidget( headergroup,0,0 );
+ grid->addWidget( preamblegroup,1,0 );
+ grid->addWidget( colorgroup,2,0 );
+ grid->addWidget( fontgroup, 0,1 );
+ grid->addMultiCellWidget( framegroup,1,2,1,1 );
+ aligngroup->hide();
+ }
+ else
+ {
+ grid->addWidget( fontgroup, 0,0 );
+ grid->addWidget( aligngroup,1,0 );
+ grid->addWidget( colorgroup,2,0 );
+ grid->addMultiCellWidget( framegroup,0,2,1,1 );
+ headergroup->hide();
+ preamblegroup->hide();
+ }
+ grid->setRowStretch(3,1);
+
+ // init some special widgets
+ int buttonheight = m_pbFrame1->sizeHint().height();
+ m_pbFrame1->setFixedSize(buttonheight,buttonheight);
+ m_pbFrame2->setFixedSize(buttonheight,buttonheight);
+ m_pbFrame3->setFixedSize(buttonheight,buttonheight);
+ m_pbFrame4->setFixedSize(buttonheight,buttonheight);
+
+ m_pbFrame1->setPixmap( QPixmap(const_cast<const char**>(no_border_xpm)) );
+ m_pbFrame2->setPixmap( QPixmap(const_cast<const char**>(lr_border_xpm)) );
+ m_pbFrame3->setPixmap( QPixmap(const_cast<const char**>(tb_border_xpm)) );
+ m_pbFrame4->setPixmap( QPixmap(const_cast<const char**>(all_border_xpm)) );
+
+ borderframe->setFixedWidth(lineframe->sizeHint().width());
+ setButtonText(User1,"Re&set");
+
+ if ( m_header )
+ {
+ m_preamblelist = alignlist;
+ m_coHeader->insertStringList(m_preamblelist);
+ }
+
+ // init widget data
+ if ( data )
+ m_data = *data;
+ else
+ initWidgetData();
+ // init widgets
+ initWidgets();
+
+
+ // signals and slots
+ connect(m_pbFrame1, SIGNAL(clicked()), this, SLOT(slotFramebuttonClicked()));
+ connect(m_pbFrame2, SIGNAL(clicked()), this, SLOT(slotFramebuttonClicked()));
+ connect(m_pbFrame3, SIGNAL(clicked()), this, SLOT(slotFramebuttonClicked()));
+ connect(m_pbFrame4, SIGNAL(clicked()), this, SLOT(slotFramebuttonClicked()));
+ connect(this, SIGNAL(user1Clicked()),this, SLOT(slotResetClicked()));
+ if ( m_header )
+ {
+ connect(m_cbAt, SIGNAL(clicked()),this, SLOT(slotSeparatorClicked()));
+ connect(m_cbSep,SIGNAL(clicked()),this, SLOT(slotSeparatorClicked()));
+ }
+
+ QWhatsThis::add(m_coHeader,i18n("Column or cell alignment."));
+ QWhatsThis::add(m_cbBold,i18n("Set bold font series."));
+ QWhatsThis::add(m_cbItalic,i18n("Set italic font shape."));
+ QWhatsThis::add(m_rbAlignleft,i18n("The text will be aligned at the left border of the cell."));
+ QWhatsThis::add(m_rbAligncenter,i18n("The text will be centered."));
+ QWhatsThis::add(m_rbAlignright,i18n("The text will be aligned at the right border of the cell."));
+ QWhatsThis::add(m_ccBgcolor,i18n("Choose a background color (needs color package)."));
+ QWhatsThis::add(m_ccTextcolor,i18n("Choose a text color (needs color package)."));
+ QWhatsThis::add(m_cbPre,i18n("Insert decl directly in front of the column entry."));
+ QWhatsThis::add(m_cbPost,i18n("Insert decl right after the column entry."));
+ QWhatsThis::add(m_cbAt,i18n("Suppresses inter-column space and inserts decl directly."));
+ QWhatsThis::add(m_cbSep,i18n("Inserts decl, but does not suppress the normally inserted space between columns in contrast to @{decl}."));
+ QWhatsThis::add(m_pbFrame1,i18n("Clear all border lines."));
+ QWhatsThis::add(m_pbFrame2,i18n("Set left and right border lines."));
+ QWhatsThis::add(m_pbFrame3,i18n("Set upper and lower border line."));
+ QWhatsThis::add(m_pbFrame4,i18n("Set all border lines."));
+ QWhatsThis::add(m_cellframe,i18n("Set user defined border lines. A mouse click into one of the four border ranges will set or clear this special border line."));
+
+ setButtonWhatsThis(User1,i18n("Reset all settings to standard cell attributes: left alignment, normal font series and shape, white background color, black text color, no border lines."));
+}
+
+////////////////////////////// read data //////////////////////////////
+
+TabularCell::Data TabCellDialog::data()
+{
+ if ( m_header )
+ {
+ switch ( m_coHeader->currentItem() )
+ {
+ case 1 : m_data.align = Qt::AlignHCenter; break;
+ case 2 : m_data.align = Qt::AlignRight; break;
+ default : m_data.align = Qt::AlignLeft;
+ }
+ }
+ else
+ {
+ if ( m_rbAlignright->isChecked() )
+ m_data.align = Qt::AlignRight;
+ else if ( m_rbAligncenter->isChecked() )
+ m_data.align = Qt::AlignHCenter;
+ else
+ m_data.align = Qt::AlignLeft;
+ }
+
+ m_data.font = TabularCell::cfNormal;
+ if ( m_cbBold->isChecked() )
+ m_data.font |= TabularCell::cfBold;
+ if ( m_cbItalic->isChecked() )
+ m_data.font |= TabularCell::cfItalic;
+
+ m_data.border = m_cellframe->border();
+
+ m_data.bgcolor = m_ccBgcolor->color();
+ m_data.textcolor = m_ccTextcolor->color();
+
+ return m_data;
+}
+
+QString TabCellDialog::header()
+{
+ QString s;
+
+ if ( m_header )
+ {
+ if ( m_cbAt->isChecked() )
+ s += "@{} ";
+ if ( m_cbSep->isChecked() )
+ s += "!{} ";
+ if ( m_cbPre->isChecked() )
+ s += ">{} ";
+
+ s += m_coHeader->currentText().replace("{w}","{}");
+
+ if ( m_cbPost->isChecked() )
+ s += " <{}";
+ }
+
+ return s.stripWhiteSpace();
+}
+
+//////////////////// init widgets /////////////////////
+
+void TabCellDialog::initWidgetData()
+{
+ m_data.align = Qt::AlignLeft;
+ m_data.font = TabularCell::cfNormal;
+ m_data.border = TabularCell::cbNone;
+ m_data.bgcolor = QColor(Qt::white);
+ m_data.textcolor = QColor(Qt::black);
+}
+
+void TabCellDialog::initWidgets()
+{
+ if ( m_data.align & Qt::AlignRight )
+ m_rbAlignright->setChecked(true);
+ else if ( m_data.align & Qt::AlignHCenter )
+ m_rbAligncenter->setChecked(true);
+ else
+ m_rbAlignleft->setChecked(true);
+
+ m_cbBold->setChecked( m_data.font & TabularCell::cfBold );
+ m_cbItalic->setChecked( m_data.font & TabularCell::cfItalic );
+
+ m_ccBgcolor->setColor(m_data.bgcolor);
+ m_ccTextcolor->setColor(m_data.textcolor);
+
+ m_cellframe->setBorder(m_data.border);
+
+ if ( m_header )
+ {
+ QString s = m_headerlabel.remove(' ');
+
+ bool state = ( s.find("@{}") >= 0 );
+ if ( state )
+ s = s.remove("@{}");
+ m_cbAt->setChecked(state);
+
+ state = ( s.find("!{}") >= 0 );
+ if ( state )
+ s = s.remove("!{}");
+ m_cbSep->setChecked(state);
+
+ state = ( s.find(">{}") >= 0 );
+ if ( state )
+ s = s.remove(">{}");
+ m_cbPre->setChecked(state);
+
+ state = ( s.find("<{}") >= 0 );
+ if ( state )
+ s = s.remove("<{}");
+ m_cbPost->setChecked(state);
+
+ int pos = m_preamblelist.findIndex(s);
+ if ( pos < 0 )
+ pos = 0;
+ m_coHeader->setCurrentItem(pos);
+ }
+}
+
+//////////////////// the border of the frame changes /////////////////////
+
+void TabCellDialog::slotFramebuttonClicked()
+{
+ QString name = QString( sender()->name() ).section('_',1,1);
+
+ int border = -1;
+ if ( name == "no" )
+ border = TabularCell::cbNone;
+ else if ( name == "lr" )
+ border = TabularCell::cbLeft | TabularCell::cbRight;
+ else if ( name == "tb" )
+ border = TabularCell::cbTop | TabularCell::cbBottom;
+ else if ( name == "all" )
+ border = TabularCell::cbLeft | TabularCell::cbTop | TabularCell::cbBottom | TabularCell::cbRight;
+
+ if ( border >= 0 )
+ m_cellframe->setBorder(border);
+}
+
+void TabCellDialog::slotResetClicked()
+{
+ initWidgetData();
+ m_headerlabel = "l";
+ initWidgets();
+}
+
+void TabCellDialog::slotSeparatorClicked()
+{
+ QString checkboxname = sender()->name();
+ if ( m_cbAt->isChecked() && checkboxname=="cb_at" )
+ m_cbSep->setChecked(false);
+ else if ( m_cbSep->isChecked() && checkboxname=="cb_sep" )
+ m_cbAt->setChecked(false);
+}
+
+//////////////////////////////////////////////////////////////////////
+
+//BEGIN TabularItem
+
+TabularItem::TabularItem(QTable* table)
+ : QTableItem(table,QTableItem::OnTyping,QString::null)
+{
+ TabularTable *tab = dynamic_cast<TabularTable *>(table);
+ m_data = tab->defaultAttributes();
+}
+
+TabularItem::TabularItem(QTable* table, const TabularCell::Data &data)
+ : QTableItem(table,QTableItem::OnTyping,QString::null)
+{
+ m_data = data;
+}
+
+int TabularItem::alignment() const
+{
+ return m_data.align | Qt::AlignVCenter;
+}
+
+bool TabularItem::isMulticolumn()
+{
+ return ( colSpan() > 1 );
+}
+
+// paint the current cell and write the text with special font attributes
+void TabularItem::paint(QPainter *p,const QColorGroup &cg,const QRect &cr,bool selected)
+{
+ p->fillRect(0,0,cr.width(),cr.height(),
+ selected ? cg.brush(QColorGroup::Highlight) : m_data.bgcolor);
+
+ int w = cr.width();
+ int h = cr.height();
+
+ if ( selected )
+ p->setPen( cg.highlightedText() );
+ else
+ p->setPen(m_data.textcolor);
+
+ if ( m_data.font )
+ {
+ QFont f( p->font() );
+ if ( m_data.font & TabularCell::cfBold )
+ f.setBold(true);
+ if ( m_data.font & TabularCell::cfItalic )
+ f.setItalic(true);
+ p->setFont(f);
+ }
+
+ p->drawText( 2,0,w-4,h,alignment(), text() );
+}
+
+//END TabularItem
+
+//////////////////////////////////////////////////////////////////////
+
+TabularTable::TabularTable(int numRows,int numCols,QWidget* parent,TabularDialog *tabdialog)
+ : QTable(numRows,numCols,parent), m_tabdialog(tabdialog)
+{
+
+ setSelectionMode(QTable::Single);
+ setRowMovingEnabled(false);
+ setColumnMovingEnabled(false);
+ setSorting(false);
+
+ clearHorizontalHeader(0,numCols);
+ clearVerticalHeader(0,numRows);
+
+ // catch right mouse clicks in the table
+ connect( this, SIGNAL(contextMenuRequested(int,int,const QPoint &)),
+ this, SLOT(slotContextMenuClicked(int,int,const QPoint &)) );
+
+ // catch right mouse clicks in horizontal/vertical header
+ horizontalHeader()->installEventFilter(this);
+ verticalHeader()->installEventFilter(this);
+}
+
+////////////////////////////////////////////////////////////
+
+void TabularTable::clearHorizontalHeader(int col1,int col2)
+{
+ for ( int col=col1; col<col2; ++col )
+ horizontalHeader()->setLabel(col,"l");
+}
+
+void TabularTable::clearVerticalHeader(int row1,int row2)
+{
+ for ( int row=row1; row<row2; ++row )
+ verticalHeader()->setLabel(row,"");
+}
+
+bool TabularTable::isRowEmpty(int row)
+{
+ return isRowEmpty(row,0,numCols()-1);
+}
+
+bool TabularTable::isRowEmpty(int row,int col1, int col2)
+{
+ for ( int col=col1; col<=col2; ++col )
+ {
+ if ( updateCell(row,col) ) // check if there is an item
+ return false;
+ }
+ return true;
+}
+
+bool TabularTable::isColEmpty(int col)
+{
+ for ( int row=0; row<numRows(); ++row )
+ {
+ if ( updateCell(row,col) ) // check if there is an item
+ return false;
+ }
+ return true;
+}
+
+////////////////////////////// events //////////////////////////////
+
+bool TabularTable::eventFilter(QObject *o, QEvent *e)
+{
+ if ( e->type() == QEvent::MouseButtonPress )
+ {
+ QMouseEvent *me = (QMouseEvent*) e;
+ if ( me->button() == RightButton )
+ {
+ if ( o == horizontalHeader() )
+ {
+ mouseContextHorizontalHeader( me->pos().x() );
+ return true;
+ }
+ else if ( o == verticalHeader() )
+ {
+ mouseContextVerticalHeader( me->pos().y() );
+ return true;
+ }
+ }
+ }
+
+ return QTable::eventFilter(o,e);
+}
+
+void TabularTable::mouseContextHorizontalHeader(int pos)
+{
+ //KILE_DEBUG() << "horizontal header: rechts: " << horizontalHeader()->sectionAt(pos) << endl;
+ setupContextHeaderPopup(true,horizontalHeader()->sectionAt(pos));
+}
+
+void TabularTable::mouseContextVerticalHeader(int pos)
+{
+ //KILE_DEBUG() << "vertical header: rechts: " << verticalHeader()->sectionAt(pos) << endl;
+ setupContextHeaderPopup(false,verticalHeader()->sectionAt(pos));
+}
+
+////////////////////////////// cell items //////////////////////////////
+
+TabularCell::Data TabularTable::defaultAttributes()
+{
+ TabularCell::Data data;
+
+ data.align = Qt::AlignLeft;
+ data.font = TabularCell::cfNormal;
+ data.border = TabularCell::cbNone;
+ data.bgcolor = QColor(Qt::white);
+ data.textcolor = QColor(Qt::black);
+
+ return data;
+}
+
+bool TabularTable::isDefaultAttr(const TabularCell::Data &data)
+{
+ TabularCell::Data defaultdata = defaultAttributes();
+
+ return ( data.align == defaultdata.align &&
+ data.font == defaultdata.font &&
+ data.border == defaultdata.border &&
+ data.bgcolor == defaultdata.bgcolor &&
+ data.textcolor == defaultdata.textcolor
+ );
+}
+
+// We need a TabularItem for each cell with attributs. So we
+// always check first, if we have to create a new item.
+TabularItem *TabularTable::cellItem(int row,int col)
+{
+ QTableItem *cellitem = item(row,col);
+ if ( ! cellitem )
+ {
+ TabularItem *newitem = new TabularItem(this);
+ setItem(row,col,newitem);
+ return newitem;
+ }
+ else
+ return dynamic_cast<TabularItem*>(cellitem);
+}
+
+// Empty text is not written, if there is no QTableItem
+// or the current QTableItem has default attributes
+void TabularTable::setText(int row,int col,const QString &text)
+{
+ TabularItem *cellitem = cellItem(row,col);
+ cellitem->setText(text);
+ if ( text.isEmpty() )
+ updateCell(row,col);
+}
+
+void TabularTable::setAlignment(int row,int col,int align)
+{
+ TabularItem *cellitem = cellItem(row,col);
+ cellitem->m_data.align = align;
+ if ( align == Qt::AlignLeft )
+ updateCell(row,col);
+}
+
+void TabularTable::setColspan(int row,int col1,int col2,int numcols,const QString &text)
+{
+ //KILE_DEBUG() << "set colspan " << col1 << "-" << col2 << " "<< endl;
+ for ( int col=col1; col<=col2; )
+ {
+ TabularItem *olditem = dynamic_cast<TabularItem*>( item(row,col) );
+ if ( olditem )
+ {
+ if ( col != col1 )
+ delete olditem;
+ col += olditem->colSpan();
+ }
+ else
+ {
+ col++;
+ }
+ }
+
+ // only the leftmost item exists
+ TabularItem *cellitem = cellItem(row,col1);
+ cellitem->setText(text);
+ cellitem->setSpan(1,numcols);
+}
+
+bool TabularTable::isMulticolumn(int row,int col)
+{
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(row,col) );
+ return ( cellitem && cellitem->isMulticolumn() );
+}
+
+// Set new attributes. If all settings are default, delete QTableItem
+void TabularTable::setAttributes(int row,int col, const TabularCell::Data &data)
+{
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(row,col) );
+ if ( cellitem )
+ cellitem->m_data = data;
+ else
+ setItem(row,col,new TabularItem(this,data));
+
+ updateCell(row,col);
+}
+
+// clear all current attributes
+void TabularTable::clearAttributes(int row,int col)
+{
+ //KILE_DEBUG() << "clear attr (" << row << "/" << col << ")" << endl;
+ TabularCell::Data data = defaultAttributes();
+ setAttributes(row,col,data);
+}
+
+////////////////////////////// update cell //////////////////////////////
+
+// update text of current cell, which can be in edit mode
+
+void TabularTable::updateCurrentCell()
+{
+ if ( editMode() != QTable::NotEditing )
+ endEdit(currentRow(),currentColumn(),true,true);
+}
+
+// A cell is updated or is is asked, if there is still an entry.
+// Check if we need the QTableItem anymore. The result will be true,
+// if there is still a QTableItem, else false.
+bool TabularTable::updateCell(int row,int col)
+{
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(row,col) );
+ if ( ! cellitem )
+ return false; // no item
+
+ // there is an item
+ if ( cellitem->text().isEmpty() && isDefaultAttr(cellitem->m_data) && !cellitem->isMulticolumn() )
+ {
+ delete cellitem; // no text and standard attributes
+ return false; // no item anymore
+ }
+
+ return true;
+}
+
+// when editing is finished, we check, if the QTableItem is still needed
+void TabularTable::endEdit(int row,int col,bool accept,bool replace)
+{
+ QTable::endEdit(row,col,accept,replace);
+ //updateCell(row,col);
+}
+
+////////////////////////////// cellrange attributes //////////////////////////////
+
+// no attributes of multicoumn cells are changed
+
+void TabularTable::clearHeaderCells(bool cleartext,bool clearattributes)
+{
+ if ( m_horizontal )
+ clearCellrange(m_section,0,m_section,numRows()-1,cleartext,clearattributes);
+ else
+ clearCellrange(0,m_section,numCols()-1,m_section,cleartext,clearattributes);
+}
+
+void TabularTable::clearSelectionCells(bool cleartext,bool clearattributes)
+{
+ int x1,y1,x2,y2;
+ if ( getCurrentSelection(x1,y1,x2,y2) )
+ {
+ clearCellrange(x1,y1,x2,y2,cleartext,clearattributes);
+ }
+}
+
+void TabularTable::clearCellrange(int x1,int y1,int x2,int y2,bool cleartext,bool clearattributes)
+{
+ bool singlecell = (x1==x2 && y1==y2);
+
+ for ( int row=y1; row<=y2; ++row )
+ {
+ for ( int col=x1; col<=x2; ++col )
+ {
+ if ( cleartext )
+ setText(row,col,QString::null);
+
+ if ( clearattributes && (singlecell || !isMulticolumn(row,col)) )
+ clearAttributes(row,col);
+ }
+ }
+}
+
+void TabularTable::setCellrangeAttributes(int x1,int y1,int x2,int y2,const TabularCell::Data &data)
+{
+ bool singlecell = (x1==x2 && y1==y2);
+ //KILE_DEBUG() << x1 << " " << y1 << " "<< x2 << " "<< y2 << " " << data.align << endl;
+
+ for ( int col=x1; col<=x2; ++col )
+ {
+ for ( int row=y1; row<=y2; ++row )
+ {
+ if ( singlecell || !isMulticolumn(row,col) )
+ setAttributes(row,col,data);
+ }
+ }
+}
+
+void TabularTable::setCellrangeAlignment(int x1,int y1,int x2,int y2,int align)
+{
+ bool singlecell = (x1==x2 && y1==y2);
+
+ for (int col=x1; col<=x2; ++col )
+ {
+ for (int row=y1; row<=y2; ++row )
+ {
+ if ( singlecell || !isMulticolumn(row,col) )
+ setAlignment(row,col,align);
+ }
+ }
+}
+
+////////////////////////////// movement //////////////////////////////
+
+// Move horizontal instead of vertical to the next cell,
+// when pressing the enter key. If this happens in the
+// lower right cell, a new table line is inserted.
+void TabularTable::activateNextCell()
+{
+ int row = currentRow();
+ int col = currentColumn();
+
+ col = ( col+1 ) % numCols();
+ if ( col == 0 )
+ {
+ row++;
+ if ( row == numRows() )
+ {
+ m_tabdialog->slotRowValueChanged(row+1);
+ }
+ }
+
+ setCurrentCell(row,col);
+}
+
+////////////////////////////// paint //////////////////////////////
+
+// Paint a table cell with all attributes, if there is a QTableItem
+void TabularTable::paintCell( QPainter *p, int row, int col,
+ const QRect &cr, bool selected, const QColorGroup &cg )
+{
+ //KILE_DEBUG() << "r=" << row << " c" << col<< endl;
+
+ if ( selected && row == currentRow() && col == currentColumn()
+ && ( hasFocus() || viewport()->hasFocus() ) )
+ selected = false;
+
+ int w = cr.width();
+ int h = cr.height();
+ int x2 = w - 1;
+ int y2 = h - 1;
+
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(row,col) );
+ if ( cellitem )
+ {
+ p->save();
+ cellitem->paint( p, cg, cr, selected );
+ p->restore();
+ }
+ else
+ {
+ p->fillRect( 0,0,w,h, selected ? cg.brush( QColorGroup::Highlight )
+ : cg.brush( QColorGroup::Base ) );
+ }
+
+ // draw gridlines
+ if ( showGrid() )
+ {
+ // save current pen
+ QPen pen( p->pen() );
+
+ QColor gridlinecolor;
+ int gridColor = style().styleHint( QStyle::SH_Table_GridLineColor, this );
+ if (gridColor != -1)
+ {
+ const QPalette &pal = palette();
+ if ( cg != colorGroup() && cg != pal.disabled() && cg != pal.inactive() )
+ gridlinecolor = cg.mid(); // p->setPen(cg.mid());
+ else
+ gridlinecolor = (QRgb)gridColor; // p->setPen((QRgb)gridColor);
+ }
+ else
+ {
+ gridlinecolor = cg.mid(); // p->setPen(cg.mid());
+ }
+
+ // draw border
+ int colspan = 1;
+ int border = 0;
+ if ( cellitem )
+ {
+ colspan = cellitem->colSpan();
+ border = cellitem->m_data.border;
+
+ // draw left border only in column 0
+ if ( col==0 && (border & TabularCell::cbLeft) )
+ p->drawLine( 0,0,0,y2 );
+
+ // draw top border only in row 0
+ if ( row==0 && (border & TabularCell::cbTop) )
+ p->drawLine( 0,0,x2,0 );
+ }
+
+ // at the bottom border of the cell either the gridline or the
+ // bottom border (or the top border of the cell below) is drawn
+ bool drawborder;
+ if ( border & TabularCell::cbBottom )
+ drawborder = true;
+ else
+ {
+ TabularItem *below = dynamic_cast<TabularItem*>( item(row+1,col) );
+ drawborder = ( below && (below->m_data.border & TabularCell::cbTop) );
+ }
+ p->setPen( (drawborder) ? Qt::black : gridlinecolor );
+ p->drawLine( 0,y2,x2,y2 );
+
+ // at the right border of the cell either the gridline or the
+ // right border (or the left border of the cell below) is drawn
+ if ( border & TabularCell::cbRight )
+ drawborder = true;
+ else
+ {
+ TabularItem *right = dynamic_cast<TabularItem*>( item(row,col+colspan) );
+ drawborder = ( right && (right->m_data.border & TabularCell::cbLeft) );
+ }
+ p->setPen( (drawborder) ? Qt::black : gridlinecolor );
+ p->drawLine( x2,0,x2,y2 );
+
+ // restore pen
+ p->setPen( pen );
+ }
+}
+
+////////////////////////////// popup menus //////////////////////////////
+
+QPopupMenu *TabularTable::createPopupMenu()
+{
+ QPopupMenu *menu = new QPopupMenu(this);
+ menu->insertItem( i18n("Edit..."));
+ menu->insertSeparator();
+
+ return menu;
+}
+
+void TabularTable::insertPopupAlign(QPopupMenu *popup,bool header)
+{
+ // alignment
+ int align = 0;
+
+ //calculate
+ if ( header && m_x1==m_x2 )
+ {
+ QString label = horizontalHeader()->label(m_x1);
+ if ( label.find('l') < 0 )
+ align += 1;
+ if ( label.find('c') < 0 )
+ align += 2;
+ if ( label.find('r') < 0 )
+ align += 4;
+ } else
+ {
+ align = 7;
+ }
+
+ // insert
+ if ( align & 1 )
+ popup->insertItem( i18n("Align Left"));
+ if ( align & 2 )
+ popup->insertItem( i18n("Align Center"));
+ if ( align & 4 )
+ popup->insertItem( i18n("Align Right"));
+ if ( align > 0 )
+ popup->insertSeparator();
+}
+
+void TabularTable::insertPopupClear(QPopupMenu *popup)
+{
+ popup->insertItem( i18n("Clear Text"));
+ popup->insertItem( i18n("Clear Attributes"));
+ popup->insertItem( i18n("Clear All"));
+}
+
+int TabularTable::popupId(QPopupMenu *popup, int id)
+{
+ QString entry = popup->text(id);
+
+ int result = PopupNone;
+ if ( entry == i18n("Edit...") )
+ result = PopupEdit;
+ else if ( entry == i18n("Set Multicolumn") )
+ result = PopupSet;
+ else if ( entry == i18n("Break Multicolumn") )
+ result = PopupBreak;
+ else if ( entry == i18n("Align Left") )
+ result = PopupLeft;
+ else if ( entry == i18n("Align Center") )
+ result = PopupCenter;
+ else if ( entry == i18n("Align Right") )
+ result = PopupRight;
+ else if ( entry == i18n("Clear Text") )
+ result = PopupText;
+ else if ( entry == i18n("Clear Attributes") )
+ result = PopupAttributes;
+ else if ( entry == i18n("Clear All") )
+ result = PopupAll;
+
+ return result;
+}
+
+////////////////////////////// cellrange: right mouse button //////////////////////////////
+
+void TabularTable::slotContextMenuClicked(int row,int col,const QPoint &)
+{
+ //KILE_DEBUG() << "context menu clicked" << endl;
+ if ( row<0 || col<0 )
+ return;
+
+ if ( ! getCurrentSelection(m_x1,m_y1,m_x2,m_y2) )
+ return;
+
+ // create popup menu
+ m_cellpopup = createPopupMenu();
+
+ // multicolumns
+ if ( m_y1 == m_y2 )
+ {
+ if ( m_x1 == m_x2 )
+ {
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(m_y1,m_x1) );
+ if ( cellitem && cellitem->isMulticolumn() )
+ {
+ m_cellpopup->insertItem( i18n("Break Multicolumn"));
+ m_cellpopup->insertSeparator();
+ }
+ }
+ else if ( m_x2 > m_x1 )
+ {
+ TabularItem *cellitem1 = dynamic_cast<TabularItem*>( item(m_y1,m_x1) );
+ TabularItem *cellitem2 = dynamic_cast<TabularItem*>( item(m_y2,m_x2) );
+ if ( (!cellitem1 && !cellitem2) || (cellitem1!=cellitem2) )
+ {
+ m_cellpopup->insertItem( i18n("Set Multicolumn"));
+ m_cellpopup->insertSeparator();
+ }
+ }
+ }
+
+ insertPopupAlign(m_cellpopup,false);
+ insertPopupClear(m_cellpopup);
+
+ connect(m_cellpopup,SIGNAL(activated(int)),this,SLOT(slotCellPopupActivated(int)));
+ m_cellpopup->exec( QCursor::pos() );
+ clearSelection();
+}
+
+
+void TabularTable::slotCellPopupActivated(int id)
+{
+ switch ( popupId(m_cellpopup,id) )
+ {
+ case PopupEdit : cellPopupEdit(); break;
+ case PopupSet : cellPopupSetMulticolumn(); break;
+ case PopupBreak : cellPopupBreakMulticolumn(); break;
+ case PopupLeft : cellPopupAlign(Qt::AlignLeft); break;
+ case PopupCenter : cellPopupAlign(Qt::AlignHCenter); break;
+ case PopupRight : cellPopupAlign(Qt::AlignRight); break;
+ case PopupText : clearSelectionCells(true,false); break;
+ case PopupAttributes : clearSelectionCells(false,true); break;
+ case PopupAll : clearSelectionCells(true,true); break;
+ }
+}
+
+void TabularTable::cellPopupEdit()
+{
+ //KILE_DEBUG() << "cellPopupEdit" << endl;
+
+ // default edit mode for a range: no data and no header
+ TabularCell::Data *pdata = 0;
+
+ // if there one single cell, we use the attributes if they exist
+ if ( m_x1==m_x2 && m_y1==m_y2 )
+ {
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(m_y1,m_x1) );
+ if ( cellitem )
+ pdata = &(cellitem->m_data);
+ }
+
+ //KILE_DEBUG() << "sel " << x1 << " " << y1 << " " << x2 << " " << y2 << endl;
+ cellParameterDialog(m_x1,m_y1,m_x2,m_y2,pdata,QString::null);
+}
+
+void TabularTable::cellPopupSetMulticolumn()
+{
+ //KILE_DEBUG() << "slotContextMenuSetMulticolumn" << endl;
+ //KILE_DEBUG() << "set mc " << m_x1 << " " << m_y1 << " " << m_x2 << " " << m_y2 << endl;
+
+ if ( m_y1==m_y2 && m_x2>m_x1)
+ {
+ // get full cell range including possible multicolumn cells
+ int xl,xr;
+ getCellRange(m_y1,m_x1,m_x2,xl,xr);
+
+ QString s = getCellRangeText(m_y1,xl,xr);
+ if ( ! s.isEmpty() )
+ {
+ QString message = i18n("Concat all text to the new multicolumn cell?");
+ if ( KMessageBox::questionYesNo(this,message,i18n("Save Text")) != KMessageBox::Yes )
+ s = QString::null;
+ }
+ setColspan(m_y1,xl,xr,xr-xl+1,s);
+ // update();
+ }
+}
+
+void TabularTable::cellPopupBreakMulticolumn()
+{
+ //KILE_DEBUG() << "slotContextMenuBreakMulticolumn" << endl;
+ //KILE_DEBUG() << "set mc " << m_x1 << " " << m_y1 << " " << m_x2 << " " << m_y2 << endl;
+
+ if ( m_x1==m_x2 && m_y1==m_y2 )
+ {
+ // get full cell range including possible multicolumn cells
+ int xl,xr;
+ getCellRange(m_y1,m_x1,m_x2,xl,xr);
+
+ QString s = getCellRangeText(m_y1,xl,xr);
+ if ( ! s.isEmpty() )
+ {
+ if ( KMessageBox::questionYesNo(this,
+ i18n("Transfer text and all attributes of the multicolumn cell to the leftmost of the separated cell?"),
+ i18n("Shrink Multicolumn")) != KMessageBox::Yes )
+ s = QString::null;
+ }
+
+ setColspan(m_y1,xl,xr,1,s);
+ }
+}
+
+void TabularTable::cellPopupAlign(int align)
+{
+ setCellrangeAlignment(m_x1,m_y1,m_x2,m_y2,align);
+}
+
+// get real cell range including possible multicolumn cells
+void TabularTable::getCellRange(int row,int col1, int col2, int &xl, int &xr)
+{
+ // search the first cell of this range
+ xl = col1;
+ TabularItem *cellitem1 = dynamic_cast<TabularItem*>( item(row,col1) );
+ if ( cellitem1 && cellitem1->isMulticolumn() )
+ {
+ for ( int col=col1-1; col>=0; --col )
+ {
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(row,col) );
+ if ( cellitem == cellitem1 )
+ xl = col;
+ else
+ break;
+ }
+ }
+
+ // search the last cell of this range
+ xr = col2;
+ TabularItem *cellitem2 = dynamic_cast<TabularItem*>( item(row,col2) );
+ if ( cellitem2 && cellitem2->isMulticolumn() )
+ {
+ for ( int col=col2+1; col<numCols(); ++col )
+ {
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(row,col) );
+ if ( cellitem == cellitem2 )
+ xr = col;
+ else
+ break;
+ }
+ }
+}
+
+// get text from real cell range including possible multicolumn cells
+QString TabularTable::getCellRangeText(int row,int col1, int col2)
+{
+ QString s;
+ for ( int col=col1; col<=col2; )
+ {
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(row,col) );
+ if ( cellitem )
+ {
+ s += cellitem->text();
+ col += cellitem->colSpan();
+ }
+ else
+ {
+ col++;
+ }
+ }
+ return s;
+}
+
+////////////////////////////// header: right mouse button //////////////////////////////
+
+void TabularTable::setupContextHeaderPopup(bool horizontal, int section)
+{
+ //KILE_DEBUG() << "setupContextHeaderPopup" << endl;
+
+ // save header parametr
+ m_horizontal = horizontal;
+ m_section = section;
+
+ // we always define a selection
+ bool selection = getCurrentSelection(m_x1,m_y1,m_x2,m_y2);
+ if ( ! selection )
+ {
+ if ( m_horizontal )
+ {
+ m_x1 = m_x2 = m_section;
+ m_y1 = 0;
+ m_y2 = numRows() - 1;
+ }
+ else
+ {
+ m_x1 = 0;
+ m_x2 = numCols() - 1;
+ m_y1 = m_y2 = m_section;
+ }
+ }
+
+ // create popup menu
+ m_headerpopup = createPopupMenu();
+ insertPopupAlign(m_headerpopup,m_horizontal);
+ insertPopupClear(m_headerpopup);
+
+ connect(m_headerpopup,SIGNAL(activated(int)),this,SLOT(slotHeaderPopupActivated(int)));
+ m_headerpopup->exec( QCursor::pos() );
+}
+
+void TabularTable::slotHeaderPopupActivated(int id)
+{
+ switch ( popupId(m_headerpopup,id) )
+ {
+ case PopupEdit : headerPopupEdit(); break;
+ case PopupSet : break;
+ case PopupBreak : break;
+ case PopupLeft : headerPopupAlign('l'); break;
+ case PopupCenter : headerPopupAlign('c'); break;
+ case PopupRight : headerPopupAlign('r'); break;
+ case PopupText : clearHeaderCells(true,false); break;
+ case PopupAttributes : clearHeaderCells(false,true); break;
+ case PopupAll : clearHeaderCells(true,true); break;
+ }
+}
+
+void TabularTable::headerPopupEdit()
+{
+ //KILE_DEBUG() << "HeaderPopupEdit" << endl;
+
+ if ( m_horizontal )
+ {
+ // default header label
+ QString label = horizontalHeader()->label(m_section);
+
+ // look if all labels are equal
+ for ( int col=m_x1; col<=m_x2; ++col )
+ {
+ if ( label != horizontalHeader()->label(col) )
+ {
+ label = "l";
+ break;
+ }
+ }
+
+ // call parameter dialog
+ //KILE_DEBUG() << "col1=" << col1 << " col2=" << col2 << " " << label << endl;
+ cellParameterDialog( m_x1,0,m_x2,numRows()-1,0,label );
+ }
+ else
+ cellParameterDialog(0,m_y1,numCols()-1,m_y2,0,QString::null);
+ // cellParameterDialog(0,m_section,numCols()-1,m_section,0,QString::null);
+}
+
+void TabularTable::headerPopupAlign(QChar alignchar)
+{
+ int align;
+ switch ( alignchar )
+ {
+ case 'c' : align = Qt::AlignHCenter; break;
+ case 'r' : align = Qt::AlignRight; break;
+ default : align = Qt::AlignLeft;
+ }
+ setCellrangeAlignment(m_x1,m_y1,m_x2,m_y2,align);
+ if ( m_horizontal )
+ updateHeaderAlignment(m_x1,m_x2,alignchar);
+}
+
+// adjust headerlabel: lcr
+void TabularTable::updateHeaderAlignment(int col1,int col2,QChar alignchar)
+{
+ QStringList list = m_tabdialog->columnAlignments();
+
+ for ( int col=col1; col<=col2; ++col )
+ {
+ QString label = horizontalHeader()->label(col);
+ for ( uint i=0; i<list.count(); ++i )
+ {
+ if ( label.find(list[i]) >= 0 )
+ {
+ horizontalHeader()->setLabel( col,label.replace(list[i],alignchar) );
+ break;
+ }
+ }
+ }
+}
+
+////////////////////////////// selection //////////////////////////////
+
+bool TabularTable::getCurrentSelection(int &x1,int &y1,int &x2,int &y2)
+{
+ // look if there is a selection
+ int nr = currentSelection();
+ if ( nr >= 0 )
+ {
+ // get parameter of current selection
+ QTableSelection sel = selection(nr);
+ x1 = sel.leftCol();
+ y1 = sel.topRow();
+ x2 = sel.rightCol();
+ y2 = sel.bottomRow();
+ return true;
+ }
+ else
+ return false;
+}
+
+
+////////////////////////////// dialog for cell parameters //////////////////////////////
+
+// cell parameter dialog for a range of cells or a single cell
+// - single cell: current attributes are shown
+// - cellrange: attributes are shown, if they are all equal
+void TabularTable::cellParameterDialog(int x1,int y1,int x2,int y2, TabularCell::Data *data,
+ const QString &headerlabel)
+{
+ //KILE_DEBUG() << "selection " << x1 << " " << y1 << " " << x2 << " " << y2 << endl;
+
+ // if no settings are given, we should test all cells int the range if
+ // they are defined and have the same values
+ if ( ! data )
+ {
+ TabularCell::Data defaultdata = defaultAttributes();
+
+ // look if there is a QTableItem in the upper left cell
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(y1,x1) );
+
+ // Now test the range. If the result is true, cellitem must be defined
+ if ( equalParameter(x1,y1,x2,y2,DataAlign) )
+ defaultdata.align = cellitem->m_data.align;
+ if ( equalParameter(x1,y1,x2,y2,DataFont) )
+ defaultdata.font = cellitem->m_data.font;
+ if ( equalParameter(x1,y1,x2,y2,DataBorder) )
+ defaultdata.border = cellitem->m_data.border;
+ if ( equalParameter(x1,y1,x2,y2,DataBgcolor) )
+ defaultdata.bgcolor = cellitem->m_data.bgcolor;
+ if ( equalParameter(x1,y1,x2,y2,DataTextcolor) )
+ defaultdata.textcolor = cellitem->m_data.textcolor;
+ data = &defaultdata;
+ }
+ enum { DataAlign, DataFont, DataBorder, DataBgcolor, DataTextcolor };
+
+ KileDialog::TabCellDialog *dlg = new KileDialog::TabCellDialog(this,data,
+ headerlabel,m_tabdialog->columnAlignments());
+ if ( dlg->exec() )
+ {
+ // set attributes
+ setCellrangeAttributes(x1,y1,x2,y2,dlg->data());
+
+ // adjust header
+ for ( int col=x1; col<=x2; ++col )
+ {
+ if ( ! headerlabel.isEmpty() )
+ {
+ //KILE_DEBUG() << "header col=" << col << " " << dlg->header() << endl;
+ horizontalHeader()->setLabel(col,dlg->header());
+ }
+ }
+ clearSelection();
+ }
+ delete dlg;
+}
+
+bool TabularTable::equalParameter(int x1,int y1,int x2,int y2, int code)
+{
+ // no QTableItem, so we should take default values
+ TabularItem *upperleft = dynamic_cast<TabularItem*>( item(y1,x1) );
+ if ( ! upperleft )
+ return false;
+
+ // get attributes from upper left cell
+ TabularCell::Data data;
+ data = upperleft->m_data;
+
+ // look if all cells in this range have the same attributes
+ for ( int row=y1; row<=y2; ++row )
+ {
+ for ( int col=x1; col<=x2; ++col )
+ {
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(row,col) );
+ if ( ! cellitem )
+ return false;
+
+ switch ( code )
+ {
+ case DataAlign: if ( cellitem->m_data.align != data.align ) return false;
+ break;
+ case DataFont: if ( cellitem->m_data.font != data.font ) return false;
+ break;
+ case DataBorder: if ( cellitem->m_data.border != data.border ) return false;
+ break;
+ case DataBgcolor: if ( cellitem->m_data.bgcolor != data.bgcolor ) return false;
+ break;
+ case DataTextcolor: if ( cellitem->m_data.textcolor != data.textcolor ) return false;
+ break;
+ default: return false;
+ }
+ }
+ }
+
+ // yes, unbelievable but true
+ return true;
+}
+
+// test, if this cell has a vline at the left or right border)
+bool TabularTable::isVLine(int row,int col, bool left)
+{
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(row,col) );
+ if ( !cellitem )
+ return false;
+
+ bool vlinefound = false;
+ if ( left )
+ {
+ // look at the left border
+ if ( cellitem->m_data.border & TabularCell::cbLeft )
+ return true;
+ // look also at the right border of the left neighbour
+ if ( col > 0 )
+ {
+ TabularItem *left = dynamic_cast<TabularItem*>( item(row,col-1) );
+ vlinefound = ( left && (left->m_data.border & TabularCell::cbRight) );
+ }
+ }
+ else
+ {
+ // look at the right border
+ if ( cellitem->m_data.border & TabularCell::cbRight )
+ return true;
+ // look also at the left border of the right neighbour
+ if ( col < numCols()-1 )
+ {
+ TabularItem *left = dynamic_cast<TabularItem*>( item(row,col-1) );
+ vlinefound = ( left && (left->m_data.border & TabularCell::cbRight) );
+ }
+ }
+
+ return vlinefound;
+}
+
+// Count vertical lines on the left side. If there is none,
+// we also check the right border of the left neighbour.
+TabularCell::CountLines TabularTable::countVLines(int col, bool left)
+{
+ TabularCell::CountLines count;
+ count.cnt = 0;
+ count.cells = 0;
+ count.list.clear();
+
+ for ( int row=0; row<numRows(); ++row )
+ {
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(row,col) );
+ if ( cellitem )
+ {
+ if ( cellitem->isMulticolumn() ) // ignore multicolumn cells
+ continue;
+
+ //KILE_DEBUG() << "count vlines " << col << " row=" << row << " found" << endl;
+ count.cells++;
+ if ( isVLine(row,col,left) )
+ count.cnt++;
+ }
+ else if ( col>0 && isVLine(row,col,false) )
+ {
+ count.cnt++;
+ }
+ }
+
+ return count;
+}
+
+// looking at to bottom of the line (or the top of the next line)
+TabularCell::CountLines TabularTable::countHLines(int row, bool top)
+{
+ bool neighbour;
+ bool hline;
+
+ TabularCell::CountLines count;
+ count.cnt = 0;
+ count.cells = numCols();
+ count.list.clear();
+
+ int linestate = false;
+ for ( int col=0; col<numCols(); ++col )
+ {
+ hline = false;
+
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(row,col) );
+ neighbour = ( cellitem ) ? false : true;
+ if ( cellitem )
+ {
+ if ( top )
+ {
+ if ( cellitem->m_data.border & TabularCell::cbTop )
+ hline = true;
+ }
+ else
+ {
+ if ( cellitem->m_data.border & TabularCell::cbBottom )
+ hline = true;
+ else
+ neighbour = true;
+ }
+ }
+
+ if ( neighbour )
+ {
+ TabularItem *below = dynamic_cast<TabularItem*>( item(row+1,col) );
+ if( below && (below->m_data.border & TabularCell::cbTop) )
+ hline = true;
+ }
+
+ // update counter and list of hline cells
+ if ( hline )
+ {
+ if ( ! linestate )
+ {
+ count.list.append(col);
+ linestate = true;
+ }
+ count.cnt++;
+ }
+ else
+ {
+ if ( linestate )
+ {
+ count.list.append(col-1);
+ linestate = false;
+ }
+ }
+ }
+ if ( linestate )
+ count.list.append(numCols()-1);
+
+ return count;
+}
+
+
+TabularCell::Count TabularTable::countCells(int x1,int y1,int x2,int y2)
+{
+ //KILE_DEBUG() << "count font,colors,textcolors" << endl;
+
+ QMap<QString,int> colors;
+ QMap<QString,int> textcolors;
+ QMapIterator<QString,int> it, itw, itb;
+
+ QString whitename = Qt::white.name();
+ colors[whitename] = 0;
+ itw = colors.find(whitename);
+
+ QString blackname = Qt::black.name();
+ textcolors[blackname] = 0;
+ itb = textcolors.find(blackname);
+
+ // initialize result
+ TabularCell::Count count = { 0,0,0,0,0, whitename,blackname };
+
+ // although it looks like a range, it is simply a row or a column,
+ // because either x1=x2 or y1=y2
+ for ( int row=y1; row<=y2; ++row )
+ {
+ for ( int col=x1; col<=x2; ++col )
+ {
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( item(row,col) );
+ if ( cellitem )
+ {
+ if ( cellitem->isMulticolumn() ) // ignore multicolumn cells
+ continue;
+
+ // check bold
+ if ( cellitem->m_data.font & TabularCell::cfBold )
+ count.bold++;
+
+ // check italic
+ if ( cellitem->m_data.font & TabularCell::cfItalic )
+ count.italic++;
+
+ // check backgroundcolor
+ QString name = cellitem->m_data.bgcolor.name();
+ it = colors.find(name);
+ if ( it != colors.end() )
+ (*it)++;
+ else
+ colors[name] = 1;
+
+ // check textcolor
+ name = cellitem->m_data.textcolor.name();
+ it = textcolors.find(name);
+ if ( it != textcolors.end() )
+ (*it)++;
+ else
+ textcolors[name] = 1;
+
+ }
+ else
+ {
+ (*itw)++;
+ (*itb)++;
+ }
+ count.cells++; // total number of cells without multicolumns
+ }
+ }
+
+ // determine maximum result from dictionary for backgroundcolors
+ for ( it=colors.begin(); it!=colors.end(); ++it)
+ {
+ if ( it.data() > count.bgcolor )
+ {
+ count.bgcolor = it.data();
+ count.nameBgcolor = it.key();
+ }
+ }
+
+ // determine maximum result from dictionary for textcolors
+ for ( it=textcolors.begin(); it!=textcolors.end(); ++it)
+ {
+ if ( it.data() > count.textcolor )
+ {
+ count.textcolor = it.data();
+ count.nameTextcolor = it.key();
+ }
+ }
+
+ return count;
+}
+
+
+////////////////////////////// check parameter //////////////////////////////
+
+//END TabularTable
+
+//////////////////////////////////////////////////////////////////////
+
+//BEGIN TabularDialog
+
+TabularDialog::TabularDialog(QWidget *parent, KConfig *config, KileDocument::LatexCommands *commands, bool tabularenv)
+ : Wizard(config,parent), m_latexCommands(commands)
+{
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+ setCaption(i18n("Tabular Environments"));
+
+ QVBoxLayout *vbox = new QVBoxLayout( page, 6,6);
+
+ // Table
+ m_table = new TabularTable(3,3,page,this);
+
+ // remark
+ QLabel *labelRemark = new QLabel( i18n("<center>Hint: You can set some cell properties with a right mouse click.</center>") ,page);
+
+ // environment group
+ QButtonGroup *group = new QButtonGroup( i18n("Environment"),page);
+ group->setColumnLayout(0, Qt::Vertical );
+ group->layout()->setSpacing( 4 );
+ group->layout()->setMargin( 11 );
+
+ QLabel *label1 = new QLabel(i18n("&Name:"),group);
+ QLabel *label2 = new QLabel(i18n("&Parameter:"),group);
+ QLabel *label3 = new QLabel(i18n("Number of &rows:"),group);
+ QLabel *label4 = new QLabel(i18n("Number of c&ols:"),group);
+ m_coEnvironment = new QComboBox(group);
+ m_coParameter = new QComboBox(group);
+ m_spRows = new QSpinBox(1,99,1,group);
+ m_spCols = new QSpinBox(1,49,1,group);
+ m_cbWarning = new QCheckBox(i18n("&Delete also non empty rows or columns, but ask"),group);
+ m_cbBooktabs = new QCheckBox(i18n("Use boo&ktabs package"),group);
+ m_cbStarred = new QCheckBox(i18n("Use starred &version"),group);
+ m_cbCenter = new QCheckBox(i18n("C&enter"),group);
+ m_cbBullets = new QCheckBox(i18n("Insert &bullets"),group);
+
+ QGridLayout *grouplayout = new QGridLayout( group->layout() );
+ grouplayout->setAlignment( Qt::AlignTop );
+ grouplayout->setColStretch(5,1);
+ grouplayout->addWidget( label1, 0,0 );
+ grouplayout->addWidget( label2, 1,0 );
+ grouplayout->addWidget( m_coEnvironment, 0,1 );
+ grouplayout->addWidget( m_coParameter, 1,1 );
+ grouplayout->setColSpacing(2,24);
+ grouplayout->addWidget( label3, 0,3 );
+ grouplayout->addWidget( label4, 1,3 );
+ grouplayout->addWidget( m_spRows, 0,4 );
+ grouplayout->addWidget( m_spCols, 1,4 );
+ grouplayout->setRowSpacing(2,8);
+
+ grouplayout->addMultiCellWidget( m_cbWarning, 3,3,0,4, Qt::AlignLeft );
+
+ grouplayout->addMultiCellWidget( m_cbStarred, 4,4,0,1, Qt::AlignLeft );
+ grouplayout->addMultiCellWidget( m_cbBooktabs, 5,5,0,1, Qt::AlignLeft );
+ grouplayout->addMultiCellWidget( m_cbCenter, 4,4,3,4, Qt::AlignLeft );
+ grouplayout->addMultiCellWidget( m_cbBullets, 5,5,3,4, Qt::AlignLeft );
+
+ // add widgets
+ vbox->addWidget( m_table);
+ vbox->addSpacing(4);
+ vbox->addWidget(labelRemark);
+ vbox->addSpacing(4);
+ vbox->addWidget( group );
+
+ label1->setBuddy(m_coEnvironment);
+ label2->setBuddy(m_coParameter);
+ label3->setBuddy(m_spRows);
+ label4->setBuddy(m_spCols);
+
+ // init widgets
+ m_table->setMinimumHeight( m_table->sizeHint().height()-3 );
+ m_spRows->setValue(3);
+ m_spCols->setValue(3);
+ m_cbCenter->setChecked(true);
+ m_cbBullets->setChecked(true);
+
+ // init all environments
+ initEnvironments(tabularenv);
+
+ // remember current values
+ m_rows = m_spRows->value();
+ m_cols = m_spCols->value();
+
+ m_table->setFocus();
+ resize(sizeHint().width(),sizeHint().height()+50);
+
+ // signals and slots
+ connect( m_coEnvironment, SIGNAL(activated(const QString &)),
+ this, SLOT(slotEnvironmentChanged(const QString &)));
+ connect( m_spRows, SIGNAL(valueChanged(int)), this, SLOT(slotRowValueChanged(int)));
+ connect( m_spCols, SIGNAL(valueChanged(int)), this, SLOT(slotColValueChanged(int)));
+
+ QWhatsThis::add(m_table,i18n("Input data. When you press Enter, the cursor will move to the cell right of the current cell. A click with the right mouse button on a cell or a range of cells will open a popup menu, where you can edit attributes, clear attributes, delete text or define multicolumn cells."));
+ QWhatsThis::add(m_table->horizontalHeader(),i18n("Current layout of the preamble. A click with the right mouse button will open a popup menu, where you can edit some attributes of all cells, which belong to the selected columns."));
+ QWhatsThis::add(m_table->verticalHeader(),i18n("A click with the right mouse button will open a popup menu, where you can edit some attributes of all cells, which belong to the selected rows."));
+ QWhatsThis::add(m_coEnvironment,i18n("Choose an environment."));
+ QWhatsThis::add(m_coParameter,i18n("Optional parameter for the chosen environment."));
+ QWhatsThis::add(m_spRows,i18n("Choose the number of table rows."));
+ QWhatsThis::add(m_spCols,i18n("Choose the number of table columns."));
+ QWhatsThis::add(m_cbWarning,i18n("If you want, you will be asked before a non empty row a column is deleted."));
+ QWhatsThis::add(m_cbCenter,i18n("The tabular will be centered."));
+ QWhatsThis::add(m_cbBooktabs,i18n("Use line commands of the booktabs package."));
+ QWhatsThis::add(m_cbStarred,i18n("Use the starred version of this environment."));
+ QWhatsThis::add(m_cbBullets,i18n("Insert bullets in each cell. Alt+Ctrl+Right and Alt+Ctrl+Left will move very quick from one cell to another."));
+
+}
+
+void TabularDialog::initEnvironments(bool tabularenv)
+{
+ // read all tabular environments and insert them into the combobox
+ QStringList list;
+ QStringList::ConstIterator it;
+ m_latexCommands->commandList(list,KileDocument::CmdAttrTabular,false);
+ for ( it=list.begin(); it != list.end(); ++it )
+ {
+ m_coEnvironment->insertItem(*it);
+ }
+
+ // initialize first environment
+ if ( tabularenv )
+ m_coEnvironment->setCurrentText("tabular");
+ else
+ m_coEnvironment->setCurrentText("array");
+
+ // initialize
+ slotEnvironmentChanged( m_coEnvironment->currentText() );
+}
+
+////////////////////////////// table changed//////////////////////////////
+
+void TabularDialog::slotEnvironmentChanged(const QString &env)
+{
+ //KILE_DEBUG() << "env changed " << env << endl;
+
+ // clear parameter combobox
+ m_coParameter->clear();
+ m_coParameter->setEnabled(false);
+
+ // look for environment parameter in dictionary
+ KileDocument::LatexCmdAttributes attr;
+ if ( m_latexCommands->commandAttributes(env,attr) )
+ {
+ // starred version
+ m_cbStarred->setEnabled( attr.starred );
+
+ // option
+ if ( attr.option.find('[') == 0 )
+ {
+ QStringList optionlist = QStringList::split("",attr.option);
+ if ( optionlist.count() > 2 )
+ {
+ // ok, let's enable it
+ m_coParameter->setEnabled(true);
+ m_coParameter->insertItem(QString::null);
+ // insert some options
+ for ( uint i=1; i<optionlist.count()-1; ++i )
+ m_coParameter->insertItem(optionlist[i]);
+ }
+ }
+ }
+
+ m_alignlist.clear();
+ m_alignlist << "l" << "c" << "r" << "p{w}" << "m{w}" << "b{w}";
+ if ( env=="tabularx" || env=="xtabular")
+ m_alignlist << "X";
+}
+
+bool TabularDialog::isMathmodeEnvironment(const QString &env)
+{
+ return m_latexCommands->isMathModeEnv(env);
+}
+
+void TabularDialog::slotRowValueChanged(int value)
+{
+ //KILE_DEBUG() << "row value changed " << value << endl;
+
+ bool askBeforeDelete = m_cbWarning->isChecked();
+ bool firstwarning = true;
+
+ if ( value < m_rows ) // problems may only happen when decreasing
+ {
+ int testvalue = value;
+ value = m_rows;
+ for ( int row=m_rows-1; row>=testvalue; row-- )
+ {
+ if ( m_table->isRowEmpty(row) )
+ {
+ value = row;
+ }
+ else
+ {
+ if ( ! askBeforeDelete ) break;
+ if ( firstwarning )
+ {
+ QString message = i18n("Do you want to delete this row?");
+ if (KMessageBox::warningContinueCancel(this, message, i18n("Delete"))!=KMessageBox::Continue)
+ break;
+ firstwarning = false;
+ }
+ value = row;
+ }
+ }
+ }
+ m_spRows->setValue(value); // perhaps corrected
+
+ m_table->setNumRows(value);
+ if ( value > m_rows )
+ m_table->clearVerticalHeader(m_rows,value);
+ m_rows = value;
+}
+
+void TabularDialog::slotColValueChanged(int value)
+{
+ bool askBeforeDelete = m_cbWarning->isChecked();
+ bool firstwarning = true;
+
+ if ( value < m_cols ) // problems may only happen when decreasing
+ {
+ int testvalue = value;
+ value = m_cols;
+ for ( int col=m_cols-1; col>=testvalue; col-- )
+ {
+ if ( m_table->isColEmpty(col) )
+ value = col;
+ else
+ {
+ if ( ! askBeforeDelete ) break;
+ if ( firstwarning )
+ {
+ QString message = i18n("Do you want to delete this column?");
+ if (KMessageBox::warningContinueCancel(this, message, i18n("Delete"))!=KMessageBox::Continue)
+ break;
+ firstwarning = false;
+ }
+ value = col;
+ }
+ }
+ m_spCols->setValue(value); // perhaps corrected
+ }
+
+ m_table->setNumCols(value);
+ if ( value > m_cols )
+ m_table->clearHorizontalHeader(m_cols,value);
+ m_cols = value;
+
+}
+
+QStringList TabularDialog::columnAlignments()
+{
+ return m_alignlist;
+}
+
+////////////////////////////// color management//////////////////////////////
+
+char TabularDialog::defineColor(const QString &name, QMap<QString,char> &colors, char &colorcode)
+{
+ if ( colorcode == '?' )
+ return '?';
+
+ // look for current color
+ QMapIterator<QString,char> it;
+ it = colors.find(name);
+ if ( it != colors.end() )
+ return (*it);
+
+ // not found: insert into color dictionary
+ colors[name] = colorcode;
+ if ( colorcode != 'W' )
+ colorcode++;
+ else
+ colorcode = '?';
+ return colors[name];
+}
+
+QString TabularDialog::convertColor(int value)
+{
+ if ( value == 0 )
+ return "0";
+ else if ( value == 255 )
+ return "1";
+
+ QString s;
+ s = s.setNum( (float)value/256.0,'f',4);
+ while ( s.right(1) == "0" )
+ s.truncate( s.length()-1 );
+
+ return s;
+}
+
+QStringList TabularDialog::sortColorTable(QMap<QString,char> &colors)
+{
+ QMapConstIterator<QString,char> it;
+ QStringList list;
+
+ int r,g,b;
+ QColor c;
+ QString s,sred,sgreen,sblue;
+ for ( it=colors.begin(); it!=colors.end(); ++it )
+ {
+ c.setNamedColor(it.key());
+ c.getRgb(&r,&g,&b);
+ if ( r!=g || r!=b )
+ {
+ sred = convertColor(r);
+ sgreen = convertColor(g);
+ sblue = convertColor(b);
+ s = QString("{rgb}{%1,%2,%3}").arg(sred).arg(sgreen).arg(sblue);
+ }
+ else
+ {
+ s = QString("{gray}{%1}").arg(convertColor(r));
+ }
+ list << QString("\\definecolor{tc%1}%2").arg(it.data()).arg(s);
+ }
+
+ list.sort();
+ return list;
+}
+
+////////////////////////////// determine the whole tag //////////////////////////////
+
+void TabularDialog::slotOk()
+{
+ m_table->updateCurrentCell();
+
+ QString preamble,textline,s,s1,s2,s3;
+ TabularCell::CountLines lines;
+ TabularCell::Count cnt;
+
+ // list of packages
+ bool pkgArray = false;
+ bool pkgColor = false;
+ bool pkgColortbl = false;
+
+ // we need this very often
+ int numrows = m_table->numRows();
+ int numcols = m_table->numCols();
+
+ // colortable
+ QMap<QString,char> colortable;
+ char colorchar = 'A';
+
+ // list with all column information
+ QValueList<TabularCell::Preamble> colinfo;
+ QString whitename = Qt::white.name();
+ QString blackname = Qt::black.name();
+
+ // is multicolumn command used
+ bool multicolumn = false;
+
+ // cursor and bullets
+ QString bullet = ( m_cbBullets->isChecked() ) ? s_bullet : QString::null;
+ bool setcursor = ( ! m_cbBullets->isChecked() );
+
+ // count all column information
+ m_td.tagEnd = QString::null;
+ for ( int col=0; col<=numcols; ++col )
+ {
+ TabularCell::Preamble info;
+ info.vline = false;
+ info.align = Qt::AlignLeft;
+
+ // Now get column information for real columns.
+ // The last info is only needed for a right vline.
+ if ( col < numcols )
+ {
+ cnt = m_table->countCells(col,0,col,numrows-1);
+
+ // and set values
+ info.bold = ( cnt.bold > cnt.cells/2 );
+ info.italic = ( cnt.italic > cnt.cells/2 );
+ info.bgcolor = ( cnt.bgcolor > cnt.cells/2 ) ? cnt.nameBgcolor : whitename;
+ info.textcolor = ( cnt.textcolor > cnt.cells/2 ) ? cnt.nameTextcolor : blackname;
+ }
+
+ // save all information
+ colinfo.append( info );
+ }
+
+ // search for left vlines all columns
+ QHeader *hor = m_table->horizontalHeader();
+ for ( int col=0; col<numcols; ++col )
+ {
+ // get current header
+ s = hor->label(col).remove(' ');
+ if ( s.find('>') || s.find('<') || s.find('!') || s.find('m') || s.find('b'))
+ pkgArray = true;
+
+ // look for @{} and !{} substrings
+ bool separator = ( s.find('@')>=0 || s.find('!')>=0 );
+ if ( !separator )
+ {
+ lines = m_table->countVLines(col,true);
+ if ( lines.cnt > numrows/2 )
+ {
+ preamble += '|';
+ colinfo[col].vline = true;
+ }
+ }
+
+ // color
+ QString colorcommand = QString::null;
+ if ( colinfo[col].bgcolor != whitename )
+ {
+ QChar color = defineColor(colinfo[col].bgcolor,colortable,colorchar);
+ colorcommand += QString("\\columncolor{tc%1}").arg(color);
+ pkgColortbl = true;
+ }
+ if ( colinfo[col].textcolor != blackname )
+ {
+ QChar color = defineColor(colinfo[col].textcolor,colortable,colorchar);
+ colorcommand += QString("\\color{tc%1}").arg(color);
+ pkgColor = true;
+ }
+ if ( ! colorcommand.isEmpty() )
+ {
+ if ( s.find('>') >= 0 )
+ s = s.replace(">{}",QString(">{%1}").arg(colorcommand));
+ else
+ preamble += QString(">{%1}").arg(colorcommand);
+ pkgArray = true;
+ }
+
+ // Alignment: default is left, we look only for center or right
+ if ( s.find('c') >= 0 )
+ colinfo[col].align = Qt::AlignHCenter;
+ else if ( s.find('r') >= 0 )
+ colinfo[col].align = Qt::AlignRight;
+
+ // pre >{} and post <{} commands can stay, but perhaps bullets are wanted
+ preamble += ( m_cbBullets->isChecked() ) ? s.replace("{}", '{' + s_bullet + '}') : s;
+ }
+ // search for right vline in last column
+ lines = m_table->countVLines( numcols-1,false );
+ if ( lines.cnt > numrows/2 )
+ {
+ preamble += '|';
+ colinfo[numcols].vline = true;
+ }
+
+ //KILE_DEBUG() << "preamble " << preamble << endl;
+ //KILE_DEBUG() << " topline " << getEol(0,true) << endl;
+
+ // output all rows
+ for ( int row=0; row<numrows; ++row )
+ {
+ textline = QString::null;
+
+ // first check for a rowcolor command
+ cnt = m_table->countCells(0,row,numcols-1,row);
+ QString bgcolor = ( cnt.bgcolor > cnt.cells/2 ) ? cnt.nameBgcolor : whitename;
+ if ( bgcolor != whitename )
+ {
+ QChar color = defineColor(cnt.nameBgcolor,colortable,colorchar);
+ textline += QString("\\rowcolor{tc%1}\n").arg(color);
+ pkgColortbl = true;
+ }
+
+ int col = 0;
+ while ( col < numcols )
+ {
+ TabularItem *cellitem = dynamic_cast<TabularItem*>( m_table->item(row,col) );
+ if ( cellitem )
+ {
+ // check for multicolumn and initialize string parameter
+ int colspan = cellitem->colSpan();
+ s1 = ( colspan > 1 ) ? QString("%1").arg(colspan) : QString::null;
+ s2 = s3 = QString::null;
+
+ // Now look, if this cell(s) must be defined as multicolumn, because
+ // colspan is greater than 1, or the left vline, bgcolor or alignment
+ // is different from the preamble
+ bool useMulticolumn =
+ ( ( colspan > 1 ) ||
+ ( colinfo[col].vline != m_table->isVLine(row,col,true) ) ||
+ ( colinfo[col].bgcolor != cellitem->m_data.bgcolor.name() ) ||
+ ( cellitem->m_data.align != colinfo[col].align )
+ );
+
+ // build the multicolumn command (if necessary)
+ if ( useMulticolumn )
+ {
+ // left vline
+ //if ( (colinfo[col].vline!=m_table->isVLine(row,col,true)) && m_table->isVLine(row,col,true) ) {
+ if ( m_table->isVLine(row,col,true) )
+ {
+ s2 += '|';
+ }
+ // bgcolor
+ // if ( ! ( (colinfo[col].bgcolor==cellitem->m_data.bgcolor.name()) &&
+ // (colinfo[col].bgcolor==whitename) ) ) {
+ if ( cellitem->m_data.bgcolor.name() != whitename )
+ {
+ QChar color = defineColor(cellitem->m_data.bgcolor.name(),colortable,colorchar);
+ s2 += QString(">{\\columncolor{tc%1}}").arg(color);
+ pkgColortbl = true;
+ }
+ // alignment
+ //if ( cellitem->m_data.align!=colinfo[col].align ) {
+ switch ( cellitem->m_data.align )
+ {
+ case Qt::AlignHCenter : s2 += 'c'; break;
+ case Qt::AlignRight : s2 += 'r'; break;
+ default : s2 += 'l';
+ }
+ // we have to set a right line in a multicolumn cell
+ if ( m_table->isVLine(row,col,false) )
+ {
+ s2 += '|';
+ }
+ }
+
+ // now build cell entries
+ if ( colinfo[col].bold != (cellitem->m_data.font & TabularCell::cfBold) )
+ {
+ s3 += "\\bfseries";
+ }
+ if ( colinfo[col].italic != (cellitem->m_data.font & TabularCell::cfItalic) )
+ {
+ s3 += "\\itshape";
+ }
+
+ if ( colinfo[col].textcolor != cellitem->m_data.textcolor.name() )
+ {
+ QChar color = defineColor(cellitem->m_data.textcolor.name(),colortable,colorchar);
+ s3 += QString("\\color{tc%1}").arg(color);
+ pkgColor = true;
+ }
+ if ( ! s3.isEmpty() )
+ s3 += ' ';
+
+ // add text
+ if ( ! cellitem->text().isEmpty() )
+ s3 += cellitem->text();
+ else
+ {
+ if ( setcursor )
+ {
+ s3 += "%C";
+ setcursor = false;
+ }
+ else
+ s3 += bullet;
+ }
+
+ // build the whole cell entry
+ if ( useMulticolumn )
+ {
+ textline += QString("\\mc{%1}{%2}{%3}").arg(colspan).arg(s2).arg(s3);
+ multicolumn = true;
+ }
+ else
+ textline += s3;
+
+ // increase column number
+ col += colspan;
+ }
+ else
+ {
+ if ( setcursor )
+ {
+ textline += "%C";
+ setcursor = false;
+ }
+ else
+ textline += bullet;
+ col++;
+ }
+ if ( col < numcols )
+ textline += " & ";
+ }
+
+ // add eol
+ s = getEol(row,false);
+ if ( row<numrows-1 || !s.isEmpty() )
+ textline += " \\\\ " + s;
+
+ //KILE_DEBUG() << "text: " << textline << endl;
+ m_td.tagEnd += textline + '\n';
+ }
+
+ // build the list of colors
+ QStringList colorlist = sortColorTable(colortable);
+ bool group = ( multicolumn || colorlist.count()>0 );
+
+ // get current environment
+ QString envname = m_coEnvironment->currentText();
+
+ // build a list of packages
+ QString packagelist = QString::null;
+ if ( pkgColortbl )
+ pkgColor = true;
+
+ if ( pkgArray )
+ packagelist += ",array";
+ if ( pkgColor )
+ packagelist += ",color";
+ if ( pkgColortbl )
+ packagelist += ",colortbl";
+ if ( m_cbBooktabs->isChecked() )
+ packagelist += ",booktabs";
+ if ( envname=="tabularx" || envname=="longtable" || envname=="supertabular" )
+ packagelist += ',' + envname;
+ if ( ! packagelist.isEmpty() ) {
+ packagelist = packagelist.replace(0,1,"% use packages: ") + '\n';
+ }
+
+ // get environment names
+ QString centername = ( isMathmodeEnvironment(envname) ) ? "displaymath" : "center";
+ if ( m_cbStarred->isChecked() )
+ envname += '*';
+
+ // build the tag to insert
+ if ( m_cbCenter->isChecked() )
+ m_td.tagBegin = QString("\\begin{%1}\n").arg(centername);
+ else if ( group )
+ m_td.tagBegin = "{% \n";
+ else
+ m_td.tagBegin = QString::null;
+
+ // add list of packages as comment
+ m_td.tagBegin += packagelist;
+
+ // define some commands
+ if ( group )
+ {
+ //m_td.tagBegin += "%\n";
+ // add multicolumn shortcut
+ if ( multicolumn )
+ m_td.tagBegin += "\\newcommand{\\mc}[3]{\\multicolumn{#1}{#2}{#3}}\n";
+ // add definitions of used colors
+ for ( uint i=0; i<colorlist.count(); ++i )
+ m_td.tagBegin += colorlist[i] + '\n';
+ m_td.tagBegin += "%\n";
+ }
+
+ // add environment command
+ m_td.tagBegin += QString("\\begin{%1}").arg(envname);
+ // add width for starred versions
+ if ( m_cbStarred->isChecked() )
+ m_td.tagBegin += QString("{%1}").arg(bullet);
+ // add optional alignment parameter
+ QString envparameter = ( m_coParameter->isEnabled() ) ? m_coParameter->currentText() : QString::null;
+ if ( ! envparameter.isEmpty() )
+ m_td.tagBegin += QString("[%1]").arg(envparameter);
+ // add preamble
+ m_td.tagBegin += QString("{%1}").arg(preamble);
+ m_td.tagBegin += getEol(0,true) + '\n';
+
+ // close environment
+ m_td.tagEnd += QString("\\end{%1}\n").arg(envname);
+ if ( m_cbCenter->isChecked() )
+ m_td.tagEnd += QString("\\end{%1}\n").arg(centername);
+ else if ( group )
+ m_td.tagEnd += "}\n";
+
+ m_td.dy = 0;
+ m_td.dx = 0;
+
+ // set cursor to first bullet position
+ if ( m_cbBullets->isChecked() )
+ {
+ int pos = m_td.tagBegin.find(bullet);
+ if ( pos >= 0 )
+ {
+ m_td.tagBegin = m_td.tagBegin.replace(pos,1,"%C");
+ setcursor = false;
+ }
+ else
+ {
+ pos = m_td.tagEnd.find(bullet);
+ if ( pos >= 0 )
+ {
+ m_td.tagEnd = m_td.tagEnd.replace(pos,1,"%C");
+ setcursor = false;
+ }
+ else
+ {
+ setcursor = true;
+ }
+ }
+ }
+ if ( setcursor )
+ m_td.tagEnd += "%C";
+
+ accept();
+}
+
+QString TabularDialog::getEol(int row, bool top)
+{
+ QString s;
+
+ bool booktabs = m_cbBooktabs->isChecked();
+ TabularCell::CountLines lines = m_table->countHLines(row,top);
+ if ( lines.cnt == lines.cells )
+ {
+ if ( booktabs )
+ {
+ if ( row==0 && top )
+ s = "\\toprule";
+ else if ( row==m_table->numRows()-1 && !top )
+ s = "\\bottomrule";
+ else
+ s = "\\midrule";
+ }
+ else
+ s = "\\hline";
+ }
+ else if ( lines.list.count() > 0 )
+ {
+ QString cmd = ( booktabs ) ? "cmidrule" : "cline";
+ for ( uint i=0; i<lines.list.count(); i+=2 )
+ s += QString("\\%1{%2-%3}").arg(cmd).arg(lines.list[i]+1).arg(lines.list[i+1]+1);
+ }
+
+ return s;
+}
+
+}
+
+#include "tabulardialog.moc"
diff --git a/src/kile/tabulardialog.h b/src/kile/tabulardialog.h
new file mode 100644
index 0000000..9ce74f8
--- /dev/null
+++ b/src/kile/tabulardialog.h
@@ -0,0 +1,296 @@
+/***************************************************************************
+ tabulardialog.h
+----------------------------------------------------------------------------
+ date : Sep 17 2006
+ version : 0.26
+ copyright : (C) 2005-2006 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef TABULARDIALOG_H
+#define TABULARDIALOG_H
+
+#include "kilewizard.h"
+#include "latexcmd.h"
+
+#include <qevent.h>
+#include <qpainter.h>
+#include <qtable.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qcombobox.h>
+#include <qspinbox.h>
+#include <qregexp.h>
+#include <qvalidator.h>
+#include <qpopupmenu.h>
+
+#include <kdialogbase.h>
+#include <kcolorcombo.h>
+#include <kpushbutton.h>
+
+namespace KileDialog
+{
+
+namespace TabularCell
+{
+ enum { cbNone=0, cbLeft=1, cbTop=2, cbRight=4, cbBottom=8 };
+ enum { cfNormal=0, cfBold=1, cfItalic=2 };
+
+ struct Data
+ {
+ int align;
+ int font;
+ int border;
+ QColor bgcolor;
+ QColor textcolor;
+ };
+
+ struct Count
+ {
+ int bold;
+ int italic;
+ int bgcolor;
+ int textcolor;
+ int cells;
+ QString nameBgcolor;
+ QString nameTextcolor;
+ };
+
+ struct Preamble
+ {
+ bool vline;
+ bool bold;
+ bool italic;
+ int align;
+ QString bgcolor;
+ QString textcolor;
+ };
+
+ struct CountLines
+ {
+ int cnt;
+ int cells;
+ QValueList<int> list;
+ };
+
+}
+
+class TabCellFrame : public QFrame
+{
+ Q_OBJECT
+public:
+
+ TabCellFrame(QWidget* parent);
+ void setBorder(int value);
+ int border() { return m_border; }
+
+protected:
+ void drawContents(QPainter *p);
+ void mousePressEvent(QMouseEvent *event);
+ void mouseDoubleClickEvent(QMouseEvent *event);
+
+private:
+ int m_border;
+ QRect m_left,m_top,m_right,m_bottom;
+};
+
+
+class TabCellDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ TabCellDialog(QWidget *parent, TabularCell::Data *data,
+ const QString &headerlabel, const QStringList &alignlist);
+ ~TabCellDialog() {}
+
+ TabularCell::Data data();
+ QString header();
+
+private slots:
+ void slotFramebuttonClicked();
+ void slotSeparatorClicked();
+ void slotResetClicked();
+
+private:
+ QComboBox *m_coHeader;
+ QCheckBox *m_cbBold, *m_cbItalic;
+ QRadioButton *m_rbAlignleft, *m_rbAligncenter, *m_rbAlignright;
+ KColorCombo *m_ccBgcolor, *m_ccTextcolor;
+ KPushButton *m_pbFrame1,*m_pbFrame2,*m_pbFrame3,*m_pbFrame4;
+ QCheckBox *m_cbPre, *m_cbPost, *m_cbAt, *m_cbSep;
+ TabCellFrame *m_cellframe;
+
+ TabularCell::Data m_data;
+ bool m_header;
+ QString m_headerlabel;
+ QStringList m_preamblelist;
+
+ void initWidgets();
+ void initWidgetData();
+};
+
+//////////////////////////////////////////////////////////////////////
+
+class TabularItem :public QTableItem
+{
+public:
+ TabularItem(QTable* table);
+ TabularItem(QTable* table, const TabularCell::Data &data);
+
+ int alignment() const;
+ bool isDefault();
+ bool isMulticolumn();
+
+ void paint(QPainter *p,const QColorGroup &cg,const QRect &cr,bool selected);
+ TabularCell::Data m_data;
+};
+
+class TabularDialog;
+class TabularTable : public QTable
+{
+ Q_OBJECT
+
+public:
+ TabularTable(int numRows,int numCols,QWidget* parent, TabularDialog *tabdialog);
+
+ void setText(int row,int col,const QString &text);
+ void setAlignment(int row,int col,int align);
+ TabularCell::Data defaultAttributes();
+
+ bool isMulticolumn(int row,int col);
+
+ void paintCell( QPainter *p, int row, int col,
+ const QRect &cr, bool selected, const QColorGroup &cg );
+ void updateCurrentCell();
+
+ bool isRowEmpty(int row);
+ bool isRowEmpty(int row,int col1, int col2);
+ bool isColEmpty(int col);
+ void clearHorizontalHeader(int col1,int col2);
+ void clearVerticalHeader(int row1,int row2);
+
+ bool isVLine(int row,int col, bool left);
+ TabularCell::Count countCells(int x1,int y1,int x2,int y2);
+ TabularCell::CountLines countHLines(int row, bool top);
+ TabularCell::CountLines countVLines(int col, bool left);
+
+protected:
+ void endEdit(int row,int col,bool accept,bool replace);
+ void activateNextCell();
+
+private:
+ enum { DataAlign, DataFont, DataBorder, DataBgcolor, DataTextcolor };
+ enum { PopupNone, PopupEdit, PopupSet, PopupBreak,
+ PopupLeft, PopupCenter, PopupRight,
+ PopupText, PopupAttributes, PopupAll };
+
+ TabularItem *cellItem(int row,int col);
+ bool isDefaultAttr(const TabularCell::Data &data);
+ bool updateCell(int row,int col);
+ void setAttributes(int row,int col,const TabularCell::Data &data);
+ void clearAttributes(int row,int col);
+ void cellParameterDialog(int x1,int y1,int x2,int y2, TabularCell::Data *data,
+ const QString &headerlabel);
+ bool equalParameter(int x1,int y1,int x2,int y2, int code);
+
+ void mouseContextHorizontalHeader(int pos);
+ void mouseContextVerticalHeader(int pos);
+ void updateHeaderAlignment(int col1,int col2,QChar alignchar);
+
+ bool getCurrentSelection(int &x1,int &y1,int &x2,int &y2);
+ void clearSelectionCells(bool cleartext,bool clearattributes);
+ void clearHeaderCells(bool cleartext,bool clearattributes);
+ void clearCellrange(int x1,int y1,int x2,int y2,bool cleartext,bool clearattributes);
+ void setCellrangeAlignment(int x1,int y1,int x2,int y2,int align);
+ void setCellrangeAttributes(int x1,int y1,int x2,int y2,const TabularCell::Data &data);
+
+ void setColspan(int row,int col1,int col2,int numcols,const QString &text);
+ void getCellRange(int row,int col1, int col2, int &xl, int &xr);
+ QString getCellRangeText(int row,int col1, int col2);
+
+ QPopupMenu *createPopupMenu();
+ void insertPopupAlign(QPopupMenu *popup,bool header);
+ void insertPopupClear(QPopupMenu *popup);
+ int popupId(QPopupMenu *popup, int id);
+
+ void cellPopupEdit();
+ void cellPopupSetMulticolumn();
+ void cellPopupBreakMulticolumn();
+ void cellPopupAlign(int align);
+
+ void setupContextHeaderPopup(bool horizontal, int section);
+ void headerPopupEdit();
+ void headerPopupAlign(QChar alignchar);
+
+ bool m_horizontal;
+ int m_section;
+ int m_x1,m_y1,m_x2,m_y2;
+
+ QPopupMenu *m_headerpopup;
+ QPopupMenu *m_cellpopup;
+ TabularDialog *m_tabdialog;
+
+private slots:
+ void slotContextMenuClicked(int row,int col,const QPoint &);
+ void slotCellPopupActivated(int id);
+ void slotHeaderPopupActivated(int id);
+
+protected:
+ bool eventFilter(QObject *o, QEvent *e);
+
+};
+
+
+class TabularDialog : public Wizard
+{
+ Q_OBJECT
+
+public:
+ TabularDialog(QWidget *parent, KConfig *config, KileDocument::LatexCommands *commands, bool tabularenv= true);
+ ~TabularDialog() {}
+ QStringList columnAlignments();
+
+public slots:
+ void slotOk();
+ void slotRowValueChanged(int value);
+
+private slots:
+ void slotColValueChanged(int value);
+ void slotEnvironmentChanged(const QString &env);
+
+private:
+ KileDocument::LatexCommands *m_latexCommands;
+
+ TabularTable *m_table;
+ QComboBox *m_coEnvironment, *m_coParameter;
+ QSpinBox *m_spRows, *m_spCols;
+ QCheckBox *m_cbWarning, *m_cbBullets, *m_cbStarred;
+ QCheckBox *m_cbCenter, *m_cbBooktabs;
+
+ int m_rows;
+ int m_cols;
+
+ void initEnvironments(bool tabularenv);
+ bool isMathmodeEnvironment(const QString &env);
+
+ QStringList m_alignlist;
+
+ QStringList sortColorTable(QMap<QString,char> &colors);
+ QString convertColor(int value);
+ char defineColor(const QString &name, QMap<QString,char> &colors, char &colorcode);
+ QString getEol(int row,bool top);
+};
+
+}
+
+#endif
diff --git a/src/kile/templates.cpp b/src/kile/templates.cpp
new file mode 100644
index 0000000..3a76962
--- /dev/null
+++ b/src/kile/templates.cpp
@@ -0,0 +1,385 @@
+/*******************************************************************************************
+ begin : Sat Apr 26 2003
+ copyright : (C) 2003 by Jeroen Wijnhout (wijnhout@science.uva.nl)
+ 2005 by Holger Danielsson (holger.danielsson@t-online.de)
+ 2007 by Michel Ludwig (michel.ludwig@kdemail.net)
+ *******************************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "templates.h"
+
+#include <kapp.h>
+#include "kiledebug.h"
+#include <kglobal.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kio/job.h>
+#include <kio/netaccess.h>
+#include <kmessagebox.h>
+
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qstringlist.h>
+#include <qregexp.h>
+
+#include "kileinfo.h"
+
+// 2005-08-04: dani
+// - added script support to search existing class files
+// (classes: Koma, Beamer, Prosper, HA-prosper)
+// - sort items ('Empty Document' will always be the first entry)
+
+// 2006-30-04: tbraun
+// - drag and drop makes no sense here
+// - use the Select mode
+
+namespace KileTemplate {
+
+////////////////////// Info //////////////////////
+
+Info::Info() : type(KileDocument::Undefined)
+{
+}
+
+bool Info::operator==(const Info ti) const
+{
+ return name==ti.name;
+}
+
+////////////////////// Manager //////////////////////
+
+Manager::Manager(KileInfo* kileInfo, QObject* parent, const char* name) : QObject(parent, name), m_kileInfo(kileInfo)
+{
+}
+
+Manager::~Manager() {
+}
+
+bool Manager::copyAppData(const KURL& src, const QString& subdir, const QString& fileName) {
+ QString dir;
+ //let saveLocation find and create the appropriate place to
+ //store the templates (usually $HOME/.kde/share/apps/kile/templates)
+ dir = KGlobal::dirs()->saveLocation("appdata", subdir, true);
+ KURL targetURL = KURL::fromPathOrURL(dir);
+ targetURL.addPath(fileName);
+
+ //if a directory is found
+ if (!dir.isNull()) {
+ return KIO::NetAccess::copy(src, targetURL, kapp->mainWidget());
+ }
+ else {
+ KMessageBox::error(0, i18n("Could not find a folder to save %1 to.\nCheck whether you have a .kde folder with write permissions in your home folder.").arg(fileName));
+ return false;
+ }
+}
+
+bool Manager::removeAppData(const QString &file) {
+ QFileInfo fileInfo(file);
+ if(fileInfo.exists()) {
+ return KIO::NetAccess::del(KURL::fromPathOrURL(file), kapp->mainWidget());
+ }
+ return true;
+}
+
+bool Manager::searchForTemplate(const QString& name, KileDocument::Type& type) const {
+ for (KileTemplate::TemplateListConstIterator i = m_TemplateList.constBegin(); i != m_TemplateList.constEnd(); ++i)
+ {
+ KileTemplate::Info info = *i;
+ if(info.name == name && info.type == type) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool Manager::add(const KURL& templateSourceURL, const QString& name, const KURL& icon) {
+ KileDocument::Extensions *extensions = m_kileInfo->extensions();
+ KileDocument::Type type = extensions->determineDocumentType(templateSourceURL);
+ return add(templateSourceURL, type, name, icon);
+}
+
+bool Manager::add(const KURL& templateSourceURL, KileDocument::Type type, const QString& name, const KURL& icon) {
+ KileDocument::Extensions *extensions = m_kileInfo->extensions();
+ QString extension = extensions->defaultExtensionForDocumentType(type);
+
+ return copyAppData(templateSourceURL, "templates", "template_" + name + extension) && copyAppData(icon, "pics", "type_" + name + extension + ".kileicon");
+}
+
+bool Manager::remove(Info ti) {
+ return removeAppData(ti.path) && removeAppData(ti.icon);
+}
+
+bool Manager::replace(const KileTemplate::Info& toBeReplaced, const KURL& newTemplateSourceURL, const QString& newName, const KURL& newIcon) {
+ KileDocument::Type type = m_kileInfo->extensions()->determineDocumentType(newTemplateSourceURL);
+
+ //start by copying the files that belong to the new template to a safe place
+ QString templateTempFile, iconTempFile;
+
+ if(!KIO::NetAccess::download(newTemplateSourceURL, templateTempFile, kapp->mainWidget())) {
+ return false;
+ }
+ if(!KIO::NetAccess::download(newIcon, iconTempFile, kapp->mainWidget())) {
+ KIO::NetAccess::removeTempFile(templateTempFile);
+ return false;
+ }
+
+ //now delete the template that should be replaced
+ if(!remove(toBeReplaced)) {
+ KIO::NetAccess::removeTempFile(templateTempFile);
+ KIO::NetAccess::removeTempFile(iconTempFile);
+ }
+
+ //finally, create the new template
+ if(!add(KURL::fromPathOrURL(templateTempFile), type, newName, KURL::fromPathOrURL(iconTempFile))) {
+ KIO::NetAccess::removeTempFile(templateTempFile);
+ KIO::NetAccess::removeTempFile(iconTempFile);
+ return false;
+ }
+
+ KIO::NetAccess::removeTempFile(templateTempFile);
+ KIO::NetAccess::removeTempFile(iconTempFile);
+
+ return true;
+}
+
+void Manager::scanForTemplates() {
+ KILE_DEBUG() << "===scanForTemplates()===================" << endl;
+ QStringList dirs = KGlobal::dirs()->findDirs("appdata", "templates");
+ QDir templates;
+ KileTemplate::Info ti;
+ KileDocument::Extensions *extensions = m_kileInfo->extensions();
+
+ m_TemplateList.clear();
+ for ( QValueListIterator<QString> i = dirs.begin(); i != dirs.end(); ++i)
+ {
+ templates = QDir(*i, "template_*");
+ for ( uint j = 0; j< templates.count(); ++j)
+ {
+ ti.path = templates.path() + '/' + templates[j];
+ QFileInfo fileInfo(ti.path);
+ ti.name = fileInfo.baseName(true).mid(9); //remove "template_", do it this way to avoid problems with user input!
+ ti.type = extensions->determineDocumentType(KURL::fromPathOrURL(ti.path));
+ ti.icon = KGlobal::dirs()->findResource("appdata","pics/type_" + ti.name + extensions->defaultExtensionForDocumentType(ti.type) + ".kileicon");
+ if (m_TemplateList.contains(ti))
+ {
+ KILE_DEBUG() << "\tignoring: " << ti.path << endl;
+ }
+ else
+ {
+ m_TemplateList.append(ti);
+ KILE_DEBUG() << "\tadding: " << ti.name << " " << ti.path << endl;
+ }
+ }
+ }
+}
+
+TemplateList Manager::getAllTemplates() const {
+ return m_TemplateList;
+}
+
+TemplateList Manager::getTemplates(KileDocument::Type type) const {
+ if(type == KileDocument::Undefined)
+ {
+ return getAllTemplates();
+ }
+
+ TemplateList toReturn;
+ for (KileTemplate::TemplateListConstIterator i = m_TemplateList.constBegin(); i != m_TemplateList.constEnd(); ++i)
+ {
+ KileTemplate::Info info = *i;
+ if(info.type == type) {
+ toReturn.push_back(info);
+ }
+ }
+ return toReturn;
+}
+
+}
+////////////////////// TemplateItem //////////////////////
+
+// new compare function to make the "Empty (...) Document" items appear at the beginning
+
+TemplateItem::TemplateItem(QIconView * parent, const KileTemplate::Info& info) : QIconViewItem(parent,info.name, QPixmap(info.icon))
+{
+ setDragEnabled(false);
+ m_info = info;
+}
+
+int TemplateItem::compare( QIconViewItem *i ) const
+{
+ if ( key() == DEFAULT_EMPTY_CAPTION ) {
+ return -1;
+ }
+ else if ( i->key() == DEFAULT_EMPTY_CAPTION ) {
+ return 1;
+ }
+ else {
+ return key().compare( i->key() );
+ }
+}
+
+////////////////////// TemplateIconView //////////////////////
+
+TemplateIconView::TemplateIconView(QWidget *parent, const char *name, WFlags f) : KIconView(parent, name, f), m_templateManager(NULL), m_proc(NULL) {
+ setItemsMovable(false);
+ setMode(KIconView::Select);
+ setResizeMode(QIconView::Adjust);
+ setSelectionMode(QIconView::Single);
+ setResizePolicy(QScrollView::Default);
+ setArrangement(QIconView::TopToBottom);
+ setMinimumHeight(100);
+}
+
+TemplateIconView::~TemplateIconView() {
+}
+
+void TemplateIconView::setTemplateManager(KileTemplate::Manager *templateManager) {
+ m_templateManager = templateManager;
+}
+
+void TemplateIconView::fillWithTemplates(KileDocument::Type type) {
+ if(!m_templateManager) {
+ return;
+ }
+
+ clear();
+
+ if(type == KileDocument::LaTeX) {
+ searchLaTeXClassFiles();
+ }
+ else {
+ addTemplateIcons(type);
+ }
+}
+
+void TemplateIconView::searchLaTeXClassFiles()
+{
+ if(!m_templateManager) return;
+
+ QString command = "kpsewhich -format=tex scrartcl.cls beamer.cls prosper.cls HA-prosper.sty";
+
+ delete m_proc;
+
+ m_proc = new KProcess(this);
+ m_proc->clearArguments();
+ m_proc->setUseShell(true);
+ (*m_proc) << QStringList::split(' ', command);
+ m_output = QString::null;
+
+ connect(m_proc, SIGNAL(receivedStdout(KProcess*,char*,int)),
+ this, SLOT(slotProcessOutput(KProcess*,char*,int)) );
+ connect(m_proc, SIGNAL(receivedStderr(KProcess*,char*,int)),
+ this, SLOT(slotProcessOutput(KProcess*,char*,int)) );
+ connect(m_proc, SIGNAL(processExited(KProcess*)),
+ this, SLOT(slotProcessExited(KProcess*)) );
+
+ KILE_DEBUG() << "=== NewFileWidget::searchClassFiles() ====================" << endl;
+ KILE_DEBUG() << "\texecute: " << command << endl;
+ if ( ! m_proc->start(KProcess::NotifyOnExit, KProcess::AllOutput) )
+ {
+ KILE_DEBUG() << "\tstart of shell process failed" << endl;
+ addTemplateIcons(KileDocument::LaTeX);
+ }
+}
+
+void TemplateIconView::slotProcessOutput(KProcess*, char* buf, int len)
+{
+ m_output += QString::fromLocal8Bit(buf,len);
+}
+
+void TemplateIconView::slotProcessExited(KProcess *proc)
+{
+ if ( ! proc->normalExit() )
+ m_output = QString::null;
+
+ addTemplateIcons(KileDocument::LaTeX);
+ emit classFileSearchFinished();
+}
+
+void TemplateIconView::addTemplateIcons(KileDocument::Type type)
+{
+ if(!m_templateManager) return;
+
+ QString emptyIcon = KGlobal::dirs()->findResource("appdata", "pics/"+ QString(DEFAULT_EMPTY_ICON) + ".png" );
+
+ KileTemplate::Info emptyDocumentInfo;
+ emptyDocumentInfo.name = DEFAULT_EMPTY_CAPTION;
+ emptyDocumentInfo.icon = emptyIcon;
+ emptyDocumentInfo.type = type;
+ TemplateItem *emp = new TemplateItem(this, emptyDocumentInfo);
+ setSelected(emp, true);
+
+ if(type == KileDocument::LaTeX) {
+ // disable non standard templates
+ QMap<QString,bool> map;
+ map["Scrartcl"] = false;
+ map["Scrbook"] = false;
+ map["Scrreprt"] = false;
+ map["Scrlttr2"] = false;
+ map["Beamer"] = false;
+ map["Prosper"] = false;
+ map["HA-prosper"] = false;
+
+ // split search results and look, which class files are present
+ QStringList list = QStringList::split("\n",m_output);
+ for ( QStringList::Iterator it=list.begin(); it!=list.end(); ++it )
+ {
+ QString filename = QFileInfo(*it).fileName();
+ if ( filename=="scrartcl.cls" )
+ {
+ map["Scrartcl"] = true;
+ map["Scrbook"] = true;
+ map["Scrreprt"] = true;
+ map["Scrlttr2"] = true;
+ }
+ else if ( filename=="beamer.cls" )
+ map["Beamer"] = true;
+ else if ( filename=="prosper.cls" )
+ map["Prosper"] = true;
+ else if ( filename=="HA-prosper.sty" )
+ map["HA-prosper"] = true;
+ }
+
+
+ KileTemplate::TemplateList templateList = m_templateManager->getTemplates(KileDocument::LaTeX);
+ // insert all standard templates, all user defined templates
+ // and those templates, which have a present class
+ for (KileTemplate::TemplateListIterator i=templateList.begin(); i != templateList.end(); ++i)
+ {
+ KileTemplate::Info info = *i;
+ QString classname = info.name;
+ if ( !map.contains(classname) || map[classname]==true )
+ {
+ new TemplateItem(this, info);
+ }
+ }
+ }
+ else {
+ KileTemplate::TemplateList templateList = m_templateManager->getTemplates(type);
+ for (KileTemplate::TemplateListIterator i=templateList.begin(); i != templateList.end(); ++i)
+ {
+ new TemplateItem(this, *i);
+ }
+ }
+
+ // sort all items (item for 'Empty Document' will always be the first one)
+ sort();
+
+ // set the default item, if its given
+ for ( QIconViewItem *item = firstItem(); item; item = item->nextItem() ) {
+ if ( static_cast<TemplateItem*>(item)->name() == m_selicon ) {
+ setSelected(item, true);
+ ensureItemVisible(item);
+ }
+ }
+}
+
+#include "templates.moc"
diff --git a/src/kile/templates.h b/src/kile/templates.h
new file mode 100644
index 0000000..806f416
--- /dev/null
+++ b/src/kile/templates.h
@@ -0,0 +1,164 @@
+/***************************************************************************************
+ begin : Sat Apr 26 2003
+ copyright : (C) 2003 by Jeroen Wijnhout (wijnhout@science.uva.nl)
+ 2007 by Michel Ludwig (michel.ludwig@kdemail.net)
+ ***************************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef TEMPLATES_H
+#define TEMPLATES_H
+
+
+/**
+ *@author Jeroen Wijnhout
+ */
+
+#include <kstandarddirs.h>
+#include <kiconview.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <kurl.h>
+
+#include <qobject.h>
+#include <qvaluelist.h>
+
+#include "kileconstants.h"
+
+#define DEFAULT_EMPTY_ICON "type_Empty"
+
+class KileInfo;
+
+namespace KileTemplate {
+
+struct Info {
+ public:
+ Info();
+
+ QString name;
+ QString path;
+ QString icon;
+ KileDocument::Type type;
+
+ bool operator==(const Info ti) const;
+};
+
+typedef QValueList<Info> TemplateList;
+typedef QValueListIterator<Info> TemplateListIterator;
+typedef QValueListConstIterator<Info> TemplateListConstIterator;
+
+class Manager : public QObject {
+ Q_OBJECT
+
+ public:
+ Manager(KileInfo *info, QObject* parent = NULL, const char* name = NULL);
+ virtual ~Manager();
+
+ void scanForTemplates();
+
+ /**
+ * Get all the templates.
+ **/
+ TemplateList getAllTemplates() const;
+
+ /**
+ * Get all the templates of a certain type.
+ *
+ * @param type The type of the templates that should be returned. You can pass "KileDocument::Undefined" to
+ * retrieve every template.
+ **/
+ TemplateList getTemplates(KileDocument::Type type) const;
+
+ /**
+ * Checks whether a template with a given name and type exists.
+ *
+ * @return true iff a template with the given name and type could be found
+ **/
+ bool searchForTemplate(const QString& name, KileDocument::Type& type) const;
+
+ //add a template in $HOME/kile/templates/
+ bool add(const KURL& templateSourceURL, const QString& name, const KURL& icon);
+
+ //remove a template from $HOME/kile/templates/
+ bool remove(KileTemplate::Info ti);
+
+ //replaces a template
+ bool replace(const KileTemplate::Info& toBeReplaced, const KURL& newTemplateSourceURL, const QString& newName, const KURL& newIcon);
+
+ protected:
+ KileInfo* m_kileInfo;
+
+ private:
+ bool copyAppData(const KURL& src, const QString& subdir, const QString& fileName);
+ bool removeAppData(const QString &file);
+
+ /**
+ * Adds a new template. This method differs from the other add method in that it does not try to determine
+ * the type of the template from the passed source URL.
+ **/
+ bool add(const KURL& templateSourceURL, KileDocument::Type type, const QString& name, const KURL& icon);
+
+
+ private:
+ TemplateList m_TemplateList;
+};
+
+}
+
+const QString DEFAULT_EMPTY_CAPTION = i18n("Empty Document");
+const QString DEFAULT_EMPTY_LATEX_CAPTION = i18n("Empty LaTeX Document");
+const QString DEFAULT_EMPTY_BIBTEX_CAPTION = i18n("Empty BibTeX Document");
+
+class TemplateItem : public QIconViewItem
+{
+public:
+ TemplateItem( QIconView * parent, const KileTemplate::Info & info);
+ ~TemplateItem() {}
+
+ int compare( QIconViewItem *i ) const;
+
+ QString name() { return m_info.name; }
+ QString path() { return m_info.path; }
+ QString icon() { return m_info.icon; }
+ KileDocument::Type type() { return m_info.type; }
+
+private:
+ KileTemplate::Info m_info;
+};
+
+class TemplateIconView : public KIconView {
+ Q_OBJECT
+
+ public:
+ TemplateIconView(QWidget *parent=0, const char *name=0, WFlags f=0);
+ virtual ~TemplateIconView();
+
+ void setTemplateManager(KileTemplate::Manager *templateManager);
+
+ void fillWithTemplates(KileDocument::Type type);
+
+ signals:
+ void classFileSearchFinished();
+
+ protected:
+ KileTemplate::Manager *m_templateManager;
+ QString m_output;
+ QString m_selicon;
+ KProcess *m_proc;
+
+ void addTemplateIcons(KileDocument::Type type);
+ void searchLaTeXClassFiles();
+
+ protected slots:
+ void slotProcessOutput(KProcess*,char* buf,int len);
+ void slotProcessExited (KProcess *proc);
+};
+
+#endif
diff --git a/src/kile/templates/CMakeLists.txt b/src/kile/templates/CMakeLists.txt
new file mode 100644
index 0000000..dbb6e11
--- /dev/null
+++ b/src/kile/templates/CMakeLists.txt
@@ -0,0 +1,4 @@
+
+########### install files ###############
+
+INSTALL( FILES template_Article.tex template_Book.tex template_Letter.tex template_Report.tex template_Beamer.tex template_Scrartcl.tex template_Scrreprt.tex template_HA-prosper.tex template_Scrbook.tex template_Prosper.tex template_Scrlttr2.tex DESTINATION share/apps/kile/templates )
diff --git a/src/kile/templates/Makefile.am b/src/kile/templates/Makefile.am
new file mode 100644
index 0000000..aeb1053
--- /dev/null
+++ b/src/kile/templates/Makefile.am
@@ -0,0 +1,3 @@
+templatedir = $(kde_datadir)/kile/templates
+template_DATA = template_Article.tex template_Book.tex template_Letter.tex template_Report.tex template_Beamer.tex template_Scrartcl.tex template_Scrreprt.tex template_HA-prosper.tex template_Scrbook.tex template_Prosper.tex template_Scrlttr2.tex
+
diff --git a/src/kile/templates/template_Article.tex b/src/kile/templates/template_Article.tex
new file mode 100644
index 0000000..28fcba0
--- /dev/null
+++ b/src/kile/templates/template_Article.tex
@@ -0,0 +1,18 @@
+\documentclass[$$DOCUMENTCLASSOPTIONS$$]{article}
+$$INPUTENCODING$$
+
+%opening
+\title{}
+\author{$$AUTHOR$$}
+
+\begin{document}
+
+\maketitle
+
+\begin{abstract}
+
+\end{abstract}
+
+\section{}
+
+\end{document}
diff --git a/src/kile/templates/template_Beamer.tex b/src/kile/templates/template_Beamer.tex
new file mode 100644
index 0000000..b8a5d85
--- /dev/null
+++ b/src/kile/templates/template_Beamer.tex
@@ -0,0 +1,8 @@
+\documentclass{beamer}
+
+$$INPUTENCODING$$
+\usepackage{default}
+
+\begin{document}
+
+\end{document}
diff --git a/src/kile/templates/template_Book.tex b/src/kile/templates/template_Book.tex
new file mode 100644
index 0000000..a4dd376
--- /dev/null
+++ b/src/kile/templates/template_Book.tex
@@ -0,0 +1,6 @@
+\documentclass[$$DOCUMENTCLASSOPTIONS$$]{book}
+$$INPUTENCODING$$
+
+\begin{document}
+
+\end{document}
diff --git a/src/kile/templates/template_HA-prosper.tex b/src/kile/templates/template_HA-prosper.tex
new file mode 100644
index 0000000..78de2c9
--- /dev/null
+++ b/src/kile/templates/template_HA-prosper.tex
@@ -0,0 +1,8 @@
+\documentclass[pdf]{prosper}
+
+$$INPUTENCODING$$
+\usepackage[HA]{HA-prosper}
+
+\begin{document}
+
+\end{document}
diff --git a/src/kile/templates/template_Letter.tex b/src/kile/templates/template_Letter.tex
new file mode 100644
index 0000000..d9eeab2
--- /dev/null
+++ b/src/kile/templates/template_Letter.tex
@@ -0,0 +1,25 @@
+\documentclass[$$DOCUMENTCLASSOPTIONS$$]{letter}
+$$INPUTENCODING$$
+
+\begin{document}
+% If you want headings on subsequent pages,
+% remove the ``%'' on the next line:
+% \pagestyle{headings}
+
+\begin{letter}{TO_ADDRESS}
+\address{$$ADDRESS$$}
+
+\opening{$$SALUTATION$$}
+
+
+
+
+\signature{$$AUTHOR$$\\$$TITLE$$}
+
+\closing{$$CLOSING$$}
+
+%enclosure listing
+%\encl{}
+
+\end{letter}
+\end{document}
diff --git a/src/kile/templates/template_Prosper.tex b/src/kile/templates/template_Prosper.tex
new file mode 100644
index 0000000..3f0291e
--- /dev/null
+++ b/src/kile/templates/template_Prosper.tex
@@ -0,0 +1,7 @@
+\documentclass[pdf]{prosper}
+
+$$INPUTENCODING$$
+
+\begin{document}
+
+\end{document} \ No newline at end of file
diff --git a/src/kile/templates/template_Report.tex b/src/kile/templates/template_Report.tex
new file mode 100644
index 0000000..8322958
--- /dev/null
+++ b/src/kile/templates/template_Report.tex
@@ -0,0 +1,15 @@
+\documentclass[$$DOCUMENTCLASSOPTIONS$$]{report}
+$$INPUTENCODING$$
+
+% Title Page
+\title{}
+\author{$$AUTHOR$$}
+
+
+\begin{document}
+\maketitle
+
+\begin{abstract}
+\end{abstract}
+
+\end{document}
diff --git a/src/kile/templates/template_Scrartcl.tex b/src/kile/templates/template_Scrartcl.tex
new file mode 100644
index 0000000..7e5d426
--- /dev/null
+++ b/src/kile/templates/template_Scrartcl.tex
@@ -0,0 +1,18 @@
+\documentclass[$$DOCUMENTCLASSOPTIONS$$]{scrartcl}
+$$INPUTENCODING$$
+
+%opening
+\title{}
+\author{$$AUTHOR$$}
+
+\begin{document}
+
+\maketitle
+
+\begin{abstract}
+
+\end{abstract}
+
+\section{}
+
+\end{document}
diff --git a/src/kile/templates/template_Scrbook.tex b/src/kile/templates/template_Scrbook.tex
new file mode 100644
index 0000000..b4f124c
--- /dev/null
+++ b/src/kile/templates/template_Scrbook.tex
@@ -0,0 +1,6 @@
+\documentclass[$$DOCUMENTCLASSOPTIONS$$]{scrbook}
+$$INPUTENCODING$$
+
+\begin{document}
+
+\end{document}
diff --git a/src/kile/templates/template_Scrlttr2.tex b/src/kile/templates/template_Scrlttr2.tex
new file mode 100644
index 0000000..d2b3df5
--- /dev/null
+++ b/src/kile/templates/template_Scrlttr2.tex
@@ -0,0 +1,25 @@
+\documentclass[$$DOCUMENTCLASSOPTIONS$$]{scrlttr2}
+$$INPUTENCODING$$
+
+\begin{document}
+% If you want headings on subsequent pages,
+% remove the ``%'' on the next line:
+% \pagestyle{headings}
+
+\begin{letter}{TO_ADDRESS}
+\address{$$ADDRESS$$}
+
+\opening{$$SALUTATION$$}
+
+
+
+
+\signature{$$AUTHOR$$\\$$TITLE$$}
+
+\closing{$$CLOSING$$}
+
+%enclosure listing
+%\encl{}
+
+\end{letter}
+\end{document}
diff --git a/src/kile/templates/template_Scrreprt.tex b/src/kile/templates/template_Scrreprt.tex
new file mode 100644
index 0000000..11ab947
--- /dev/null
+++ b/src/kile/templates/template_Scrreprt.tex
@@ -0,0 +1,15 @@
+\documentclass[$$DOCUMENTCLASSOPTIONS$$]{scrreprt}
+$$INPUTENCODING$$
+
+% Title Page
+\title{}
+\author{$$AUTHOR$$}
+
+
+\begin{document}
+\maketitle
+
+\begin{abstract}
+\end{abstract}
+
+\end{document}
diff --git a/src/kile/test/CMakeLists.txt b/src/kile/test/CMakeLists.txt
new file mode 100644
index 0000000..c5a28e1
--- /dev/null
+++ b/src/kile/test/CMakeLists.txt
@@ -0,0 +1,13 @@
+
+########### install files ###############
+
+SET( testFiles
+ runTests.sh
+ test.tex
+ test_plain.tex
+ test.bib
+ test_bib.tex
+ test_index.tex
+)
+
+INSTALL( FILES ${testFiles} DESTINATION share/apps/kile/test )
diff --git a/src/kile/test/Makefile.am b/src/kile/test/Makefile.am
new file mode 100644
index 0000000..0448d4f
--- /dev/null
+++ b/src/kile/test/Makefile.am
@@ -0,0 +1,3 @@
+testdir = $(kde_datadir)/kile/test
+test_DATA = runTests.sh test.tex test_plain.tex test.bib test_bib.tex test_index.tex
+
diff --git a/src/kile/test/runTests.sh b/src/kile/test/runTests.sh
new file mode 100755
index 0000000..68228d0
--- /dev/null
+++ b/src/kile/test/runTests.sh
@@ -0,0 +1,209 @@
+#!/bin/sh
+echo "Kile System Check script..."
+
+outfile=$1
+basedir=$2
+
+echo "outfile = $1, basedir = $2"
+
+goAhead=ok
+
+kileDCOP="dcop kile Kile"
+openDoc="$kileDCOP openDocument"
+closeDoc="$kileDCOP closeDocument"
+
+declare -i totalnotests=17
+declare -i current=0
+
+echo "#script:$0" > $outfile
+echo "#basedir:$basedir" >> $outfile
+
+function setTool
+{
+ goAhead=ok
+ echo "" >> $outfile
+ echo "[$*]" >> $outfile
+}
+
+function setKey
+{
+ key=$1
+ shift
+ echo "$key=$*" >> $outfile
+}
+
+function performTest
+{
+ if [ $goAhead != ok ]; then return; fi
+
+ test=$1
+ shift
+ $* >/dev/null 2>&1
+ declare -i result=$?
+ if [ $result -eq 0 ]; then goAhead=ok; else goAhead=notok; fi
+
+ setKey $test $result
+ current=$current+1
+ echo $(( (100*$current)/$totalnotests));
+}
+
+function performKileTest
+{
+ if [ $goAhead != ok ]; then return; fi
+
+ key=$1
+ shift
+ declare -i result=`$kileDCOP $*`
+ setKey $key $result
+ current=$current+1
+ echo $(( (100*$current)/$totalnotests));
+}
+
+function getVersion
+{
+ echo `$* -v || $* -version || $* --version`
+}
+
+function getTeXVersion
+{
+ ($* -v || $* -version || $* --version) | grep '^TeX' | sed 's/TeX\s*\(.*\)\s*([^\s]*)/\1/'
+}
+
+cd $basedir
+echo "current dir $PWD"
+
+testFile=test_plain.tex
+echo "opening $basedir/$testFile"
+$openDoc $basedir/$testFile
+
+echo "starting test: TeX"
+setTool TeX
+tool="tex --interaction=nonstopmode"
+setKey mustpass "where,basic,kile"
+setKey executable tex
+setKey where `which tex`
+setKey version `getTeXVersion tex`
+performTest basic "$tool test_plain.tex"
+performKileTest kile "run TeX"
+
+echo "starting test: PDFTeX"
+setTool PDFTeX
+tool="pdftex --interaction=nonstopmode"
+setKey mustpass ""
+setKey executable pdftex
+setKey where `which pdftex`
+performTest basic "$tool test_plain.tex"
+performKileTest kile "run PDFTeX"
+$closeDoc
+
+testFileBase="test"
+testFile=$testFileBase.tex
+echo "opening $basedir/$testFile"
+$openDoc $basedir/$testFile
+echo "starting test: LaTeX"
+setTool LaTeX
+tool="latex --interaction=nonstopmode"
+setKey mustpass "where,basic,kile"
+setKey executable latex
+setKey where `which latex`
+performTest basic "$tool $testFile"
+performKileTest kile "run LaTeX"
+performTest src "$tool -src $testFile"
+
+echo "starting test: PDFLaTeX"
+setTool PDFLaTeX
+setKey mustpass ""
+setKey executable pdflatex
+setKey where `which pdflatex`
+performTest basic "pdflatex $testFile"
+performKileTest kile "run PDFLaTeX"
+
+echo "starting test: DVItoPS"
+setTool DVItoPS
+setKey mustpass ""
+setKey executable dvips
+setKey where `which dvips`
+if [ -r $testFileBase.dvi ]; then performKileTest kile "run DVItoPS"; fi
+
+echo "starting test: DVItoPDF"
+setTool DVItoPDF
+setKey mustpass ""
+setKey executable dvipdfm
+setKey where `which dvipdfm`
+if [ -r $testFileBase.dvi ]; then performKileTest kile "run DVItoPDF"; fi
+
+echo "starting test: PStoPDF"
+setTool PStoPDF
+setKey mustpass ""
+setKey executable ps2pdf
+setKey where `which ps2pdf`
+if [ -r $testFileBase.ps ]; then performKileTest kile "run PStoPDF"; fi
+$closeDoc
+
+echo "starting test: BibTeX"
+setTool BibTeX
+setKey mustpass ""
+setKey executable bibtex
+setKey where `which bibtex`
+if [ -r "test.dvi" ] #LaTeX is working
+then
+ testFileBase=test_bib
+ testFile=$testFileBase.tex
+ $openDoc $basedir/$testFile
+ latex --interaction=nonstopmode $testFile
+ performTest basic "bibtex $testFileBase"
+ performKileTest kile "run BibTeX"
+ $closeDoc
+fi
+
+echo "starting test: MakeIndex"
+setTool MakeIndex
+setKey mustpass ""
+setKey executable makeindex
+setKey where `which makeindex`
+if [ -r "test.dvi" ] #LaTeX is working
+then
+ testFileBase=test_index
+ testFile=$testFileBase.tex
+ $openDoc $basedir/$testFile
+ latex --interaction=nonstopmode $testFile
+ performTest basic "makeindex $testFileBase"
+ performKileTest kile "run MakeIndex"
+ $closeDoc
+fi
+
+echo "starting test: KDVI"
+setTool KDVI
+setKey mustpass "where"
+setKey executable kdvi
+setKey where `which kdvi`
+
+echo "starting test: KGhostView"
+setTool KGhostView
+setKey mustpass ""
+setKey executable kghostview
+setKey where `which kghostview`
+
+echo "starting test: KPDF"
+setTool KPDF
+setKey mustpass ""
+setKey executable kpdf
+setKey where `which kpdf`
+
+echo "starting test: Acroread"
+setTool Acroread
+setKey mustpass ""
+setKey executable acroread
+setKey where `which acroread`
+
+echo "starting test: DVItoPNG"
+setTool DVItoPNG
+setKey mustpass ""
+setKey executable dvipng
+setKey where `which dvipng`
+
+echo "starting test: Convert"
+setTool Convert
+setKey mustpass ""
+setKey executable convert
+setKey where `which convert`
diff --git a/src/kile/test/test.bib b/src/kile/test/test.bib
new file mode 100644
index 0000000..71bbf84
--- /dev/null
+++ b/src/kile/test/test.bib
@@ -0,0 +1,6 @@
+@article { test,
+ title = "test",
+ author = "nobody",
+ year = "2004",
+ journal = "JHEP"
+}
diff --git a/src/kile/test/test.tex b/src/kile/test/test.tex
new file mode 100644
index 0000000..874b287
--- /dev/null
+++ b/src/kile/test/test.tex
@@ -0,0 +1,4 @@
+\documentclass{article}
+\begin{document}
+test
+\end{document}
diff --git a/src/kile/test/test_bib.tex b/src/kile/test/test_bib.tex
new file mode 100644
index 0000000..582d889
--- /dev/null
+++ b/src/kile/test/test_bib.tex
@@ -0,0 +1,6 @@
+\documentclass{article}
+\begin{document}
+\cite{test}
+\bibliographystyle{plain}
+\bibliography{test}
+\end{document}
diff --git a/src/kile/test/test_index.tex b/src/kile/test/test_index.tex
new file mode 100644
index 0000000..1de6a21
--- /dev/null
+++ b/src/kile/test/test_index.tex
@@ -0,0 +1,7 @@
+\documentclass{article}
+\usepackage{makeidx}
+\makeindex
+\begin{document}
+\index{test}
+\printindex
+\end{document}
diff --git a/src/kile/test/test_plain.tex b/src/kile/test/test_plain.tex
new file mode 100644
index 0000000..4ad45c4
--- /dev/null
+++ b/src/kile/test/test_plain.tex
@@ -0,0 +1,2 @@
+\relax
+\end
diff --git a/src/kile/texdocdialog.cpp b/src/kile/texdocdialog.cpp
new file mode 100644
index 0000000..6b88a29
--- /dev/null
+++ b/src/kile/texdocdialog.cpp
@@ -0,0 +1,660 @@
+/***************************************************************************
+ texdocdialog.cpp
+ ----------------
+ date : Feb 15 2007
+ version : 0.14
+ copyright : (C) 2005-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "texdocdialog.h"
+
+#include <qlayout.h>
+#include <qstringlist.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+#include <qgroupbox.h>
+#include <qregexp.h>
+#include <qwhatsthis.h>
+#include <kapplication.h>
+#include <qdesktopwidget.h>
+
+#include <kurl.h>
+#include <krun.h>
+#include <kmimetype.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include "kiledebug.h"
+#include <kdeversion.h>
+
+#include <ktrader.h>
+#include <kservice.h>
+
+
+namespace KileDialog
+{
+
+//BEGIN TexDocDialog
+
+TexDocDialog::TexDocDialog(QWidget *parent, const char *name)
+ : KDialogBase( parent,name, true, i18n("Documentation Browser"), Close | Help,
+#if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
+ NoDefault
+#else
+ Close
+#endif
+ , true ),
+ m_tempfile(0), m_proc(0)
+{
+ QWidget *page = new QWidget( this );
+ setMainWidget(page);
+
+ QVBoxLayout *vbox = new QVBoxLayout(page,8,8);
+
+ // listview
+ m_texdocs = new KListView(page);
+ m_texdocs->setRootIsDecorated(true);
+ m_texdocs->addColumn(i18n("Table of Contents"));
+
+ // groupbox
+ QGroupBox *groupbox = new QGroupBox( i18n("Search"), page, "groupbox" );
+ groupbox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, 0, 0, groupbox->sizePolicy().hasHeightForWidth() ) );
+ groupbox->setColumnLayout(0, Qt::Vertical );
+ groupbox->layout()->setSpacing( 6 );
+ groupbox->layout()->setMargin( 11 );
+ QGridLayout *groupboxLayout = new QGridLayout( groupbox->layout() );
+ groupboxLayout->setAlignment( Qt::AlignTop );
+
+ QLabel *label = new QLabel( i18n("&Keyword:"), groupbox, "label");
+ m_leKeywords = new KLineEdit("",groupbox);
+ m_pbSearch = new KPushButton(i18n("&Search"),groupbox);
+ label->setBuddy(m_leKeywords);
+
+ groupboxLayout->addWidget(label,0,0);
+ groupboxLayout->addWidget(m_leKeywords,0,1);
+ groupboxLayout->addWidget(m_pbSearch,1,0);
+
+ vbox->addWidget(m_texdocs);
+ vbox->addWidget(groupbox);
+
+ QWhatsThis::add(m_texdocs,i18n("A list of avaiblable documents, which are listed in 'texdoctk.dat', coming with TexLive/teTeX. A double click with the mouse or pressing the space key will open a viewer to show this file."));
+ QWhatsThis::add(m_leKeywords,i18n("You can choose a keyword to show only document files, which are related to this keyword."));
+ QWhatsThis::add(m_pbSearch,i18n("Start the search for the chosen keyword."));
+ QWhatsThis::add(actionButton(Help),i18n("Reset TOC to show all available files."));
+
+ setButtonText(Help,i18n("Reset &TOC"));
+ m_pbSearch->setEnabled(false);
+ enableButton(Help,false);
+
+ // catch some Return/Enter events
+ m_texdocs->installEventFilter(this);
+ m_leKeywords->installEventFilter(this);
+
+ connect(m_texdocs, SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),
+ this, SLOT(slotListViewDoubleClicked(QListViewItem *,const QPoint &,int)));
+ connect(m_pbSearch, SIGNAL(clicked()), this, SLOT(slotSearchClicked()));
+ connect(m_leKeywords, SIGNAL(textChanged(const QString &)), this, SLOT(slotTextChanged(const QString &)));
+
+ // kpsewhich --expand-path='$TEXMF'
+ //m_texmfPath = "/usr/local/share/texmf:/usr/local/lib/texmf:/var/lib/texmf:/usr/share/texmf";
+ // kpsewhich --expand-path='$TEXMF/doc'
+ //m_texmfdocPath = "/usr/local/share/texmf/doc:/usr/local/lib/texmf/doc:/usr/share/texmf/doc";
+ // kpsewhich --progname=texdoctk --format='other text files' texdoctk.dat
+ //m_texdoctkPath = "/usr/share/texmf/texdoctk/texdoctk.dat";
+
+ m_texmfPath = QString::null;
+ m_texmfdocPath = QString::null;
+ m_texdoctkPath = QString::null;
+
+ QDesktopWidget *desktop = KApplication::desktop();
+ int w = desktop->screenGeometry(0).width();
+ if ( w >= 1024 )
+ w = 550;
+ else if ( w >= 800 )
+ w = 500;
+ else
+ w = 450;
+ int h = desktop->screenGeometry(0).height() ;
+ if ( h >= 768 )
+ h = 550;
+ else if ( h >= 600 )
+ h = 500;
+ else
+ h = 450;
+ resize(w,h);
+
+ connect(this, SIGNAL(processFinished()), this, SLOT(slotInitToc()));
+ executeScript(
+ "kpsewhich --progname=texdoctk --format='other text files' texdoctk.dat && "
+ "kpsewhich --expand-path='$TEXMF/doc' && "
+ "kpsewhich --expand-path='$TEXMF'"
+ );
+
+ //readToc();
+ //slotHelp();
+}
+
+TexDocDialog::~TexDocDialog()
+{
+ if (m_proc )
+ delete m_proc;
+ if ( m_tempfile )
+ delete m_tempfile;
+}
+
+////////////////////// TOC //////////////////////
+
+void TexDocDialog::readToc()
+{
+ // open to read
+ QFile fin( m_texdoctkPath );
+ if ( !fin.exists() || !fin.open(IO_ReadOnly) )
+ {
+ KMessageBox::error(this,i18n("Could not read 'texdoctk.dat'."));
+ return;
+ }
+
+ // use a textstream to read all data
+ QString textline;
+ QTextStream data(&fin);
+ while ( ! data.eof() )
+ {
+ textline = data.readLine();
+ if ( ! (textline.isEmpty() || textline[0]=='#') )
+ {
+ // save the whole entry
+ m_tocList.append( textline );
+
+ // list entries 0,1,basename(2),3 are needed for keyword search
+ // (key,title,filepath,keywords)
+ QStringList list = QStringList::split(';',textline,true);
+
+ // get basename of help file
+ QString basename;
+ if ( list.count() > 2 )
+ {
+ QFileInfo fi(list[2]);
+ basename = fi.baseName().lower();
+ }
+
+ QString entry = list[0] + ';' + list[1];
+ if ( ! basename.isEmpty() )
+ entry += ';' + basename;
+ if ( list.count() > 3 )
+ entry += ';' + list[3];
+ m_tocSearchList.append(entry);
+ }
+ }
+}
+
+void TexDocDialog::showToc(const QString &caption,const QStringList &doclist, bool toc)
+{
+ QString section,textline;
+ QStringList keylist;
+ KListViewItem *itemsection = 0L;
+
+ setUpdatesEnabled( false );
+ m_texdocs->setColumnText(0,caption);
+
+ for (uint i=0; i<doclist.count(); i++ )
+ {
+ if ( doclist[i][0] == '@' )
+ {
+ section = doclist[i];
+ itemsection = new KListViewItem(m_texdocs,section.remove(0,1));
+ }
+ else
+ {
+ keylist = QStringList::split(';',doclist[i],true);
+ if ( itemsection )
+ {
+ KListViewItem *item = new KListViewItem(itemsection,keylist[1],keylist[0]);
+ item->setPixmap(0, SmallIcon(getIconName(keylist[2])) );
+
+ // save filename in dictionary
+ m_dictDocuments[keylist[0]] = keylist[2];
+
+ // search for special keywords
+ QRegExp reg( "^\\s*(-\\d-)" );
+ if ( keylist[3].find(reg,0) == 0 )
+ {
+ m_dictStyleCodes[keylist[0]] = reg.cap(1);
+ }
+ }
+ }
+ }
+ setUpdatesEnabled( true );
+
+ if ( toc )
+ m_pbSearch->setEnabled(false);
+ enableButton(Help,!toc);
+ m_texdocs->setFocus();
+}
+
+bool TexDocDialog::eventFilter(QObject *o, QEvent *e)
+{
+ // catch KeyPress events
+ if ( e->type() == QEvent::KeyPress )
+ {
+ QKeyEvent *kev = (QKeyEvent*) e;
+
+ // ListView:
+ // - space: enable start of viewer
+ // - return: ignore
+ if ( o == m_texdocs )
+ {
+ if ( kev->key() == Qt::Key_Space )
+ {
+ slotListViewDoubleClicked(m_texdocs->currentItem(), QPoint(0,0), 0) ;
+ return true;
+ }
+ if ( kev->key()==Qt::Key_Return || kev->key()==Qt::Key_Enter )
+ return true;
+ }
+
+ // LineEdit
+ // - return: start search, if button is enabled
+ if ( o == m_leKeywords )
+ {
+ if ( kev->key()==Qt::Key_Return || kev->key()==Qt::Key_Enter )
+ {
+ callSearch();
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+////////////////////// prepare document file //////////////////////
+
+QString TexDocDialog::searchFile(const QString &docfilename,const QString &listofpathes, const QString &subdir)
+{
+ QStringList pathlist = QStringList::split(':',listofpathes);
+ QStringList extlist = QStringList::split(',',",.gz,.bz2",true);
+
+ QString filename;
+ for ( QStringList::Iterator itp = pathlist.begin(); itp!=pathlist.end(); ++itp )
+ {
+ for ( QStringList::Iterator ite = extlist.begin(); ite!=extlist.end(); ++ite )
+ {
+ filename = ( subdir.isEmpty() ) ? (*itp) + '/' + docfilename + (*ite)
+ : (*itp) + '/' + subdir + '/' + docfilename + (*ite);
+ // KILE_DEBUG() << "search file: " << filename << endl;
+ if ( QFile::exists(filename) )
+ return filename;
+ }
+ }
+
+ return QString::null;
+}
+
+void TexDocDialog::decompressFile(const QString &docfile,const QString &command)
+{
+ QString ext = QFileInfo(docfile).extension(false).lower();
+ if ( ! ( ext=="dvi" || ext=="pdf" || ext=="ps" || ext=="html") )
+ ext = "txt";
+
+ if ( m_tempfile )
+ delete m_tempfile;
+
+ m_tempfile = new KTempFile(QString::null, '.' + ext);
+ m_tempfile->setAutoDelete(true);
+ m_filename = m_tempfile->name();
+
+ KILE_DEBUG() << "\tdecompress file: " << command + " > " + m_tempfile->name() << endl;
+ connect(this, SIGNAL(processFinished()), this, SLOT(slotShowFile()));
+ executeScript(command + " > " + m_tempfile->name());
+}
+
+void TexDocDialog::showStyleFile(const QString &filename,const QString &stylecode)
+{
+ KILE_DEBUG() << "\tshow style file: "<< filename << endl;
+ if ( ! QFile::exists(filename) )
+ return;
+
+ // open to read
+ QFile fin( filename );
+ if ( !fin.exists() || !fin.open(IO_ReadOnly) )
+ {
+ KMessageBox::error(this,i18n("Could not read the style file."));
+ return;
+ }
+
+ if ( m_tempfile )
+ delete m_tempfile;
+ m_tempfile = new KTempFile(QString::null,".txt");
+ m_tempfile->setAutoDelete(true);
+
+ // use a textstream to write to the temporary file
+ QFile tmpfile(m_tempfile->name());
+ if ( ! tmpfile.open( IO_WriteOnly ) )
+ {
+ KMessageBox::error(this,i18n("Could not create a temporary file."));
+ return ;
+ }
+ QTextStream stream(&tmpfile);
+
+ // use another textstream to read from the style file
+ QTextStream sty( &fin );
+
+ // there are four mode to read from the style file
+ QString textline;
+ if ( stylecode == "-3-" )
+ {
+ // mode 3: read everything up to the first empty line
+ while ( ! sty.eof() ) {
+ textline = sty.readLine().stripWhiteSpace();
+ if ( textline.isEmpty() )
+ break;
+ stream << textline << "\n";
+ }
+ }
+ else if ( stylecode == "-2-" )
+ {
+ // mode 2: read everything up to a line starting with at least 4 '%' characters
+ for ( int i=0; i<9; ++i )
+ stream << sty.readLine() << "\n";
+ while ( ! sty.eof() )
+ {
+ textline = sty.readLine();
+ if ( textline.find("%%%%") == 0 )
+ break;
+ stream << textline << "\n";
+ }
+ }
+ else if ( stylecode == "-1-" )
+ {
+ // mode 1: read all lines at the end behind \endinput
+ while ( ! sty.eof() )
+ {
+ textline = sty.readLine().stripWhiteSpace();
+ if ( textline.find("\\endinput") == 0 )
+ break;
+ }
+ while ( ! sty.eof() )
+ {
+ stream << sty.readLine() << "\n";
+ }
+ }
+ else
+ {
+ // mode 0: read everything except empty lines and comments
+ while ( ! sty.eof() )
+ {
+ textline = sty.readLine();
+ if ( !textline.isEmpty() && textline[0]!='%' )
+ stream << textline << "\n";
+ }
+ }
+ tmpfile.close();
+
+ // start the viewer
+ showFile(m_tempfile->name());
+}
+
+void TexDocDialog::showFile(const QString &filename)
+{
+ KILE_DEBUG() << "\tshow file: "<< filename << endl;
+ if ( QFile::exists(filename) )
+ {
+ KURL url;
+ url.setPath(filename);
+
+ KTrader::OfferList offers = KTrader::self()->query( getMimeType(filename),"Type == 'Application'");
+ if ( offers.isEmpty() )
+ {
+ KMessageBox::error(this,i18n("No KDE service found for this file."));
+ return;
+ }
+ KService::Ptr ptr = offers.first();
+ KURL::List lst;
+ lst.append(url);
+ KRun::run(*ptr, lst, true);
+ }
+}
+
+
+////////////////////// Slots //////////////////////
+
+void TexDocDialog::slotListViewDoubleClicked(QListViewItem *item,const QPoint &,int)
+{
+ if ( ! item->parent() )
+ return;
+
+ QString package = item->text(1);
+ KILE_DEBUG() << "\tselect child: " << item->text(0) << endl
+ << "\tis package: " << package << endl;
+ if ( ! m_dictDocuments.contains( package ) )
+ return;
+
+ QString texdocfile = m_dictDocuments[package];
+ KILE_DEBUG() << "\tis texdocfile: " << texdocfile << endl;
+
+ // search for the file in the documentation directories
+ QString filename = searchFile(texdocfile,m_texmfdocPath);
+ if ( filename.isEmpty() )
+ {
+ // not found: search it elsewhere
+ filename = searchFile(texdocfile,m_texmfPath,"tex");
+ if ( filename.isEmpty() )
+ {
+ KMessageBox::error(this,i18n("Could not find '%1'").arg(filename));
+ return;
+ }
+ }
+ KILE_DEBUG() << "\tfound file: " << filename << endl;
+
+ QString ext = QFileInfo(filename).extension(false).lower();
+ m_filename = QString::null;
+ if ( ext == "gz" )
+ decompressFile(m_dictDocuments[package],"gzip -cd "+filename);
+ else if ( ext == "bz2" )
+ decompressFile(m_dictDocuments[package],"bzip2 -cd "+filename);
+ else if ( ext=="sty" && m_dictStyleCodes.contains(package) )
+ showStyleFile(filename,m_dictStyleCodes[package]);
+ else
+ showFile(filename);
+}
+
+void TexDocDialog::slotTextChanged(const QString &text)
+{
+ m_pbSearch->setEnabled( ! text.stripWhiteSpace().isEmpty() );
+}
+
+void TexDocDialog::slotSearchClicked()
+{
+ QString keyword = m_leKeywords->text().stripWhiteSpace();
+ if ( keyword.isEmpty() )
+ {
+ KMessageBox::error(this,i18n("No keyword given."));
+ return;
+ }
+
+ QString section;
+ bool writesection = true;
+ QStringList searchlist;
+
+ for (uint i=0; i<m_tocList.count(); i++ )
+ {
+ if ( m_tocList[i][0] == '@' )
+ {
+ section = m_tocList[i];
+ writesection = true;
+ }
+ else if ( m_tocSearchList[i].find(keyword,0,false) > -1 )
+ {
+ if ( writesection )
+ searchlist.append(section);
+ searchlist.append(m_tocList[i]);
+ writesection = false;
+ }
+ }
+
+ if ( searchlist.count() > 0 )
+ {
+ m_texdocs->clear();
+ showToc(i18n("Search results for keyword '%1'").arg(keyword),searchlist,false);
+ }
+ else
+ KMessageBox::error(this,i18n("No documents found for keyword '%1'.").arg(keyword));
+}
+
+void TexDocDialog::slotHelp()
+{
+ m_leKeywords->setText(QString::null);
+ m_texdocs->clear();
+ showToc(i18n("Table of Contents"),m_tocList,true);
+}
+
+void TexDocDialog::callSearch()
+{
+ if ( m_pbSearch->isEnabled() )
+ slotSearchClicked();
+}
+
+////////////////////// execute shell script //////////////////////
+
+void TexDocDialog::executeScript(const QString &command)
+{
+ if ( m_proc )
+ delete m_proc;
+
+ m_proc = new KShellProcess("/bin/sh");
+ m_proc->clearArguments();
+ (*m_proc) << QStringList::split(' ',command);
+ m_output = QString::null;
+
+ connect(m_proc, SIGNAL(receivedStdout(KProcess*,char*,int)),
+ this, SLOT(slotProcessOutput(KProcess*,char*,int)) );
+ connect(m_proc, SIGNAL(receivedStderr(KProcess*,char*,int)),
+ this, SLOT(slotProcessOutput(KProcess*,char*,int)) );
+ connect(m_proc, SIGNAL(processExited(KProcess*)),
+ this, SLOT(slotProcessExited(KProcess*)) );
+
+ KILE_DEBUG() << "=== TexDocDialog::runShellSkript() ====================" << endl;
+ KILE_DEBUG() << " execute: " << command << endl;
+ if ( ! m_proc->start(KProcess::NotifyOnExit, KProcess::AllOutput) )
+ KILE_DEBUG() << "\tstart of shell process failed" << endl;
+}
+
+void TexDocDialog::slotProcessOutput(KProcess*,char* buf,int len)
+{
+ m_output += QString::fromLocal8Bit(buf,len);
+}
+
+
+void TexDocDialog::slotProcessExited(KProcess *proc)
+{
+ if ( proc->normalExit() && !proc->exitStatus() )
+ {
+ //showFile(m_filename);
+ emit( processFinished() );
+ }
+ else
+ {
+ KMessageBox::error( this,i18n("<center>") + i18n("Could not determine the search paths of TexLive/teTeX or file 'texdoctk.dat'.<br> So this dialog is useless.") + i18n("</center>"),i18n("TexDoc Dialog") );
+ }
+}
+
+////////////////////// process slots, when finished //////////////////////
+
+void TexDocDialog::slotInitToc()
+{
+ disconnect(this, SIGNAL(processFinished()), this, SLOT(slotInitToc()));
+
+ QStringList results = QStringList::split('\n',m_output,true);
+ if ( results.count() < 3 )
+ {
+ KMessageBox::error(this,i18n("Could not determine the search paths of TexLive/teTeX or file 'texdoctk.dat'.<br> So this dialog is useless."));
+ return;
+ }
+
+ m_texdoctkPath = results[0];
+ m_texmfdocPath = results[1];
+ m_texmfPath = results[2];
+
+ KILE_DEBUG() << "\ttexdoctk path: " << m_texdoctkPath << endl;
+ KILE_DEBUG() << "\ttexmfdoc path: " << m_texmfdocPath << endl;
+ KILE_DEBUG() << "\ttexmf path: " << m_texmfPath << endl;
+
+ if ( m_texdoctkPath.find('\n',-1) > -1 )
+ {
+ m_texdoctkPath.truncate(m_texdoctkPath.length()-1);
+ }
+
+ // read data and initialize listview
+ readToc();
+ slotHelp();
+}
+
+void TexDocDialog::slotShowFile()
+{
+ disconnect(this, SIGNAL(processFinished()), this, SLOT(slotShowFile()));
+ showFile(m_filename);
+}
+
+////////////////////// Icon/Mime //////////////////////
+
+QString TexDocDialog::getMimeType(const QString &filename)
+{
+ QFileInfo fi(filename);
+ QString basename = fi.baseName().lower();
+ QString ext = fi.extension(false).lower();
+
+ QString mimetype;
+ if ( ext=="txt" || ext=="faq" || ext=="sty" || basename=="readme" || basename=="00readme" )
+ {
+ mimetype = "text/plain";
+ }
+ else
+ {
+ KURL mimeurl;
+ mimeurl.setPath(filename);
+ KMimeType::Ptr pMime = KMimeType::findByURL(mimeurl);
+ mimetype = pMime->name();
+ }
+
+ KILE_DEBUG() << "\tmime = " << mimetype << " " << endl;
+ return mimetype;
+}
+
+QString TexDocDialog::getIconName(const QString &filename)
+{
+ QFileInfo fi( filename );
+ QString basename = fi.baseName().lower();
+ QString ext = fi.extension(false).lower();
+
+ QString icon;
+ if ( ext=="dvi" || ext=="pdf" || ext=="html" || ext == "htm" || ext == "txt")
+ icon = ext;
+ else if ( ext == "ps" )
+ icon = "postscript";
+ else if ( ext == "sty" )
+ icon = "tex";
+ else if ( ext == "faq" || basename=="readme" || basename=="00readme" )
+ icon = "readme";
+ else
+ icon = "ascii";
+
+ return icon;
+}
+
+
+//END TexDocDialog
+
+
+}
+#include "texdocdialog.moc"
diff --git a/src/kile/texdocdialog.h b/src/kile/texdocdialog.h
new file mode 100644
index 0000000..fe6af35
--- /dev/null
+++ b/src/kile/texdocdialog.h
@@ -0,0 +1,99 @@
+/***************************************************************************
+ texdocdialog.h
+ --------------
+ date : Feb 15 2007
+ version : 0.14
+ copyright : (C) 2005-2007 by Holger Danielsson
+ email : holger.danielsson@versanet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef TEXDOCDIALOG_H
+#define TEXDOCDIALOG_H
+
+#include <kdialogbase.h>
+#include <klineedit.h>
+#include <kpushbutton.h>
+#include <kprocess.h>
+#include <ktempfile.h>
+#include <klistview.h>
+
+#include <qlabel.h>
+#include <qstringlist.h>
+#include <qmap.h>
+
+namespace KileDialog
+{
+
+class TexDocDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ TexDocDialog(QWidget *parent=0, const char *name=0);
+ ~TexDocDialog();
+
+private:
+ KListView *m_texdocs;
+ KLineEdit *m_leKeywords;
+ KPushButton *m_pbSearch;
+
+ QString m_texmfPath, m_texmfdocPath, m_texdoctkPath;
+
+ QStringList m_tocList,m_tocSearchList;
+ QMap<QString,QString> m_dictDocuments;
+ QMap<QString,QString> m_dictStyleCodes;
+
+ void readToc();
+ void showToc(const QString &caption,const QStringList &doclist, bool toc=true);
+
+ QString m_filename;
+ QString m_output;
+
+ KTempFile *m_tempfile;
+ KShellProcess *m_proc;
+
+ void callSearch();
+ void executeScript(const QString &command);
+ void showFile(const QString &filename);
+
+ QString searchFile(const QString &docfilename,const QString &listofpathes,
+ const QString &subdir=QString::null);
+ void decompressFile(const QString &docfile,const QString &command);
+ void showStyleFile(const QString &filename,const QString &stylecode);
+
+ QString getMimeType(const QString &filename);
+ QString getIconName(const QString &filename);
+
+protected:
+ bool eventFilter(QObject *o, QEvent *e);
+
+signals:
+ void processFinished();
+
+protected slots:
+ void slotHelp();
+
+private slots:
+ void slotListViewDoubleClicked(QListViewItem *item,const QPoint &,int);
+ void slotTextChanged(const QString &text);
+ void slotSearchClicked();
+
+ void slotProcessOutput(KProcess*,char* buf,int len);
+ void slotProcessExited (KProcess *proc);
+
+ void slotInitToc();
+ void slotShowFile();
+};
+
+}
+
+#endif
diff --git a/src/kile/tips b/src/kile/tips
new file mode 100644
index 0000000..8ef3d2a
--- /dev/null
+++ b/src/kile/tips
@@ -0,0 +1,87 @@
+<tip category="Kile|General">
+<html>
+<p>...that you can create your own templates? Create a document containing the text you usually start with and save it; then, select "Create Template from Document" from the "File" menu, fill in the dialog and you are done: next time you create a new document you can select the template from the template list.</p>
+</html>
+</tip>
+
+<tip category="Kile|General">
+<html>
+<p>...that Kile supports forward search? This enables you to switch back and forth between places in the source file and their corresponding locations in the DVI file. Stop spending so much time on finding the place in the source file: if you spotted a mistake while viewing the DVI, finding the correct location is just a mouse-click away!.</p>
+
+<p><a href="help:/kile/quick_inverseforward.html">Read the manual to find out how to activate this feature.</a></p>
+</html>
+</tip>
+
+<tip category="Kile|Tools">
+<html>
+<p>...that the Quick Build tool is now fully configurable? Go to <b>Settings->Configure Kile->Build</b> and select the <b>QuickBuild</b> tool.</p>
+</html>
+</tip>
+
+<tip category="Kile|Project">
+<html>
+<p>...that using projects gives Kile much more power? You can, for example, bundle and archive all related documents in a project; also, features like auto-completion of references and citations become much more powerful. Kile is even able to determine which document is the master document in a project.</p>
+</html>
+</tip>
+
+<tip category="Kile|Project">
+<html>
+<p>...that you can configure which QuickBuild command is issued for a project? Just go to <b>Project->Project Options</b> and select a QuickBuild command.</p>
+</html>
+</tip>
+
+<tip category="Kile|Editor">
+<html>
+<p>...that inserting references and citations has never been easier? Enable auto-completion and type in <code>\ref{</code>, a list with all available labels will appear automatically (if auto-completion is not enabled, press Ctrl+Space).</p>
+
+<p>Note that this feature is much more powerful if the current document belongs to a project.</p>
+
+<p>You can configure auto-completion by going to <b>Settings->Configure Kile->Complete</b>; there, you can select databases of LaTeX commands. You can even create your own lists of commands.</p>
+</html>
+</tip>
+
+<tip category="Kile|Editor">
+<html>
+<p>...that Kile can complete LaTeX commands for you? Type <code>\se</code> and press Ctrl+Space, a list of all commands starting with <code>\se</code> will appear.</p>
+
+<p>You can configure auto-completion by going to <b>Settings->Configure Kile->Complete</b>; there, you can select databases of LaTeX commands. You can even create your own lists of commands.</p>
+</html>
+</tip>
+
+<tip category="Kile|Editor">
+<html>
+<p>...starting a new environment is very easy using the auto-complete feature. For example, type <code>equ</code> and press Alt+Space and a list of all environments starting with <code>equ</code> appears. Press Enter to select the first entry and a <code>\begin{equation}\end{equation}</code> pair is inserted in your document.</p>
+
+<p>You can configure auto-completion by going to <b>Settings->Configure Kile->Complete</b>; there, you can select databases of LaTeX commands. You can even create your own lists of commands.</p>
+</html>
+</tip>
+
+<tip category="Kile|Editor">
+<html>
+<p>...Kile now contains several editing tools to help you type in LaTeX faster and easier? Check out the <b>Complete, Select, Delete, Environment and TeX Group</b> menus in the <b>Edit</b> menu.</p>
+</html>
+</tip>
+
+<tip category="Kile|General">
+<html>
+<p>...that the Quick Preview tool will compile and select a part of a document? This can be a <b>selected text</b>, the <b>current environment</b> or the <b>current subdocument</b>.</p>
+
+<p>You can configure Quick preview by going to <b>Settings->Configure Kile->Preview</b>. There, you can select one of the predefined configurations.</p>
+</html>
+</tip>
+
+<tip category="Kile|General">
+<html>
+<p>...that a new wizard will help to create tabulars and arrays?</p>
+
+<p>A right click with the mouse will open a dialog or a popup menu, where a lot of attributes like <b>alignment</b>, <b>colors</b>, <b>horizontal and vertical lines</b> and more can be set. Also <b>multicolumn cells</b> are supported.</p>
+</html>
+</tip>
+
+<tip category="Kile|General">
+<html>
+<p>...that Kile can show user defined help files?</p>
+
+<p>Go to <b>Settings->Configure Kile->Help</b> and configure your help files, which are integrated into the help menu.</p>
+</html>
+</tip>
diff --git a/src/kile/toolconfigwidget.ui b/src/kile/toolconfigwidget.ui
new file mode 100644
index 0000000..54816bb
--- /dev/null
+++ b/src/kile/toolconfigwidget.ui
@@ -0,0 +1,627 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ToolConfigWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ToolConfigWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>669</width>
+ <height>474</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>2</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>Configure</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>m_groupLeft</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_lbSelectTool</cstring>
+ </property>
+ <property name="text">
+ <string>Select a &amp;tool:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_lstbTools</cstring>
+ </property>
+ </widget>
+ <widget class="KListBox">
+ <property name="name">
+ <cstring>m_lstbTools</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>2</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>m_pshbRemoveTool</cstring>
+ </property>
+ <property name="text">
+ <string>Remove Tool</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>m_pshbNewTool</cstring>
+ </property>
+ <property name="text">
+ <string>New Tool...</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>m_line</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>VLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>m_groupRight</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="spacing">
+ <number>10</number>
+ </property>
+ <widget class="KPushButton" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_pshbRemoveConfig</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Remove Config</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="2" column="3">
+ <property name="name">
+ <cstring>m_pshbDefault</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Default Settings</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="2" column="0">
+ <property name="name">
+ <cstring>m_pshbNewConfig</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>New Config...</string>
+ </property>
+ </widget>
+ <widget class="QTabWidget" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>m_tab</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>2</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>400</width>
+ <height>0</height>
+ </size>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;General</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QWidgetStack">
+ <property name="name">
+ <cstring>m_stackBasic</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>WStackPage</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ </widget>
+ </widget>
+ <widget class="QWidgetStack">
+ <property name="name">
+ <cstring>m_stackExtra</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>WStackPage</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ </widget>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>240</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Advanced</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>m_cbType</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_lbType</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Type:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_cbType</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="6" column="1">
+ <property name="name">
+ <cstring>m_leRelDir</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="6" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Relative dir:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_leRelDir</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="5" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Target &amp;file:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_leFile</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>m_lbTarget</cstring>
+ </property>
+ <property name="text">
+ <string>Tar&amp;get extension:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_leTarget</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="5" column="1">
+ <property name="name">
+ <cstring>m_leFile</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="4" column="1">
+ <property name="name">
+ <cstring>m_leTarget</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>m_leSource</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>m_lbSource</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Source extension:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_leSource</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_lbClass</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;lass:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_cbClass</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_ckClose</cstring>
+ </property>
+ <property name="text">
+ <string>Close Konsole when tool is finished</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="2" column="1">
+ <property name="name">
+ <cstring>m_cbClass</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <spacer row="8" column="1">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="7" column="0">
+ <property name="name">
+ <cstring>m_lbState</cstring>
+ </property>
+ <property name="text">
+ <string>St&amp;ate:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_cbState</cstring>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="7" column="1">
+ <property name="name">
+ <cstring>m_cbState</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Me&amp;nu</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_lbMenu</cstring>
+ </property>
+ <property name="text">
+ <string>Add tool to Build &amp;menu:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_cbMenu</cstring>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>m_cbMenu</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>m_lbIcon</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Icon:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pshbIcon</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>m_spacerMenu</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>100</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>m_pshbIcon</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_lbConfig</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Select a &amp;configuration:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_cbConfig</cstring>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_cbConfig</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>4</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+</widget>
+<tabstops>
+ <tabstop>m_lstbTools</tabstop>
+ <tabstop>m_cbConfig</tabstop>
+ <tabstop>m_tab</tabstop>
+ <tabstop>m_pshbRemoveTool</tabstop>
+ <tabstop>m_pshbNewTool</tabstop>
+ <tabstop>m_pshbNewConfig</tabstop>
+ <tabstop>m_pshbRemoveConfig</tabstop>
+ <tabstop>m_pshbDefault</tabstop>
+ <tabstop>m_cbType</tabstop>
+ <tabstop>m_cbClass</tabstop>
+ <tabstop>m_leSource</tabstop>
+ <tabstop>m_leTarget</tabstop>
+ <tabstop>m_leFile</tabstop>
+ <tabstop>m_leRelDir</tabstop>
+ <tabstop>m_cbMenu</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/kile/userhelp.cpp b/src/kile/userhelp.cpp
new file mode 100644
index 0000000..3d847e5
--- /dev/null
+++ b/src/kile/userhelp.cpp
@@ -0,0 +1,312 @@
+/***************************************************************************
+ userhelp.cpp
+----------------------------------------------------------------------------
+ date : Aug 17 2006
+ version : 0.25
+ copyright : (C) 2005-2006 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "userhelp.h"
+
+#include <qfileinfo.h>
+
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <kurl.h>
+#include <krun.h>
+#include <kmimetype.h>
+#include "kiledebug.h"
+
+#include "userhelpdialog.h"
+#include "kileconfig.h"
+
+namespace KileHelp
+{
+
+UserHelp::UserHelp(KileTool::Manager *manager, KMenuBar *menubar)
+ : m_manager(manager), m_menubar(menubar), m_helpid(0), m_sepid(0)
+{
+ expandHelpMenu();
+
+ if ( m_helpmenu )
+ readConfig();
+}
+
+UserHelp::~UserHelp()
+{
+ delete m_helppopup;
+}
+
+void UserHelp::readConfig()
+{
+ //KILE_DEBUG() << "\tuserhelp: read config" << endl;
+ QStringList menu,files;
+
+ // first read all entries
+ KConfig *config = m_manager->config();
+ config->setGroup("UserHelp");
+ int entries = config->readNumEntry("entries");
+ for ( int i=0; i<entries; ++i )
+ {
+ menu << config->readEntry(QString("menu%1").arg(i));
+ if ( !menu[i].isEmpty() || menu[i]=="-" )
+ files << config->readEntry(QString("file%1").arg(i));
+ else
+ files << QString::null;
+ }
+
+ // then update menu
+ updateEntries(menu,files,false);
+}
+
+void UserHelp::writeConfig()
+{
+ //KILE_DEBUG() << "\tuserhelp: write config" << endl;
+ int entries = m_menuentries.count();
+
+ // first delete old entries
+ KConfig *config = m_manager->config();
+ config->deleteGroup("UserHelp");
+
+ // then write new entries
+ config->setGroup("UserHelp");
+ config->writeEntry("entries",entries);
+ for ( int i=0; i<entries; ++i )
+ {
+ config->writeEntry(QString("menu%1").arg(i), m_menuentries[i]);
+ if ( m_menuentries[i] != "-" )
+ config->writeEntry(QString("file%1").arg(i), m_helpfiles[i]);
+ }
+}
+
+void UserHelp::expandHelpMenu()
+{
+ m_helppopup = 0L;
+ m_helpid = 0;
+ m_sepid = 0;
+
+ m_helpmenu = getHelpPopup();
+ if ( m_helpmenu )
+ {
+ int helpindex = getHelpIndex(m_helpmenu);
+
+ m_helppopup = new QPopupMenu();
+ if ( m_helppopup )
+ {
+ m_sepid = m_helpmenu->insertSeparator(helpindex);
+ m_helpid = m_helpmenu->insertItem(i18n("User Help"),m_helppopup,-1,helpindex);
+ m_helpmenu->setItemVisible(m_helpid,false);
+ m_helpmenu->setItemVisible(m_sepid,false);
+ }
+ }
+}
+
+// update stringlists and userhelp menu
+
+void UserHelp::updateEntries(const QStringList &entries, const QStringList &files, bool save)
+{
+ if ( m_menuentries==entries && m_helpfiles==files)
+ return;
+
+ // save new entries
+ if ( m_helppopup )
+ m_helppopup->clear();
+ m_menuentries = entries;
+ m_helpfiles = files;
+
+ // set userhelp menu
+ if ( m_menuentries.count() > 0 )
+ {
+ setupUserHelpMenu();
+ m_helpmenu->setItemVisible(m_helpid,true);
+ m_helpmenu->setItemVisible(m_sepid,true);
+ }
+ else
+ {
+ m_helpmenu->setItemVisible(m_helpid,false);
+ m_helpmenu->setItemVisible(m_sepid,false);
+ }
+
+ if ( save )
+ writeConfig();
+}
+
+void UserHelp::setupUserHelpMenu()
+{
+ if ( ! m_helppopup ) return;
+
+ int helpid;
+ for ( uint i=0; i<m_menuentries.count(); ++i )
+ {
+ // first look, if this entry is a separator
+ if ( m_menuentries[i] == "-" )
+ {
+ helpid = m_helppopup->insertSeparator(-1);
+ }
+ else
+ {
+ // check for a http file
+ bool http = ( m_helpfiles[i].find("http://",0) == 0 );
+
+ // some file types have an icon
+ QFileInfo fi(m_helpfiles[i]);
+ QString ext = fi.extension(false);
+ if ( ext == "htm" )
+ ext = "html";
+ if ( http || ext=="html" || ext=="dvi" || ext=="ps" || ext=="pdf" )
+ {
+ QString icon = ( http ) ? "viewhtml" : ext;
+ helpid = m_helppopup->insertItem( SmallIcon(icon),m_menuentries[i],
+ this,SLOT(slotUserHelpActivated(int)) );
+ }
+ else
+ {
+ helpid = m_helppopup->insertItem( m_menuentries[i],
+ this,SLOT(slotUserHelpActivated(int)) );
+ }
+
+ // send index of QStringList as parameter, when the slot is activated
+ m_helppopup->setItemParameter(helpid,i);
+ }
+ }
+}
+
+void UserHelp::enableUserHelpEntries(bool state)
+{
+ if ( m_helppopup )
+ delete m_helppopup;
+
+ expandHelpMenu();
+ if ( m_helpmenu && m_helppopup && m_menuentries.count()>0 )
+ {
+ setupUserHelpMenu();
+ m_helpmenu->setItemVisible(m_helpid,state);
+ m_helpmenu->setItemVisible(m_sepid,state);
+ }
+}
+
+QPopupMenu *UserHelp::getHelpPopup()
+{
+ int helpid = 0;
+
+ for (uint i=0; i<m_menubar->count(); ++i)
+ {
+ int id = m_menubar->idAt(i);
+ QString text = m_menubar->text(id);
+
+ if ( text == i18n("&Help") )
+ {
+ helpid = id;
+ break;
+ }
+ }
+ return ( helpid == 0 ) ? 0 : m_menubar->findItem(helpid)->popup();
+}
+
+int UserHelp::getHelpIndex(QPopupMenu *popup)
+{
+ if ( popup )
+ {
+ int count = 0;
+ for (uint i=0; i<popup->count(); ++i)
+ {
+ int entryid = popup->idAt(i);
+ QString entry = popup->text(entryid);
+
+ if ( entry.isEmpty() )
+ {
+ if ( ++count == 2 )
+ return (i+1);
+ }
+ }
+ }
+
+ return (0);
+}
+
+void UserHelp::slotUserHelpActivated(int index)
+{
+ KILE_DEBUG() << "==slotUserHelpActivated(" << index << ")============" << endl;
+ if ( ! (index>=0 && index<(int)m_helpfiles.count()) )
+ return;
+
+ // get filename of this user help entry
+ QString filename = m_helpfiles[index];
+
+ // does the files exist?
+ QFileInfo fi(filename);
+ bool http = ( filename.find("http://",0) == 0 );
+ if ( !http && !fi.exists() )
+ {
+ KMessageBox::error(0,QString(i18n("File '%1' doesn't exist.")).arg(filename));
+ return;
+ }
+
+ // show help file
+ KILE_DEBUG() << "\tshow userhelpfile (" << filename << ")" << endl;
+
+ // determine, how to show the file
+ QString type;
+ QString cfg = "Embedded Viewer";
+ if ( !http && KileConfig::embedded()==0 )
+ {
+ QString ext = fi.extension(false);
+ if ( ext == "dvi" )
+ type = "ViewDVI";
+ else if ( ext == "ps" )
+ type = "ViewPS";
+ else if ( ext == "pdf" )
+ type = "ViewPDF";
+ else if ( ext=="html" || ext=="htm" )
+ type = "ViewHTML";
+ }
+
+ KConfig *config = m_manager->config();
+ if ( type!=QString::null && config->hasGroup("Tool/" + type + '/' + cfg) )
+ {
+ KileTool::View *tool = new KileTool::View(type, m_manager, false);
+ tool->setFlags(0);
+ tool->setSource(filename);
+ tool->setTarget(fi.fileName());
+ tool->prepareToRun();
+ m_manager->run(tool,cfg);
+ }
+ else
+ {
+ KURL url = KURL::fromPathOrURL(filename);
+ KMimeType::Ptr pMime = KMimeType::findByURL(url);
+ KRun::runURL(url, pMime->name());
+ }
+}
+
+void UserHelp::userHelpDialog()
+{
+ QStringList userhelpmenulist, userhelpfilelist;
+
+ KileDialog::UserHelpDialog *dialog = new KileDialog::UserHelpDialog();
+ dialog->setParameter(m_menuentries,m_helpfiles);
+ if ( dialog->exec() )
+ {
+ //KILE_DEBUG() << "\t new userhelp entries accepted" << endl;
+ dialog->getParameter(userhelpmenulist,userhelpfilelist);
+ updateEntries(userhelpmenulist,userhelpfilelist);
+ }
+
+ delete dialog;
+}
+
+}
+
+#include "userhelp.moc"
+
diff --git a/src/kile/userhelp.h b/src/kile/userhelp.h
new file mode 100644
index 0000000..6149d67
--- /dev/null
+++ b/src/kile/userhelp.h
@@ -0,0 +1,71 @@
+/***************************************************************************
+ userhelp.h
+----------------------------------------------------------------------------
+ date : Aug 17 2006
+ version : 0.15
+ copyright : (C) 2005-2006 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef USERHELP_H
+#define USERHELP_H
+
+#include <qwidget.h>
+#include <qpopupmenu.h>
+#include <qstringlist.h>
+
+#include <kmenubar.h>
+#include <kconfig.h>
+#include <klocale.h>
+
+#include "kiletoolmanager.h"
+
+namespace KileHelp
+{
+
+class UserHelp: public QObject
+{
+ Q_OBJECT
+
+public:
+ UserHelp(KileTool::Manager *manager, KMenuBar *menubar);
+ ~UserHelp();
+ void userHelpDialog();
+ void enableUserHelpEntries(bool state);
+
+private slots:
+ void slotUserHelpActivated(int index);
+ //void slotUserHelpDialog();
+
+private:
+ void readConfig();
+ void writeConfig();
+
+ void setupUserHelpMenu();
+ void expandHelpMenu();
+
+ QPopupMenu *getHelpPopup();
+ int getHelpIndex(QPopupMenu *popup);
+
+ void updateEntries(const QStringList &entries, const QStringList &files, bool save = true);
+
+ KileTool::Manager *m_manager;
+ KMenuBar *m_menubar;
+
+ QPopupMenu *m_helpmenu, *m_helppopup;
+ int m_helpid, m_sepid;
+ QStringList m_menuentries, m_helpfiles;
+};
+
+}
+
+#endif
diff --git a/src/kile/userhelpdialog.cpp b/src/kile/userhelpdialog.cpp
new file mode 100644
index 0000000..24de11d
--- /dev/null
+++ b/src/kile/userhelpdialog.cpp
@@ -0,0 +1,467 @@
+/***************************************************************************
+ userhelpdialog.cpp
+----------------------------------------------------------------------------
+ date : Jul 22 2005
+ version : 0.20
+ copyright : (C) 2005 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "userhelpdialog.h"
+
+#include <qlayout.h>
+#include <qvgroupbox.h>
+#include <qlabel.h>
+#include <qinputdialog.h>
+#include <qfileinfo.h>
+#include <qwhatsthis.h>
+
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <krun.h>
+#include <kurl.h>
+#include "kiledebug.h"
+
+
+namespace KileDialog
+{
+
+//////////////////// UserHelpDialog ////////////////////
+
+//BEGIN UserHelpDialog
+
+UserHelpDialog::UserHelpDialog(QWidget *parent, const char *name)
+ : KDialogBase( parent, name, true, i18n("Configure User Help"), Cancel | Ok, Ok, true )
+{
+ KILE_DEBUG() << "==UserHelpDialog::UserHelpDialog()===================" << endl;
+
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+
+ // layout
+ QVBoxLayout *vbox = new QVBoxLayout(page, 6,6 );
+ QVGroupBox* group= new QVGroupBox(i18n("User Help"),page );
+
+ QWidget *widget = new QWidget(group);
+ QGridLayout *grid = new QGridLayout( widget, 5,3, 5,5, "" );
+ grid->setRowStretch(1,1);
+ grid->setColStretch(0,1);
+ grid->setRowSpacing(2,12);
+ grid->setColSpacing(1,20);
+
+ // listbox
+ QLabel *label1 = new QLabel(i18n("&Menu item:"),widget);
+ grid->addWidget( label1,0,0 );
+ m_menulistbox = new KListBox(widget);
+ grid->addWidget( m_menulistbox, 1,0 );
+ label1->setBuddy(m_menulistbox);
+
+ // action widget
+ QWidget *actionwidget = new QWidget(widget);
+ QVBoxLayout *actions = new QVBoxLayout(actionwidget);
+
+ m_add = new KPushButton(i18n("&Add..."),actionwidget);
+ m_remove = new KPushButton(i18n("&Remove"),actionwidget);
+ m_addsep = new KPushButton(i18n("&Separator"),actionwidget);
+ m_up = new KPushButton(i18n("Move &Up"),actionwidget);
+ m_down = new KPushButton(i18n("Move &Down"),actionwidget);
+
+ int wmax = m_add->sizeHint().width();
+ int w = m_remove->sizeHint().width();
+ if ( w > wmax ) wmax = w;
+ w = m_addsep->sizeHint().width();
+ if ( w > wmax ) wmax = w;
+ w = m_up->sizeHint().width();
+ if ( w > wmax ) wmax = w;
+ w = m_down->sizeHint().width();
+ if ( w > wmax ) wmax = w;
+
+ m_add->setFixedWidth(wmax);
+ m_remove->setFixedWidth(wmax);
+ m_addsep->setFixedWidth(wmax);
+ m_up->setFixedWidth(wmax);
+ m_down->setFixedWidth(wmax);
+
+ actions->addStretch(1);
+ actions->addWidget(m_add);
+ actions->addWidget(m_remove);
+ actions->addSpacing(20);
+ actions->addWidget(m_addsep);
+ actions->addSpacing(20);
+ actions->addWidget(m_up);
+ actions->addWidget(m_down);
+ actions->addStretch(1);
+
+ // inserta ction widget
+ grid->addWidget( actionwidget,1,2, Qt::AlignTop );
+
+ // file
+ QLabel *label2 = new QLabel(i18n("File:"),widget);
+ grid->addWidget( label2, 3,0 );
+ m_fileedit = new KLineEdit("",widget);
+ m_fileedit->setReadOnly(true);
+ grid->addMultiCellWidget( m_fileedit, 4,4,0,2 );
+
+ // fill vbox
+ vbox->addWidget(group);
+
+ connect( m_menulistbox, SIGNAL(highlighted(int)),this,SLOT(slotChange(int)));
+ connect( m_add, SIGNAL(clicked()), SLOT(slotAdd()) );
+ connect( m_remove, SIGNAL(clicked()), SLOT(slotRemove()) );
+ connect( m_addsep, SIGNAL(clicked()), SLOT(slotAddSep()) );
+ connect( m_up, SIGNAL(clicked()), SLOT(slotUp()) );
+ connect( m_down, SIGNAL(clicked()), SLOT(slotDown()) );
+
+ resize(400,sizeHint().height());
+ updateButton();
+}
+
+void UserHelpDialog::setParameter(const QStringList &menuentries, const QStringList &helpfiles)
+{
+ for (uint i=0; i<menuentries.count(); ++i)
+ {
+ m_menulistbox->insertItem(menuentries[i]);
+
+ if ( m_menulistbox->text(i) != "-" )
+ m_filelist << helpfiles[i];
+ else
+ m_filelist << QString::null ;
+ }
+ updateButton();
+}
+
+void UserHelpDialog::getParameter(QStringList &userhelpmenulist, QStringList &userhelpfilelist)
+{
+ // clear result
+ userhelpmenulist.clear();
+ userhelpfilelist.clear();
+ bool separator = false;
+
+ // now get all entries
+ for (uint i=0; i<m_menulistbox->count(); ++i)
+ {
+ if ( m_menulistbox->text(i) != "-" )
+ {
+ userhelpmenulist << m_menulistbox->text(i);
+ userhelpfilelist << m_filelist[i];
+ separator = false;
+ }
+ else if ( !separator )
+ {
+ userhelpmenulist << m_menulistbox->text(i);
+ userhelpfilelist << QString::null;
+ separator = true;
+ }
+ }
+}
+
+void UserHelpDialog::slotChange(int index)
+{
+ if ( index >= 0 )
+ {
+ m_fileedit->setText( m_filelist[index] );
+ }
+ else
+ {
+ m_fileedit->clear();
+ }
+ updateButton();
+}
+
+void UserHelpDialog::slotAdd()
+{
+ KileDialog::UserHelpAddDialog *dialog = new KileDialog::UserHelpAddDialog(m_menulistbox,this);
+ if ( dialog->exec() )
+ {
+ // insert into listbox
+ m_menulistbox->insertItem( dialog->getMenuitem() );
+ m_menulistbox->setCurrentItem( m_menulistbox->count()-1 );
+
+ // with corresponding filename
+ QString helpfile = dialog->getHelpfile();
+ m_filelist.append(helpfile);
+ m_fileedit->setText(helpfile);
+
+ updateButton();
+ }
+}
+
+void UserHelpDialog::slotRemove()
+{
+ // get current index
+ int index = m_menulistbox->currentItem();
+ if ( index >= 0 )
+ {
+ // remove item
+ m_menulistbox->removeItem(index);
+ m_filelist.remove( m_filelist.at(index) );
+
+ // select a new index: first we try to take the old index. When
+ // this index is too big now, index is decremented.
+ // If the list is empty now, index is set to -1.
+ int entries = (int)m_menulistbox->count();
+ if ( entries > 0 )
+ {
+ if ( index >= entries )
+ index--;
+ m_menulistbox->setSelected(index,true);
+ }
+ else
+ {
+ m_menulistbox->setCurrentItem(-1);
+ }
+ }
+
+ updateButton();
+}
+
+void UserHelpDialog::slotAddSep()
+{
+ // get current index
+ int index = m_menulistbox->currentItem();
+ if ( index == -1 ) return;
+
+ // insert separator
+ m_menulistbox->insertItem("-",index);
+ m_filelist.insert( m_filelist.at(index) ,QString::null );
+
+ updateButton();
+}
+
+void UserHelpDialog::slotUp()
+{
+ // get current index
+ int index = m_menulistbox->currentItem();
+ if ( index <= 0 ) return;
+
+ // insert current entry before current
+ m_menulistbox->insertItem(m_menulistbox->currentText(),index-1);
+ m_filelist.insert( m_filelist.at(index-1) , m_filelist[index] );
+
+ // then remove the old entry
+ m_menulistbox->removeItem(index+1);
+ m_filelist.remove( m_filelist.at(index+1) );
+
+ // select current entry
+ m_menulistbox->setSelected(index-1,true);
+
+ updateButton();
+}
+
+void UserHelpDialog::slotDown()
+{
+ int entries = (int)m_menulistbox->count();
+
+ // get current index
+ int index = m_menulistbox->currentItem();
+ if ( index<0 || index==entries-1 ) return;
+
+ // insert current entry after current
+ if ( index < entries-2 )
+ {
+ m_menulistbox->insertItem(m_menulistbox->currentText(),index+2); // index + 2
+ m_filelist.insert( m_filelist.at(index+2) , m_filelist[index] );
+ }
+ else
+ {
+ m_menulistbox->insertItem(m_menulistbox->currentText()); // at the end
+ m_filelist.append( m_filelist[index] );
+ }
+
+ // then remove the old entry
+ m_menulistbox->removeItem(index);
+ m_filelist.remove( m_filelist.at(index) );
+
+ // select current entry
+ m_menulistbox->setSelected(index+1,true);
+
+ updateButton();
+}
+
+void UserHelpDialog::updateButton()
+{
+ // default states
+ bool rem_state = false;
+ bool sep_state = false;
+ bool up_state = false;
+ bool down_state = false;
+
+ // change button states, if there are entries
+ int index = m_menulistbox->currentItem();
+ int entries = (int)m_menulistbox->count();
+ if ( entries == 1 )
+ {
+ rem_state = true;
+ }
+ else if ( entries >= 2 )
+ {
+ rem_state = true;
+ if ( index == 0 )
+ {
+ down_state = true; // index = 0
+ }
+ else if ( index == entries-1 )
+ {
+ sep_state = true; // index = entries-1
+ up_state = true;
+ }
+ else
+ { // 0 < index < entries-1
+ sep_state = true;
+ up_state = true;
+ down_state = true;
+ }
+ }
+
+ // don't allow two continuous spearators
+ if ( m_menulistbox->currentText() == "-" )
+ sep_state = false;
+
+ // set button states
+ m_remove->setEnabled(rem_state);
+ m_addsep->setEnabled(sep_state);
+ m_up->setEnabled(up_state);
+ m_down->setEnabled(down_state);
+}
+//END UserHelpDialog
+
+//////////////////// UserHelpAddDialog ////////////////////
+
+//BEGIN UserHelpAddDialog
+
+UserHelpAddDialog::UserHelpAddDialog(KListBox *menulistbox, QWidget *parent, const char *name)
+ : KDialogBase( parent, name, true, i18n("Add User Helpfile"), Cancel | Ok, Ok, true ),
+ m_menulistbox(menulistbox)
+{
+ KILE_DEBUG() << "==UserHelpAddDialog::UserHelpAddDialog()===================" << endl;
+
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+
+ // layout
+ QVBoxLayout *vbox = new QVBoxLayout(page, 6,6 );
+ QVGroupBox* group= new QVGroupBox(i18n("User Help"),page );
+
+ QWidget *widget = new QWidget(group);
+ QGridLayout *grid = new QGridLayout( widget, 2,6, 5,5, "" );
+ grid->setColSpacing(2,8);
+ grid->setColSpacing(4,8);
+
+ // menu entry
+ QLabel *label1 = new QLabel(i18n("&Menu entry:"),widget);
+ grid->addWidget( label1,0,0 );
+ m_leMenuEntry = new KLineEdit("",widget);
+ grid->addWidget( m_leMenuEntry, 0,1 );
+ label1->setBuddy(m_leMenuEntry);
+
+ // help file
+ QLabel *label2 = new QLabel(i18n("&Help file:"),widget);
+ grid->addWidget( label2, 1,0 );
+ m_leHelpFile = new KLineEdit("",widget);
+ m_leHelpFile->setReadOnly(false);
+ grid->addWidget( m_leHelpFile, 1,1 );
+ m_pbChooseFile = new KPushButton("", widget, "filechooser_button" );
+ m_pbChooseFile->setPixmap( SmallIcon("fileopen") );
+ grid->addRowSpacing( 1, m_pbChooseFile->sizeHint().height()+5 );
+ grid->addWidget(m_pbChooseFile,1,3);
+ m_pbChooseHtml = new KPushButton("", widget, "htmlchooser_button" );
+ m_pbChooseHtml->setPixmap( SmallIcon("viewhtml") );
+ grid->addWidget(m_pbChooseHtml,1,5);
+ grid->setColSpacing(3, m_pbChooseFile->sizeHint().width()+5 );
+ grid->setColSpacing(5, m_pbChooseHtml->sizeHint().width()+5 );
+
+ label2->setBuddy(m_pbChooseFile);
+
+ // fill vbox
+ vbox->addWidget(group);
+ vbox->addStretch();
+
+ QWhatsThis::add(m_leMenuEntry,i18n("The menu entry for this help file."));
+ QWhatsThis::add(m_leHelpFile,i18n("The name of the local help file or a valid WEB url."));
+ QWhatsThis::add(m_pbChooseFile,i18n("Start a file dialog to choose a local help file."));
+ QWhatsThis::add(m_pbChooseHtml,i18n("Start the konqueror to choose a WEB url as help file. This url should be copied inzo the edit widget."));
+
+ connect( m_pbChooseFile, SIGNAL( clicked() ), this, SLOT( slotChooseFile() ) );
+ connect( m_pbChooseHtml, SIGNAL( clicked() ), this, SLOT( slotChooseHtml() ) );
+
+ setFocusProxy( m_leMenuEntry );
+ resize(500,sizeHint().height());
+}
+
+void UserHelpAddDialog::slotChooseFile()
+{
+ QString directory = QDir::currentDirPath();
+ QString filter = "*.*|All Files\n*.dvi|DVI Files\n*.ps|PS Files\n*.pdf|PDF Files\n*.html *.htm|HTML Files";
+
+ QString filename = KFileDialog::getOpenFileName( directory,filter,this,i18n("Select File") );
+ if ( filename.isEmpty() )
+ return;
+
+ QFileInfo fi(filename);
+ if ( ! fi.exists() )
+ {
+ KMessageBox::error(0,QString(i18n("File '%1' does not exist.")).arg(filename));
+ return;
+ }
+
+ m_leHelpFile->setText( filename );
+}
+
+void UserHelpAddDialog::slotChooseHtml()
+{
+ KURL url;
+ url.setPath("about:blank");
+ KRun::runURL(url,"text/html");
+}
+
+void UserHelpAddDialog::slotOk()
+{
+ m_leMenuEntry->setText( m_leMenuEntry->text().stripWhiteSpace() );
+ QString filename = m_leHelpFile->text().stripWhiteSpace();
+ m_leHelpFile->setText( filename );
+
+ if ( m_leMenuEntry->text().isEmpty() )
+ {
+ KMessageBox::error(this,i18n("No menuitem was given."));
+ return;
+ }
+
+ if ( m_menulistbox->findItem(m_leMenuEntry->text(),Qt::ExactMatch) )
+ {
+ KMessageBox::error(this,i18n("This menuitem already exists."));
+ return;
+ }
+
+ if ( filename.isEmpty() )
+ {
+ KMessageBox::error(this,i18n("No help file was chosen."));
+ return;
+ }
+
+ QFileInfo fi(filename);
+ if ( filename.find("http://",0)!=0 && !fi.exists() )
+ {
+ KMessageBox::error(this,QString(i18n("File '%1' doesn't exist.")).arg(filename));
+ return;
+ }
+
+ accept();
+}
+
+//END UserHelpAddDialog
+
+}
+
+#include "userhelpdialog.moc"
+
diff --git a/src/kile/userhelpdialog.h b/src/kile/userhelpdialog.h
new file mode 100644
index 0000000..9c87ab8
--- /dev/null
+++ b/src/kile/userhelpdialog.h
@@ -0,0 +1,86 @@
+/***************************************************************************
+ userhelpdialog.h
+----------------------------------------------------------------------------
+ date : Jul 22 2005
+ version : 0.20
+ copyright : (C) 2005 by Holger Danielsson
+ email : holger.danielsson@t-online.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef USERHELPDIALOG_H
+#define USERHELPDIALOG_H
+
+#include <qwidget.h>
+#include <qstringlist.h>
+
+#include <klistbox.h>
+#include <klineedit.h>
+#include <kpushbutton.h>
+#include <kdialogbase.h>
+
+namespace KileDialog
+{
+
+class UserHelpDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ UserHelpDialog(QWidget *parent=0, const char *name=0);
+ ~UserHelpDialog() {}
+
+ void setParameter(const QStringList &menuentries, const QStringList &helpfiles);
+ void getParameter(QStringList &userhelpmenulist, QStringList &userhelpfilelist);
+private:
+ KListBox *m_menulistbox;
+ KLineEdit *m_fileedit;
+ KPushButton *m_add, *m_remove, *m_addsep, *m_up, *m_down;
+
+ QStringList m_filelist;
+
+ void updateButton();
+
+private slots:
+ void slotChange(int index);
+ void slotAdd();
+ void slotRemove();
+ void slotAddSep();
+ void slotUp();
+ void slotDown();
+};
+
+class UserHelpAddDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ UserHelpAddDialog(KListBox *menulistbox, QWidget *parent=0, const char *name=0);
+ ~UserHelpAddDialog() {}
+
+private:
+ KLineEdit *m_leMenuEntry, *m_leHelpFile;
+ KPushButton *m_pbChooseFile,*m_pbChooseHtml;
+ KListBox *m_menulistbox;
+
+public:
+ QString getMenuitem() { return m_leMenuEntry->text(); }
+ QString getHelpfile() { return m_leHelpFile->text(); }
+
+private slots:
+ void slotChooseFile();
+ void slotChooseHtml();
+ void slotOk();
+};
+
+}
+
+#endif
diff --git a/src/kile/usermenudialog.cpp b/src/kile/usermenudialog.cpp
new file mode 100644
index 0000000..5f26966
--- /dev/null
+++ b/src/kile/usermenudialog.cpp
@@ -0,0 +1,179 @@
+/***************************************************************************
+ begin : Sun Jun 3 2001
+ copyright : (C) 2001 - 2003 by Brachet Pascal, 2003 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#include "usermenudialog.h"
+
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qlayout.h>
+#include <qcombobox.h>
+#include <qregexp.h>
+#include <qradiobutton.h>
+#include <qbuttongroup.h>
+
+#include <kpushbutton.h>
+#include <klocale.h>
+#include <ktextedit.h>
+#include "kiledebug.h"
+
+namespace KileDialog
+{
+
+UserTags::UserTags(const QValueList<KileAction::TagData> &list, QWidget* parent, const char* name, const QString &caption)
+ : KDialogBase(parent,name,true,caption,KDialogBase::Apply|KDialogBase::Cancel, KDialogBase::Apply, true),
+ m_list(list)
+{
+ QWidget *page = new QWidget( this );
+ setMainWidget(page);
+ QGridLayout *gbox = new QGridLayout( page, 6, 3,5,5,"");
+ gbox->addRowSpacing( 0, fontMetrics().lineSpacing() );
+
+ m_combo=new QComboBox(page,"combo");
+ connect(m_combo, SIGNAL(activated(int)),this,SLOT(change(int)));
+
+ m_labelName = new QLabel( page, "label1" );
+ m_labelName->setText(i18n("Menu item:"));
+ m_editName =new QLineEdit(page,"name");
+
+ m_labelTag = new QLabel( page, "label2" );
+ m_labelTag->setText(i18n("Value:"));
+ m_editTag=new KTextEdit(page,"tag");
+ m_editTag->setTextFormat(Qt::PlainText);
+
+ m_buttonAdd = new KPushButton(i18n("Add"),page);
+ m_buttonInsert = new KPushButton(i18n("Insert"),page);
+ m_buttonRemove = new KPushButton(i18n("Remove"),page);
+
+ connect(m_buttonAdd, SIGNAL(clicked()) , this , SLOT(slotAdd()));
+ connect(m_buttonInsert, SIGNAL(clicked()) , this , SLOT(slotInsert()));
+ connect(m_buttonRemove, SIGNAL(clicked()) , this , SLOT(slotRemove()));
+
+ gbox->addMultiCellWidget(m_combo,0,0,0,2,0);
+ gbox->addMultiCellWidget(m_labelName,1,1,0,2,0);
+ gbox->addMultiCellWidget(m_editName,2,2,0,2,0);
+ gbox->addMultiCellWidget(m_labelTag,3,3,0,2,0);
+ gbox->addMultiCellWidget(m_editTag,4,4,0,2,0);
+ gbox->addWidget(m_buttonAdd, 5,0, Qt::AlignLeft);
+ gbox->addWidget(m_buttonInsert, 5,1, Qt::AlignLeft);
+ gbox->addWidget(m_buttonRemove, 5,2, Qt::AlignLeft);
+
+ resize(350,150);
+
+ m_prevIndex=0;
+ redraw();
+}
+
+UserTags::~UserTags()
+{
+}
+
+void UserTags::redraw()
+{
+ KILE_DEBUG() << QString("usermenudialog redraw() m_prevIndex = %1, m_list.size() = %2").arg(m_prevIndex).arg(m_list.size()) << endl;
+ m_combo->clear();
+
+ if (m_list.size() > 0)
+ {
+ for (uint i=0; i<m_list.size(); ++i)
+ {
+ m_combo->insertItem( QString::number(i+1) + ": " + m_list[i].text );
+ }
+ m_combo->setCurrentItem(m_prevIndex);
+
+ m_editTag->setText( completeTag(m_list[m_prevIndex]) );
+ m_editName->setText(m_list[m_prevIndex].text);
+ }
+ else
+ {
+ m_editTag->setText("");
+ m_editName->setText("");
+ }
+}
+
+void UserTags::change(int index)
+{
+ KILE_DEBUG() << QString("usermenudialog: change(%1) prev %2").arg(index).arg(m_prevIndex) << endl;
+ m_list[m_prevIndex] = splitTag(m_editName->text(), m_editTag->text());
+
+ m_combo->changeItem(QString::number(m_prevIndex+1)+": "+m_list[m_prevIndex].text, m_prevIndex);
+
+ m_editTag->setText( completeTag(m_list[index]) );
+ m_editName->setText(m_list[index].text);
+
+ m_prevIndex=index;
+}
+
+void UserTags::slotApply()
+{
+ //store current values before exiting
+ if (m_list.count() > 0 )
+ m_list[m_prevIndex] = splitTag(m_editName->text(), m_editTag->text());
+
+ KILE_DEBUG() << "usermenudialog: slotApply" << endl;
+ accept();
+}
+
+void UserTags::slotAdd()
+{
+ m_list.append(splitTag(m_editName->text(), m_editTag->text()));
+
+ m_prevIndex = m_list.count() - 1;
+ redraw();
+}
+
+void UserTags::slotInsert()
+{
+ m_list.insert(m_list.at(m_prevIndex), splitTag(m_editName->text(), m_editTag->text()));
+ redraw();
+}
+
+void UserTags::slotRemove()
+{
+ if (m_list.size() > 0)
+ {
+ m_list.remove( m_list.at(m_prevIndex) );
+
+ --m_prevIndex;
+ if (m_prevIndex >= static_cast<int>(m_list.count()) ) m_prevIndex = m_list.count()-1;
+ if (m_prevIndex < 0 ) m_prevIndex=0;
+
+ redraw();
+ }
+}
+
+QString UserTags::completeTag(const KileAction::TagData & td)
+{
+ if ( td.tagEnd.length() == 0 )
+ return td.tagBegin;
+ else
+ return td.tagBegin + "%M" + td.tagEnd;
+}
+
+KileAction::TagData UserTags::splitTag(const QString & name, const QString & tag)
+{
+ QStringList parts = QStringList::split("%M", tag);
+ int dx = parts[0].length();
+ if ( parts[1].length() == 0 )
+ {
+ int i = parts[0].find(QRegExp("[\\[\\{\\(]"));
+ if ( i != -1 )
+ dx = i + 1;
+ }
+
+ return KileAction::TagData(name, parts[0], parts[1], dx, 0, QString::null);
+}
+
+}
+
+#include "usermenudialog.moc"
diff --git a/src/kile/usermenudialog.h b/src/kile/usermenudialog.h
new file mode 100644
index 0000000..38f1ecc
--- /dev/null
+++ b/src/kile/usermenudialog.h
@@ -0,0 +1,73 @@
+/***************************************************************************
+ begin : Sun Jun 3 2001
+ copyright : (C) 2001 - 2003 by Brachet Pascal, 2003 Jeroen Wijnhout
+ email : Jeroen.Wijnhout@kdemail.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef USERMENUDIALOG_H
+#define USERMENUDIALOG_H
+
+#include <qstring.h>
+#include <qstringlist.h>
+
+#include <kdialogbase.h>
+
+#include "kileactions.h"
+
+class QRadioButton;
+class KTextEdit;
+class QLineEdit;
+class QComboBox;
+class QLabel;
+class KPushButton;
+
+namespace KileDialog
+{
+
+class UserTags: public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ UserTags( const QValueList<KileAction::TagData> &list, QWidget* parent = 0, const char* name = 0, const QString &caption = QString::null);
+ ~UserTags();
+
+ int index() { return m_prevIndex; }
+ const QValueList<KileAction::TagData>& result() {return m_list; }
+
+ static QString completeTag(const KileAction::TagData & td);
+ static KileAction::TagData splitTag(const QString & name, const QString & tag);
+
+private slots:
+ void change(int index);
+ void redraw();
+
+ void slotAdd();
+ void slotInsert();
+ void slotRemove();
+
+ void slotApply();
+
+private:
+ int m_prevIndex;
+ KTextEdit *m_editTag;
+ QLineEdit *m_editName;
+ QComboBox *m_combo;
+ QLabel *m_labelName;
+ QLabel *m_labelTag;
+ KPushButton *m_buttonRemove, *m_buttonAdd, *m_buttonInsert;
+
+ QValueList<KileAction::TagData> m_list;
+};
+
+}
+
+#endif // USERMENUDIALOG_H